« "Pass-the-parcel" exceptions. | Main | Singleton != Static »

Unit testing email

The JavaMail API is a nice, simple, and effective API. But it's got one problem: it's a bugger to unit test. This is mostly because (unlike most other Sun Java APIs) there are no real interfaces in place, which makes it hard to mock pieces out. An excellent solution to this problem is Dumbster.

Rather than ramble on to much about it, I'll just refer to the excellent Dumbster documentation and to a good post by Mike Clark. Between these, there is little need for me to add my own 2.2 cents.

What I would say, however, is that it is dead easy to use. A few minutes had it dropped into an existing unit test, and validating all the details I cared about. About the only quirk it has is that it is distributed just as source, so you have to run the build script first; not that big a deal really.

Post a comment


About

This page contains a single entry from the blog posted on August 26, 2004 6:58 AM.

The previous post in this blog was "Pass-the-parcel" exceptions..

The next post in this blog is Singleton != Static.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.35