I Think I Caught That JUnit Bug...
It would appear that I am test infected. It's odd since I used to resist writing JUnit tests as much as I could. There were so many things that were just hard to test.
I did play with Cactus to try to test my servlets and filters, but never quite could get it to work. HttpUnit is fine, but it is more geared toward functional testing rather than unit testing. I ended up pretty much giving up on testing them properly.
Two things happened though.
First, I played with Ruby on Rails. I was curious, so I downloaded the framework, watched the demos and worked through the tutorials. I even got both the PickAxe and the Ruby on Rails book from the Pragmatic Programmers. I realized then that unit testing didn't have to be so painful and frustrating.
I then started to use Spring. Spring is amazing as an Inversion of Control container. So far, it has made my job a lot easier with its focus on Dependency Injection. When it comes to testing, Spring ships with a library of mock objects mimicking J2EE objects. It makes testing the application a lot easier and a lot more fun. Tests aren't difficult to setup anymore, they run fast. And with a little work, it integrates nicely into NetBeans.
I still have a lot more work to do. I guess that I should get back to it...
-- Fred
( Nov 03 2005, 05:59:42 PM MST ) Permalink Comments [1]

