This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi, I have a bunch of j-unit tests I have written, half of which have to be run from my TomCat server (integration style tests). In my build script I am deploying my WAR to the TomCat server.
My question is, is it possible to get Ant to run these j-unit tests on the running TomCat server using the <junit> task? I don't want to go down the route of Cactus or something, as the tests that require TomCat running are designed to be full integration tests where the environment is setup as a production environment.
No, you can't do that with the <junit> task unless you write your own TestRunner implementation that contacts your application running on Tomcat and sends it a list of class names to execute as JUnit tests.
Originally posted by Lasse Koskela: No, you can't do that with the <junit> task unless you write your own TestRunner implementation that contacts your application running on Tomcat and sends it a list of class names to execute as JUnit tests.
Effectively, you'd be reinventing Cactus...
Ok, I know how to get my build script to kick my unittesting off on the TomCat server - all I need to know is - can I somehow log the results of the unit tests and then get my build script to generate a report based on those? And also fail or email a failure message based on the results?
Joined: Jan 23, 2002
Again, Cactus would do this (collect test results) for you. I know that Cactus is a bit of a pain to set up but once you've done that, it should be a relatively smooth ride (compared to writing your own).