TagUnit : an open source framework for testing JSP custom tags
sharp shooter, and author
Joined: May 10, 2000
As you may have seen, I started a topic a few weeks back about how people test custom tags. Since then, a few of us have been throwing some ideas around, done some prototyping, the result of which is the TagUnit project. Here's some brief information about the project - apologies for posting this into the JSP forum if it's not really appropriate.
TagUnit is an open source framework whereby JSP custom tags can be tested inside the container, and in isolation to the application specific pages on which they will ultimately be used. In essence, it's a tag library for testing tags within JSP pages. This means that it is easy to unit test tags, including the content that they generate and the side-effects that they have on the environment such as the introduction of scripting variables, page context attributes, cookies and so on. In addition to "unit testing" tags, it is also useful to be able to test the cooperation between tags in a tag library, to ensure that the correct results are produced when tags are used in conjunction with one another. This is more like integration or component testing than unit testing, but is still important and possible within the same framework. Finally, assertions can be made on the constraints specified within the tag library descriptor file, allowing tests to be made on the contract that a tag provides.
For further information, documentation and downloads, please see the project website - http://www.tagunit.org. Although still in the prototyping phase, binary and source code distributions are available to download. Feel free to have a play and sign up on the mailing lists if you're interested in learning more or have some feedback. Cheers Simon p.s. hope you're not reading this in Blatant Advertising!