What's the best way to test Tag Libraries?
I know of two tag libraries that are in dire need of unit tests - the displaytag and struts-menu. Both have no tests. I've looked briefly at TagUnit, but aren't you just writing JSPs (with custom tags) to test JSPs? I'd rather have an Ant/JUnit driven solution. Also, are there HTML versions of the user guides for TagUnit (Simon ;-)? I hate PDFs.
So my question is - how do you test your tag libraries?
Posted by Jason Arndt on October 07, 2003 at 06:06 PM MDT #
The question is how to test JSP custom tags, and one answer is TagUnit.
Posted by Simon Brown's weblog on October 07, 2003 at 07:09 PM MDT #
Posted by Rick Lawson on October 07, 2003 at 08:09 PM MDT #
Posted by Simon Brown on October 07, 2003 at 08:37 PM MDT #
For tag libraries you'd probably start by creating a mock object of PageContext. It may be necessary to refactor the actual tag code a little, since the tag may use functionality from superclasses, but that is never a bad thing. Unit tested code always looks different from non tested code, and in most cases it is better.
Posted by Rhys Keepence on October 08, 2003 at 12:51 AM MDT #
Posted by Ryan Breidenbach on October 09, 2003 at 02:49 PM MDT #
Posted by Andy Marks on September 01, 2004 at 03:29 AM MDT #