This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi All, I'm trying to run some tests on a cactified WAR file, using Ant to trigger Cactus to do the job. I'm having some problems with NoClassDefFound errors. When I set the <cactus> task's "fork" attribute to "yes", Ant cannot see the "xml-apis.jar", which it should be using to format the XML reports of the test results, despite that jar being in the ant/lib directory alongside ant.jar itself, and also being on the classpath of the <taskdef> for the <cactus> tasks. I have opened up this jar to check that the particular class that is not being found, "org.w3c.dom.Node", is there, and it is. If I set the <cactus> task's "fork" attribute to "no", an XML report is produced, but my tests fail at the first hurdle because classes that were added to the WAR file during "cactification" cannot be found. I have opened up the cactified WAR file to check that those classes are present, and they are. In an ideal world, I would like to have "fork" set to "yes" so that my tests can't interfere with each other. I'm obviously missing some classpath issue here. Can anyone help?
Paul A Green
Joined: Sep 17, 2003
Hi Again, OK, i've cracked it, so I thought i'd better say so before anyone wastes their time thinking about it. Apologies to anyone who already has. It was a bit of a schoolboy error (do people outside the UK use that expression?) by me, i'm ashamed to say. The tests I was trying to run using Cactus had originally been vanilla JUnit tests. In Changing over to Cactus, I had forgotten to have my test classes extend Cactus' "ServletTestCase" instead of JUnit's "TestCase". Still, I guess that's the "experience" they mean when they say "salary according to experience".