Skip to main content

Posts

Showing posts from September, 2007

Spring TestContext Framework

I'm somewhat surprised that there hasn't been more noise around in the blogosphere about Spring 2.1's TestContext Framework. I had the pleasure of working with Juergen Hoeller for a day after JavaZone. Among other things, I learned about the fancy @Autowired annotation that you can use to make your autowiring much safer. Normally autowiring is considered bad practice, but it was Juergen's advice that now it is okay to use. This means in practice that all your service beans will still be declared in an applicationContext.xml file, but the dependencies and object graphs will be annotated in the Java files (or atleast where you see fit).

After this I had a deeper look into the features of Spring 2.1. Note the point about "our next-generation Spring TestContext Framework with support for JUnit4". Now this is cool.

Why we need it (or something like it)
For a long while I (and many of my colleagues and peers) have been annoyed by the disability to manage tests as the …

Post JavaZone 2007

In other news, this week I attended JavaZone 2007. Here's a wrap-up:

Wednesday

I was going to attend Stephan Janssen's talk on Web 2.5, but unfortunately the room was completely packed when I got there. So I headed over to Johannes' talk. Not surprisingly, his room was stuffed full as well (and appearantly he never got his projector working). So I ended up wandering into Kaare's talk on open source. As always Kaare delivers a quality talk (with cool slides!), but I can't help being slightly disappointed he chose a more exiting and technical subject.

I headed on to catch Craig McClanahan (hey, wasn't that hard to spell) and his talk on jMaki. It's not the first time I've been presented to it, got some of it on Jazoon. jMaki certainly is a platform to be reconed with for JavaScript developers, and I hope it (or something similar) will become a de facto standard for the range of JS-widget libraries appearing today.

Around then I discovered my phone had been co…

Continous web testing with Selenium, Maven and Continuum part 2

Update: Fixed camelCase in localRepository tag.

It's been a busy week, with JavaZone and some exiting things going on in my project at the same time.

I'll get straight to the point and post an exampe app that will solve the problems from the previous post.

I started off with a maven archetype create webapp.

I added configuration of the Jetty plugin (note that this isn't really necessary to get the rest working, but is handy for testing out the webapp with mvn jetty:run).

I put the web-test running in its own profile, so it won't be ran with each mvn install. This is to underline the fact that you probably don't want the web-tests to be run each time you build the app. Web tests take too much time and should be done by your CI system.

So, all the details of configuring maven for running Selenese tests are inside the with id "web-test". I've done a few other modifications as well, adding a couple of snapshot repos, and the web tests of course. I added …

Continous web testing with Selenium, Maven and Continuum

Wow, nearly a month without posting. I haven't really gotten any good excuses, just lack of stuff to write about, I guess. But for the last week I've been struggling and doing something I find really interesting and useful: Web-testing.

Regular readers will know about my love for Selenium. I still believe that Selenium is the way to go about web-testing.

So, the web application in a project was approaching web-test-worthiness quickly (well, actually it was about a month or two past the point where we should've started doing web-testing). Mind that we were already doing continous integration on the project, so it was only for the reason of not having core-developers breaking any of the stuff being out in the web.

Let me clarify a bit on that last point: Modern web frameworks expose core domain objects way out into the web (like the User.lastName property here in Matt Raible's example).

When core developers refactor Java classes - XML files, property files, JSP files and Jav…