We are back again. The ConSol posse enters Devoxx again and will posts some expressions from this largest independent Java conference. Roughly 3500 attendees transform Antwerp into Java’s epicenter for one week.
And as always, this weeks starts with two university days. Fabian, Mario, Julian and Roland attend the whole conference, Christoph, Thorsten and Jan will arrive today for the three conference days.
So let’s see what was on staged at the first day
Arun Gupta and Antonio Goncalves were holding a 3 hour in-depth walk through all of Java EE 7. For each of the JSRs, they showed examples of what’s new in the current version. The code samples are available on Arun Gubta’s GitHub page: https://github.com/arun-gupta/javaee7-samples
Questions and comments where provided live via Twitter and where read during the talk, so if you want to have an impression on the discussed topics, check for hash tag #DV13-UniJavaEE7.
The point I found most interesting is that EJB will eventually be split into a bunch of independent JSRs, one for each feature. Interceptor API is already part of JEE, transactional methods are now enabled via JTA and can be used independently of EJB. Seems that EJBs are no longer needed in many cases.
However, with Glassfish no longer commercially supported, it will take some time until we see those new features in production.
Kees Jan Koster is founder of Java-monitor.com and he shares his knowledge
about JVM bytecode in his talk.
At first he has showed how to inject bytecode into existing classes. The use case was to find
out which class is closing an SQL connection inside a deployed tomcat webapp. To get the result,
he created a javaagent which modifies the Java-SQL-Connection-Class
to print the stacktrace when the method ‘close()’ is called. To get the result, he created
a class which implements the interface ClassFileTransformer
It has a method ‘tranform’ which is called before the classfile-verifier. The method gets from
every loaded class the bytes as parameter. You can modify the bytes, so you can change the loaded class.
To modify the classbytes he showed three different libraries to make this easier.
At the second half he showed examples how javacode looks as bytecode.
This part gave a deep knowledge how bytecode interact with the stack
and what optimizations are done with types.
Especially very surprising was how bloated the bytecode is, when ‘try finally’ is used.
The code inside the finally code will be doubled.
In my opinion this was a very interesting talk. Now I know a lot more about bytecode and
how I can modify it inside the JVM. Some additional information was given by an ASM developer
in the audience who clarified some points.
But one question is still to discuss. When will I need to act with the bytecode directly when I
have a lot of high level tools like a debugger?
This three hour university talk gave a broad overview of the testing tools available in JavaScript land. After a general introduction into testing and the several flavors of testing (unit, integration, acceptance) a whole bunch of thesting tools were presented, along with their pros- and cons
PhantomJS is a pure headless browser which is QtWebkit based. It provides an embedded Coffeescript compiler and allows saving screenshots to disk. It has some limitations, though:
- No flash
- CSS 3D
- Video / Audio
- WebGL
- Geolocation, Fonts
PhantomJS is not a test framework but the foundation for a other tools like …
CasperJS adds a higher API to PhantomsJS with a fluent JavaScript API.
Zombie is similar to CasperJS as it is a testframework for writing acceptance tests. Againg, its a headless browser, but it is not based on a real browser engine. Instead it emulates as browser and runs on node.js.
QUnit is a lightweight testing framework running in the Browser. It is intended for unit testing and is able to ouput xUnit format, which makes it easy to integrate into CI tools like Jenkings. It’s quite old, but also very matured with a lot of plugins for various purposes.
Sinon.js is a test library for JS with no dependencies. Its more or less similar to Java Mockframeworks like Mockito, EasyMock or JMock for Java. However, it has also unique features like Spies, fake timers or fike Ajax requests.
Karma is a test runner for node.js with Multi Browser support. It comes from the Angular war and supports many test frameworks, i.e. Angular Scenario for integration tests. However, currently Angular itself is moving away from Karma in favor for Protractor for acceptance tests. Intrestingly, Karma on Chrome is quite a bit faster than PhantomJS.
Finally some smaller test tools were mentioned briefly:
All in all I took away a tons of information about JavaScript testing and have now tons of pointers to check out. There where many demos, which was good. However, some of the demos were to trivial, simply only repeating was on the slide just before. What I missed a bit was some recommendations how to integrate the test tools in a build, either with grunt or brunch or, even better, with Maven or Gradle (dedicated plugins ?, simple ‘exec’ ? etc.). A last technical note: The beamer in room 9 is really too fuzzy and blurry. It was really hard to follow the code samples, even with a large font. Hopefully this can be fixed, the projections in the other rooms is quite better.