There were some great talks at the 2nd London Java Community Unconference, organised in association with the Apache Software Foundation. This was my first unconference (what is an unconference? It is defined on Wikipedia as a “facilitated, participant-driven conference centered around a theme or purpose”) and the topics ranged across core Java, languages other than Java on the JVM, upcoming releases of popular products and much more.
I attended Mark Thomas’ Tomcat 7 talk. It’s always nice when you have a talk like this given by the release manager and main committer to that project – an old version of his presentation can be found at http://people.apache.org/~markt/presentations/2009-11-04-50mins-Tomcat7.pdf. Richard Paul gave a very useful talk on “Agile Acceptance Testing: Cucumber, Groovy and Selenium2″ (his slides are available at www.rapaul.com) and Richard Donovan added some interesting points on Risk Based Testing. This topic was of particular interest to me at the moment as large Agile projects (>20 devs) seem to require more QA than smaller ones. This may just be a reflection of the complexity of the domain and the project but while I doubt that there is a silver bullet for this, ideas like BDD and RBT can definitely help. The discussion led by Wolf Schlegal on “Going Functional in the JVM” showed that there is a lot of interest in this area but also highlighted that not too many people have actually used functional programming languages in anger and have managed to get them into production environments.
After a short lunch break a round of lightning talks (5 mins – no more) covered Kanban, the benefit of fast feedback with open source, a personal experience of how unit tests can be useful in making developers think about their code before they write it, running a ‘dojo’ event, XSS and OSGI analysis tools in Apache Aries. Barry Cranford was there as the friendly face of recruitment and took an open session of “Ask your recruiter anything”. I’ll admit that I sloped off at this time due to other commitments but I had a great day.
It was my first unconference and while one might think that you could potentially struggle for topics, the reality was that there were more than enough talks to fill the rooms. In fact, the organisers did a great job in separating out the topic threads so that there was minimal overlap or clashes of related talks and I walked away with a lot to think about. Thanks to all the organisers and speakers for a great day.
It’s always nice to meet fellow code heads so I was really happy to go along to the January meeting of the London Java Community
There was a real mix of people from students and recent grads to more experienced developers so the conversations in the bar were pretty varied. One pleasant surprise is that the community is the brain child of a recruiter, Barry Cranford, and that runs it for the members and not as his own talent pool. Given my experience with recruiters over the last 10 years or so, finding one that’s not a snake oil salesman (can you tell how much I love agents?) is an achievement.
There are currently about 870 members of this community so if you are a Java programmer and live in London, why not give it a try.
A discussion within my current team highlighted (or rather highlighted again) that many developers use the above terms almost synonymously. This of course leads to confusion and wasted time as we have to explain to each other what exactly we mean.
With the growing popularity of mocking frameworks like the superb Mockito, people are more likely to use Mock correctly but what about the others? It seemed like a good time to remind ourselves what we each meant.
Read the rest of this entry »
One of the useful features of Struts2 is that the method in your Action that you want the framework to execute does not have to be called execute. While this doesn’t sound like much it means that you can re-use the majority of an Action without having to go down the route of inheriting from a base class.
Following up from my previous post of unit testing actions with annotation based validation, someone asked me how you can specify validation on a method other than action, and here’s how. Read the rest of this entry »
Unit testing Struts actions became a lot easier in Struts 2. With actions being POJOs rather than having to extend a base Action class, unit tests are incredibly simple. Throw in mocking any dependencies using something like Mockito and you have a class that can be unit tested in complete isolation…with one caveat, validation.
While the easiest way to implement validation is to extend the ActionSupport class, you can implement the Validateable and ValidationAware interfaces yourself. Validating the action normally requires you to somehow implement a little bit of the container. This can be done easily enough but it breaks the idea of unit tests just being about the class and starts to wander into the territory of integration tests. Not a big problem really but it can be a real pain in the arse when you have a large project with several hundred tests that all require the initialisation and tear-down of the Struts2 stack.
In Struts 2.0.x, there was a way round this. The class ActionValidatorManagerFactory was provided in the source code that allowed you to create an instance of the ActionValidatorManager. You could use this to call validate on the execute method and you were done.
In Struts 2.1.x, for reasons unknown, the ActionValidatorManager class has been removed. So how are you supposed to validate your actions now? The answer is to re-implement it yourself. Read the rest of this entry »