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 Quinten Verheyen <q....@ringring.be> on 2004/01/13 17:45:27 UTC

cactus ant task on existing container ?

Hi,
 
I'm confused about using the cactus ant task with an existing container configuration.
 
A tomcat container is running on my machine with a different webapps dir instead of the standard webapps dir in the tomcat root.
 
When running test cases I started first with building a cactified war that would then be deployed on the webapps dir of that container. Then my test cases were run via the browser method, everything worked fine.
 
When I want to automate the process via the ant task, I am puzzled ..

The way I understand it, using the <cactus> task installs a new Tomcat container with possibly minimum config to a temp dir.
 
But, .. I need to run the tests on the existing tomcat container, not on a new one ! It is running several other libraries that have nothing to do with my test cases, but they are used by the classes that are tested. Objects that are in memory, etc.
 
So, is there a way to automatically run cactus unit tests on an existing container (like I did with the non-automatic browser method) ?
 
Thx in advance..

Re: cactus ant task on existing container ?

Posted by Matt Raible <li...@raibledesigns.com>.
OK, you've motivated me to try using the <cactus> task - I've defined 
the task below, but I'm getting the following error:

    [cactus] Couldn't find tools.jar (needed for JSP compilation)
You must either set location or path on <pathelement>

I'm on the latest JDK (1.4.1) for OS X.  I searched my hard drive, and 
there is no tools.jar.

Thanks,

Matt

     <target name="cactus" depends="deploy-test-war"
         description="Runs Cactus tests in Tomcat and Resin">
         <cactus warfile="${webapp.dist}/${webapp.name}-cactus.war"
             printsummary="yes" failureproperty="tests.failed">
             <classpath>
                 <path refid="web.tests.classpath"/>
                 <pathelement path="${webapp.target}/WEB-INF/classes"/>
                 <pathelement location="${build.dir}/${module}/classes"/>
                 <pathelement location="${test.dir}/${module}/classes"/>
                 <pathelement path="${java.class.path}"/>
             </classpath>
             <containerset>
                 <tomcat4x dir="${tomcat.home}" port="8080"
                     todir="${test.dir}/data/tomcat4"/>
             </containerset>
             <formatter type="xml"/>
             <formatter type="brief" usefile="false"/>
             <batchtest todir="${test.dir}/data" if="testcase">
                 <fileset dir="${test.dir}/${module}/classes">
                     <include name="**/*${testcase}*"/>
                     <exclude name="**/*TestCase.class"/>
                 </fileset>
             </batchtest>
             <batchtest todir="${test.dir}/data" unless="testcase">
                 <fileset dir="${test.dir}/${module}/classes"
                     includes="**/*Test.class"
                     />
             </batchtest>
         </cactus>
     </target>

On Jan 13, 2004, at 9:55 AM, Vincent Massol wrote:

> Hi Quinten,
>
> The <cactus> task automates the creation of a new container (as you
> rightly said). Some nested <container> elements support passing custom
> config file (the <jboss3x> one even supports passing a custom container
> config).
>
> The <tomcat?x> containers only support passing a custom server.xml file
> (through the use of the serverxml attribute). However it does not
> support specifying a full existing tomcat configuration). Actually we
> have not had the need yet... Passing server.xml has been enough for all
> cactus users need so far.
>
> You mention other libraries. You mean jars right? These will be reused
> just fine. I don't see the problem. Are you modifying something else?
>
> OTOH if you wish to use your complete own tomcat config, you'll need to
> use the <generic> container (see
> http://jakarta.apache.org/cactus/integration/ant/task_cactus.html).
>
> Thanks
> -Vincent
>
>> -----Original Message-----
>> From: Quinten Verheyen [mailto:q.verheyen@ringring.be]
>> Sent: 13 January 2004 17:45
>> To: cactus-user@jakarta.apache.org
>> Subject: cactus ant task on existing container ?
>>
>> Hi,
>>
>> I'm confused about using the cactus ant task with an existing
> container
>> configuration.
>>
>> A tomcat container is running on my machine with a different webapps
> dir
>> instead of the standard webapps dir in the tomcat root.
>>
>> When running test cases I started first with building a cactified war
> that
>> would then be deployed on the webapps dir of that container. Then my
> test
>> cases were run via the browser method, everything worked fine.
>>
>> When I want to automate the process via the ant task, I am puzzled ..
>>
>> The way I understand it, using the <cactus> task installs a new Tomcat
>> container with possibly minimum config to a temp dir.
>>
>> But, .. I need to run the tests on the existing tomcat container, not
> on a
>> new one ! It is running several other libraries that have nothing to
> do
>> with my test cases, but they are used by the classes that are tested.
>> Objects that are in memory, etc.
>>
>> So, is there a way to automatically run cactus unit tests on an
> existing
>> container (like I did with the non-automatic browser method) ?
>>
>> Thx in advance..
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org


RE: cactus ant task on existing container ?

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

The <cactus> task automates the creation of a new container (as you
rightly said). Some nested <container> elements support passing custom
config file (the <jboss3x> one even supports passing a custom container
config). 

The <tomcat?x> containers only support passing a custom server.xml file
(through the use of the serverxml attribute). However it does not
support specifying a full existing tomcat configuration). Actually we
have not had the need yet... Passing server.xml has been enough for all
cactus users need so far.

You mention other libraries. You mean jars right? These will be reused
just fine. I don't see the problem. Are you modifying something else?

OTOH if you wish to use your complete own tomcat config, you'll need to
use the <generic> container (see
http://jakarta.apache.org/cactus/integration/ant/task_cactus.html).

Thanks
-Vincent

> -----Original Message-----
> From: Quinten Verheyen [mailto:q.verheyen@ringring.be]
> Sent: 13 January 2004 17:45
> To: cactus-user@jakarta.apache.org
> Subject: cactus ant task on existing container ?
> 
> Hi,
> 
> I'm confused about using the cactus ant task with an existing
container
> configuration.
> 
> A tomcat container is running on my machine with a different webapps
dir
> instead of the standard webapps dir in the tomcat root.
> 
> When running test cases I started first with building a cactified war
that
> would then be deployed on the webapps dir of that container. Then my
test
> cases were run via the browser method, everything worked fine.
> 
> When I want to automate the process via the ant task, I am puzzled ..
> 
> The way I understand it, using the <cactus> task installs a new Tomcat
> container with possibly minimum config to a temp dir.
> 
> But, .. I need to run the tests on the existing tomcat container, not
on a
> new one ! It is running several other libraries that have nothing to
do
> with my test cases, but they are used by the classes that are tested.
> Objects that are in memory, etc.
> 
> So, is there a way to automatically run cactus unit tests on an
existing
> container (like I did with the non-automatic browser method) ?
> 
> Thx in advance..