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
- Jack's Mohawk
- LinkedIn Cuts 10% (a.k.a. The Journey is Over)
- Happy Birthday Abbie!
- Moving from Spring's XML to Annotations in AppFuse
- Free Maven Training in New Orleans on Election Day
- AppFuse Light ยป AppFuse, Maven Archetypes and Shared Web Assets
- Great Weekend in Montana
- Colorado Software Summit 2008 Wrapup
- RESTful Web Applications with Subbu Allamaraju
- Core Animation with Bill Dudney
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 #