> -----Original Message-----
> From: Davor Cengija [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 25, 2002 12:34 AM
> To: Struts Developers List
> Subject: Unit testing taglibs?
> 
> How to unit-test taglibs, possibly without servlet container?
> 
> I'm writing wml-related taglib for struts and my code is craving for
> some unit-tests. I found tagunit but it requires servlet 
> container, it's
> executed in a jsp page etc. I'd like to have automated unit testing on
> each build.
> 
> How does Cactus fit in? I recently discovered it but haven't 
> downloaded
> it yet.

If you look in the current unit tests for Struts, you'll find very minimal
usage of Cactus.  You might get a feeling for how this can work for you.
Note that this doesn't really test your TLD file, or how the page might
interact with the JSP compiler, but it does test the actual tag code and
what it does.

When I actually finish committing the Struts-EL code (hopefully in the next
couple of days), you can inspect the unit tests in there, which are based on
what is in Struts, but which are much more extensive (although I still have
more to write).  These use Cactus, but they also use HttpUnit, Xalan, and
JTidy (and AspectJ, under the covers, by JTidy).  Some of these tag tests
were a little nasty to write, especially for the tags that need the Struts
configuration set up, and which use somewhat complex algorithms to generate
their output.

You'll have to inspect the Struts build process to see how Cactus is really
set up.  Since I just copied that stuff, I didn't have to figure it out :) .

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to