Thanks for all the suggestions and links. I think we've settled on Mockito. I've done a few small example tests within our code base and think this could be the right way to go. I'll be exploring it in more depth over the next few days. So far it looks good.
@Miroslav Yes, of course there's something wrong with our design. We're writing a new code -- which we want to be unit tested -- but it has to integrate with a 10-year-old code base that was never developed with testing in mind. In fact, in many ways the old code base is downright test-hostile. This means finding the correct places to pull in bulkheads between new and old code, so that we can at least unit test the new stuff well. Mocking looks like it'll be a great help here, particularly since our 'business object framework' (actually more like a bunch of conventions and a few gnarly base classes) is quite invasive. @Noctiluque I'll keep PowerMock in mind in case we absolutely need it. (There are quite a few statics, global singletons and other junk in our system.) But the plan is to refactor those parts of the old system that use statics in a way that impede testing. Refactoring the old parts of the system is hard precisely because there are no unit tests; but adding tests now after 10 years of neglect is hard because we can't refactor it easily. (One step at a time...) But, replacing statics with at least a singleton that the test can swap out should not be prohibitively difficult. @Moandji I hadn't heard of FEST-Assert. Thanks for the tip! // Ben -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
