Well, have gone again over the link and emails, added some jars to the
build.xml.

Now I can run the tests but I'm still thinking it's not in tomcat's VM but
on my VM (the one ant forks via the junit).

In addition, some other details:
1. Not all the jars used by my application are under the project's context,
some under tomcat's lib (so I added them to the build.xml file).
2. Tomcat is running as NT Service.

If you can give me a hint it will be great, cause I don't see were is my
mistake.

Thanks again,
Erez. 

> -----Original Message-----
> From: Vincent Massol [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 15, 2004 3:13 PM
> To: 'Cactus Users List'
> Subject: RE: Using cactus with junit tests and ant on 
> existing and running container.
> 
> 
> 
> > -----Original Message-----
> > From: Erez Nahir [mailto:[EMAIL PROTECTED]
> > Sent: 15 January 2004 14:01
> > To: 'Vincent Massol'; 'Cactus Users List'
> > Subject: RE: Using cactus with junit tests and ant on existing and
> running
> > container.
> > 
> > Hi Vincent,
> > 
> > Yes I did go over all documents and mails, but when I'm running my
> tests I
> > get some NoClassDefFoundError exceptions which shouldn't occur. This
> leads
> > me to the thought that the tests are not actually running 
> in Tomcat's
> VM
> > but
> > in the VM of ant.
> > 
> > Here is some parts of my build.xml (its still pretty messy 
> cause it's
> a
> > work
> > in progress :-(.
> > 
> > <taskdef resource="cactus.tasks" classpathref="cactus.classpath"/>
> > 
> > <target name="test" description="Run JUnit test cases of Athena 
> > componenst">
> >     <runservertests
> > 
> > testurl="http://enahir-
> > w2k:1751/athena/CactusServletTestRunner?suite=com.cis
> > co.nm.vms.common.AthenaTest"
> >     starttarget="start.tomcat"
> >     stoptarget="stop.tomcat"
> >     testtarget="testme"/>
> > 
> > </target>
> > 
> > <target name="start.tomcat">
> > 
> > </target>
> > 
> > <target name="stop.tomcat">
> > 
> > </target>
> > 
> > <target name="testme">
> >     <mkdir dir="${test.output}"/>
> >     <junit printsummary="${junit.summary}"
> >                     haltonfailure="${junit.halt.onfailure}"
> >                     haltonerror="${junit.halt.onerror}"
> >                     filtertrace="${junit.filtertrace}"
> >                     fork="${junit.fork}">
> > 
> > 
> >                             <classpath >
> >     <path refid="project.classpath"/>
> > 
> >     <pathelement location="${aspectjrt.jar}"/>
> >     <pathelement location="${cactus.jar}"/>
> >     <pathelement location="${cactus.ant.jar}"/>
> >     <pathelement location="${commons.httpclient.jar}"/>
> >     <pathelement location="${commons.logging.jar}"/>
> >     <pathelement location="${junit.jar}"/>
> >                     </classpath>
> >                     <formatter type="xml"/>
> > 
> >             <batchtest fork="${junit.fork}" todir="${test.output}">
> >                     <fileset
> dir="${athena.root.dir}/WEB-INF/classes">
> >                             <include name="**/*Test*"/>
> >                             <!-- helper classes, not testcases -->
> >                             <exclude name="**/*Util*"/>
> >                             <exclude name="**/*Factory*"/>
> >                             <exclude name="**/*Base*"/>
> >                     </fileset>
> >             </batchtest>
> >             </junit>
> > </target>
> > 
> > I guess I'm missing something.
> 
> Yes, you are! Please read my email and the link I gave you :-)
> 
> Thanks
> -Vincent
> 
> > 
> > Thanks,
> > Erez.
> > 
> > > -----Original Message-----
> > > From: Vincent Massol [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, January 15, 2004 2:50 PM
> > > To: 'Cactus Users List'
> > > Cc: [EMAIL PROTECTED]
> > > Subject: RE: Using cactus with junit tests and ant on 
> existing and 
> > > running container.
> > >
> > > Hi Erez,
> > >
> > > > -----Original Message-----
> > > > From: Erez Nahir [mailto:[EMAIL PROTECTED]
> > > > Sent: 15 January 2004 13:36
> > > > To: [EMAIL PROTECTED]
> > > > Cc: 'Erez Nahir'
> > > > Subject: Using cactus with junit tests and ant on existing
> > > and running
> > > > container.
> > > >
> > > > Hi,
> > > >
> > > > On our project we have a running tomcat3.x that is used by
> > > our project
> > > as
> > > > well as others.
> > > > My requirement it to be able to run junit test cases (which
> > > I run now
> > > with
> > > > ant and junit) inside tomcat's VM.
> > > >
> > > > Can someone please share info how should I create the 
> ant file to
> do
> > > such
> > > > thing (I got the impression I can do it with Cactus).
> > >
> > > Good impression! Have you had a look at the web site?
> > >
> > > http://jakarta.apache.org/cactus/integration/ant/index.html
> > >
> > >
> > > > In my web.xml file I added:
> > > > <servlet>
> > > > <servlet-name>CactusServletTestRunner</servlet-name>
> > > >
> > > <servlet-class>org.apache.cactus.server.runner.ServletTestRunn
> > > er</servle
> > > t-
> > > > cl
> > > > ass>
> > > > </servlet>
> > > > <servlet-mapping>
> > > > <servlet-name>CactusServletTestRunner</servlet-name>
> > > > <url-pattern>/CactusServletTestRunner</url-pattern>
> > > > </servlet-mapping>
> > >
> > > Forget this. It's not needed if you use the <cactus> task. In 
> > > addition, it's not correct :-)
> > >
> > > >
> > > > I also tried with runservertests calling junit task in the
> > > test target
> > > and
> > > > with cactus task too. The problem is I don't have
> > > project.war file, I
> > > > already got all the project directories and files extracted into
> > > tomcat's
> > > > directory (which is not the default).
> > > >
> > > > Thanks,
> > > > Erez.
> > >
> > > -Vincent
> > >
> > > PS: Please do subscribe to the mailing list. I've moderated your 
> > > message this time.
> > >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to