ObMimic is a library of ready-made test-doubles for the Servlet API. It provides fully-configurable plain-Java implementations of Servlet API objects for use in out-of-container testing of any code that depends on the Servlet API (including, for example, JSF pages).
You can use ObMimic to write comprehensive, detailed tests for such code, using the same tools and techniques as for normal plain-Java code – without having to deploy and run your code inside a servlet container, and without having to write your own stubs or use general-purpose mocks that rely on your own assumptions about the Servlet API’s behaviour.
At its simplest, your tests can obtain fully-functional instances of Servlet API objects using plain no-argument constructors (e.g. “new HttpServletRequestMimic()” to create an HttpServletRequest).
The main changes in this release are:
- First full release: ObMimic is no longer in “beta”.
- Fix to session handling: A bug in session-handling during RequestDispatcher “forwards” and “includes” has been fixed (see 16Bugs Bug #5 for details).
- HttpServletResponseMimic.setStatus(int): By default this no longer clears the response buffer as was specified incorrectly by the Javadoc of Servlet API versions prior to 3.0 (but a new ServletContainerBehaviour option has also been added to allow explicit control over this).
For a more complete list of changes, refer to the Changes in ObMimic 1.0.000 page.
As before, the free “Community Edition” and a free (but time-limited) licence-key file for evaluation of the “Professional Edition” facilities are available for download from the ObMimic website’s Downloads / Current Release page.
In addition, “Professional Edition” licence-key files and the “Enterprise Edition” can now be purchased via the website’s Buy ObMimic Licences page.
For full details and documentation please see the ObMimic website at www.openbrace.com.
For previous posts that describe ObMimic (including some example code), see:
- ObMimic Public Beta for Out-of-Container Servlet Testing
- Experiments with out-of-container testing of Servlet code using ObMimic (Part 1)
- First use of ObMimic for out-of-container testing of Servlets and Struts (Part 2)