Archive for October, 2006

jMock is cool

I have started to work with “jMock in my unit tests”:http://www.jmock.org/index.html. I gotta say that I really like it. The main point of jMock is that it allows you to quickly implement dependencies for a class and then inject those dependencies into the object that you are testing. This allows you to fully isolate your object from the rest of its environment.

I realize that jMock has been around for a while, and I realize that there is some opposition to its use among people in the Java community, but it is new to me and it has definitely affected the way that I go about unit testing my classes. At first it seems a pain to create the mock objects and learn the different method calls, but once you get that, it is really easy to work with.

The only limitation that I have found so far is if you need to implement a dependency that modifies an object that it is given in some way and then returns it to the calling method. On the other hand, I am not sure that code should be doing this anyway. An example of this would be mocking up a Hibernate save() call where Hibernate would inject the primary key into the object once it has been saved to the database (okay, that is probably a bad example as equality should not be based on the primary key, but on the attributes of the object).

NetBeans 5.5 RC1 Released

NetBeans has released the first “Release Candidate of NetBeans 5.5″:http://www.netbeans.info/downloads/download.php?type=5.5rc1. Hopefully this means that the final release is just around the corner.

Spring 2.0 released

“Spring 2.0 was released today”:http://www.theserverside.com/news/thread.tss?thread_id=42460. For more info, read the link. I guess the real question that should be asked is whether it makes sense to upgrade or wait for the first Spring 2.0 books to come out and show us how it should be done.

“The link to the actual article on the Spring website”:http://www.springframework.org/go-2.0.

« Previous Page