Showing posts with label mail. Show all posts
Showing posts with label mail. Show all posts

Friday, 18 May 2007

Mock JavaMail rocks. Mocking out protocols and services is damn useful

If ever you find yourself needing to test some JavaMail code, I highly recommend Mock JavaMail. It does exactly what it says on the tin & is very useful. Its yet another project from the incredibly prolific Kohsuke - nice job! We're using Mock JavaMail on Camel to test our Mail Integration and its been soo useful.

All APIs to messaging & integration systems and protocols should have some Mock testing library to allow developers to create easy unit tests and to save them having to mock complex services (which you're never sure your mocks are faithful to the underlying systems & protocols).

For JMS we can use ActiveMQ. For Camel and JBI we have Mock Endpoints (which I wish we had years ago, it'd have made developing ServiceMix much easier). For files you can just use your local file system; for databases you can use Derby, HSQLDB or H2. For HTTP/REST you can just embed Jetty.

I guess the missing things are things like XMPP and FTP. Anyone seen any other interesting mock projects for specific protocols, APIs and services? (Yes I know about jMock :)