I have a build process to install my cactified web app into a Tomcat
instance running as an NT service on my local machine. I use the cactify ant
task to do the "cactification", and <get> to communicate with the Tomcat
manager.
The goal is to test code which relies of resources obtained through JNDI,
and I have set up the JNDI resources in the Tomcat admin panel.
I can run the tests using a browser and get a set of sensible results, but
using the <cactus> ant task I always end up with missing driver errors and
various other horrible things in my test output that simply suggest the
cactus task is running its own server and not using the properly configured
Tomcat service.
My last gasp solution is to do this:
<sequential>
<echo >Waiting (max 15s)...</echo>
<waitfor checkevery="3" checkeveryunit="second"
maxwait="15000" >
<http
url="http://localhost:8080/reportingapp/ServletRedirector?Cactus_Service=RUN
_TEST" />
</waitfor>
<get
src="http://localhost:8080/reportingapp/ServletTestRunner?suite=com.virginmo
bile.reportingapp.junit.CoreTests"
dest="${basedir}/CoreTests.xml" />
</sequential>
I'm undecided whether this is any easier/better than running tests in a
browser, but since this works and is quite simple, I am posting it here for
the benefit of the equally desparate. I'm no expert (just a confused cactus
n00b) but I'm guessing it should work on any server. In the meantime, I have
the following list of "nice to haves" which can be taken as a question or
else as feedback into the documentation team.
- I'd like a method of deploying and redeploying the cactified WAR in a few
neat Ant declarations.
- Running the cactus tests in a persistent server instance, in a few neat
Ant declarations.
- A decent solution to setting up JNDI resources from within the build file,
or linked files.
- For the future, a way of letting Ant know whether to continue with a build
depending on the test results (which are now just a file).
These are all things I've spent days researching and querying, to no avail.
This "solution" represents my final frustrating defeat by this vital, but
difficult tool. I have no intention of moving away from my hack in the short
term, but later would like to make my build.xml into something more
recognisable - if only for the benefit of my successors.
Simon Gibbs
--
IMPORTANT
The contents of this email (and any attachment):
(1) are confidential and may be legally privileged - if it is not meant for
you, please tell the sender, do not forward or copy the contents
and delete it from your system immediately;
(2) come from its author and may not necessarily reflect the opinions
of Virgin Mobile.
While emails and attachments are virus checked,
we cannot accept any liability in respect of any viruses.
We may monitor emails sent to Virgin Mobile.
Want to know more about Virgin Mobile?
Visit our website for the latest info, phones and special offers
http://www.virgin.com/mobile
Virgin Mobile Telecoms Ltd
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]