Tuesday October 07, 2003
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 in Java
at Oct 07 2003, 10:28:26 AM MDT
7 Comments
Search This Site
Recent Entries
- Wine Tasting in Napa Valley
- How to build a Shot-Ski
- Bus Project Update
- Farewell to the 2011-2012 Ski Season
- Cruising around the Western Caribbean
- Spring Break!
- A Spectacular Trip to Stockholm and Madrid
- Comparing Web Frameworks and HTML5 with Play Scala at Jfokus 2012
- Play Framework 2.0 with Peter Hilton at Jfokus
- Secure JSON Services with Play Scala and SecureSocial
Posted by Jason Arndt on October 07, 2003 at 12: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 01:09 PM MDT #
Posted by Rick Lawson on October 07, 2003 at 02:09 PM MDT #
Posted by Simon Brown on October 07, 2003 at 02: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 07, 2003 at 06:51 PM MDT #
Posted by Ryan Breidenbach on October 09, 2003 at 08:49 AM MDT #
Posted by Andy Marks on August 31, 2004 at 09:29 PM MDT #