Sounds really interesting. I've been thinking of different ways to setup Maven's integration unit testing target to handle not only cactus tests but other integration unit tests that may not require a servlet container. This is a very nice solution to removing the cactus specific stuff from the project. Maybe a easy way to allow this would be a small installation jar and target that a cactus user could use to 'cactus-ify' their installation of tomcat.
On an aside, it would be interesting if we could find a way to use the ant build scripts to test our projects directly from cactus without having to integrate them into our projects build scripts ( or maybe this is now possible? ). ================================================================= Jeffrey D. Brekke Quad/Graphics [EMAIL PROTECTED] http://www.qg.com > -----Original Message----- > From: Vincent Massol [mailto:[EMAIL PROTECTED]] > Sent: Saturday, May 11, 2002 5:27 PM > To: 'Cactus Users List' > Subject: Neat Tomcat Integration + proposal for > CactusServletTestRunner > > > Hi Cactusers ! > > If you're working with Tomcat 4.x, here is the best way that I have > found to integrate Cactus. It is non-intrusive at all for > your webapp ! > > <tomcat install dir> > |_ conf > |_ web.xml (add Cactus redirector and mapping as usual) > |_ common > |_ lib > |_ cactus.jar > |_ aspectjrt.jar > |_ junit.jar > |_ webapps > |_ mywebapp > |_ WEB-INF > |_ web.xml (nothing related to Cactus) > |_ lib > |_ (no cactus jar) > |_ classes > |_ classes under test > |_ cactus test classes > > What this mean is that : > > 1/ Your WAR contain minimal Cactus intrusion (only the test classes) > 2/ You can "reuse" the Cactus jars and the Cactus redirector > mapping for > all webapps > > What would be real nice now would be that Tomcat bundles the 3 Cactus > jars and the mapping for redirectors in conf/web.xml, and declare that > the "recommended" way to unit test servlets,jsps,taglibs,filters is > Cactus, linking to some Cactus Tomcat Howto tutorial on the Cactus web > page. > > As a Tomcat user, if you wish to write a unit test for your > servlet, you > would only have to include your test class in your webapp and > off you go > ! > > I have just realized that it may be nice to include a > CactusServletTestRunner (which would be a servlet) as part of > the cactus > jar (in the same way it is done in JunitEE - Hey Kaarle, I now > understand you ! :-)) so that if you wanted to quickly exercise your > test you could call that servlet as in : > > http://server:port/mywebapp/CactusServletTestRunner?suite=name _of_test_c lass That would execute the Cactus tests (including beginXXX and endXXX in the Server JVM) and display the result as HTML or XML (Note: I actually prefer XML and drop an XSL stylesheet to automatically transform it in HTML if need be). Cactus would thus provide 2 solutions to kick start its tests : - the normal way, i.e. through any existing JUnit Test Runner and thus through any existing JUnit tool, including IDE JUnit integration plugins - through the CactusServletTestRunner Once this is done, I think we have a winner (can't be easier for someone wanting to write servlet API unit tests !) and can start lobbying the Tomcat team to bundle Cactus in their distribution. What do you think ? Thanks -Vincent -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
