You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Andy Kriger <an...@gmail.com> on 2005/01/10 21:55:09 UTC

ant target always starts the container

I'm new to Cactus and didn't see an answer to this problem in the
mailing list archives...

I installed Cactus in Tomcat 5.5 and verified that the samples work
correctly. Now, I am trying to setup my Ant script to run my Cactus
tests. However whenever I run the target, Cactus tries to start Tomcat
5.5 even though it is already running. Of course this fails since
Tomcat's ports are already bound. Why does Cactus think it needs to
start Tomcat (i.e. how does it determine if Tomcat is running)?

On a sidenote, I'm noticing that cactifywar takes a long time to run
(a couple of minutes usually). Is there any way to speed this up?

Here is my Ant target:

<target name="qa-webapp"
    	   depends="webapp-init"
	   description="run unit tests on the web application">
		<cactifywar destfile="${webapp.cactus}" srcfile="${webapp.war}"/>
		<cactus warfile="${webapp.cactus}">
		<classpath>
			<path refid="classpath"/>
		</classpath>
		<containerset>
			<tomcat5x dir="${container.home}" todir="${reports.junit.xml}/"/>
		</containerset>
		<formatter type="xml"/>
		<batchtest>
			<fileset dir="${dir.build}">
				<include name="**/TestSampleServlet.class"/>
			</fileset>
		</batchtest>
	</cactus>
</target>

RE: ant target always starts the container

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Andy,

> -----Original Message-----
> From: Andy Kriger [mailto:andy.kriger@gmail.com]
> Sent: lundi 10 janvier 2005 21:55
> To: cactus-user@jakarta.apache.org
> Subject: ant target always starts the container
> 
> I'm new to Cactus and didn't see an answer to this problem in the
> mailing list archives...
> 
> I installed Cactus in Tomcat 5.5 and verified that the samples work
> correctly. Now, I am trying to setup my Ant script to run my Cactus
> tests. However whenever I run the target, Cactus tries to start Tomcat
> 5.5 even though it is already running. Of course this fails since
> Tomcat's ports are already bound. Why does Cactus think it needs to
> start Tomcat (i.e. how does it determine if Tomcat is running)?

The cactus task pings the cactus redirector located in your WAR. So if you
have Tomcat running but without your cactified war deployed, the cactus task
will think Tomcat is not started.

> 
> On a sidenote, I'm noticing that cactifywar takes a long time to run
> (a couple of minutes usually). Is there any way to speed this up?

Yes, we should copy the existing war and update it instead of copying all
the files from it and generating a new war from scratch...

> 
> Here is my Ant target:
> 
> <target name="qa-webapp"
>     	   depends="webapp-init"
> 	   description="run unit tests on the web application">
> 		<cactifywar destfile="${webapp.cactus}"
> srcfile="${webapp.war}"/>
> 		<cactus warfile="${webapp.cactus}">
> 		<classpath>
> 			<path refid="classpath"/>
> 		</classpath>
> 		<containerset>
> 			<tomcat5x dir="${container.home}"
> todir="${reports.junit.xml}/"/>
> 		</containerset>
> 		<formatter type="xml"/>
> 		<batchtest>
> 			<fileset dir="${dir.build}">
> 				<include name="**/TestSampleServlet.class"/>
> 			</fileset>
> 		</batchtest>
> 	</cactus>
> </target>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org