Lessons on testing a JPA Dao

I wanted to explore unit testing JPA DAO and models. Hand crafting solutions is quite time consuming. I found something called Unitils which refines another project Dbunit. In theory it should significantly reduce the complexity and save some time. So one Saturday, I sat down to explore the space and write this blog.

Continue reading

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

5 exciting things coming with Spring 3.0

In a previous blog entry I wrote about the now ancient announcement that spring 2.5 would be available. On the 2nd anniversary of that announcement I would like to examine the things I am looking forward to in Spring 3.0.

Release Announcement: 13/11/2009

5 cool things available in Spring 3.0

  1. Java 5 fully used throughout the whole API. In 2.5 the core is still Java 1.4 compatible, 3.0 is written in and requires Java 5.0. This means much greater use of generics. Unrelated but they have also included many performance enhancements.
  2. SpEL. Spring Expression Language gives access to nested bean definitions and system properties via #{…} syntax in property values. These dynamic #{…} expressions and static ${…} placeholders can also be used to inject property settings via the @Value annotation. This should much simplify property setting.
  3. Comprehensive REST support. Spring 2.5 MVC is an excellent pattern. The simplicity of annotated controllers results in very clean implementations. 3.0 takes this system further by building in Restful support and a RestTemplate for clientside REST.
  4. Spring 3.0 UI Field Formatting. Springs formatting system has always been useful in web and desktop applications. Its an effective way to remove a lot of boilerplate code from a system. This new system of annotations allows common formats to be applied to classes, model properties and methods. Check it out its very cool.
  5. Many enhancements migrating to java.util.concurrent including ThreadPoolExecutorFactoryBean which exposes the native ExecutorService interface. The concurrent package is very good indeed, so bringing more support into spring is just fantastic.

Of the 5 mentioned here its only the tip of the iceberg as regards new features. This release is very rich. As usual with spring its when you have something to solve that you really appreciate it.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Racing with Roo

In my last post I said that I would have a deeper look at Spring Roo. Well I still have not quite done that. But I did have a race to see how long it would take me to get my first website up and running with STS and Roo shell. The previous night I downloaded STS, and today I installed it on my Linux server, all very smooth no issues. Next I found a roo shell tutorial to follow: Roo Shell Tutorial Part 2 from the SpringSource blog by Ben Alex.  This uses roo from the prompt, I am going to use the shell in STS.  The challenge is to follow the tutorial and take timings to get some understanding of how difficult it is to get going with Roo.

  1. 21:45 Open Eclipse.
  2. 21:49 Updates downloaded and maven re-indexed.
  3. 21:53 Start tutorial, lots of downloads from maven after project creation.
  4. 21:55 Restart eclipse to enable the runtime weaving, STS does not return…restarted it from the prompt, deleted the project and started again as it looked incomplete.
  5. 22:00 Bumbling through the tutorial.  This is very easy, love the CTRL^space completion.  I have done quite a bit of Linux work, and this shell is very easy to use.
  6. 22:14 Running the tests using roo> perform test. This runs maven, which fails because it cant find the integration test class, RsvpIntegrationTest.  Investigation from the bash prompt reveals that all tests pass under maven, so its not an issue with the project roo has created.  More download and fiddling about.  The test runs from eclipse too, so I move on.
  7. 22:38 Website up! Selenium tests all pass.  Investigation of the functionality shows that its working!  Done in 53 mins not bad I think!
Roo Up and Running!

Roo Up and Running!

Conclusion

Yea easy, a quick look over the project shows its very neat and tidy. Most of the time was spent in download and the false start. The configuration easy to follow and the generated code would be easy to use. So yes, might have a proper look at Roo at some point! ;-)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Quick look at the latest SpringSource STS and Roo

Christian Dupuis from SpringSource shows some of the new features on the SpringIde Blog

I used Spring STS for a few months before starting at Lab49, and found it to be a good distribution over the standard Eclipse build. It has lots of extra productivity features for Spring based development some of which are not available by downloading Spring plugins and adding them to a normal distribution.
The things I like best are:

  • The edit, navigation and search systems now support the spring annotations. So now you can navigate and search for beans declared via annotations.
  • Ability to include new XML domains in the spring configuration from a popup list.
  • The enhanced XML editing support now has inline error checking.
  • This XML editor also supports completion and checking of class and bean names.
  • Roo shell looks interesting too.

Roo and Roo Shell
The Roo system looks great. Its a system to generate and support a JEE system. The roo shell can be used to configure JEE components. You can have a basic website up in seconds. Like Groovy and Grails you get spring standards built in, and your not dependent on the Roo system once your finished.

I am going to take a proper look at it at some point.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)