ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Running Junit tests inside the same VM
Date Thu, 26 Sep 2002 11:36:48 GMT
Hi Dushyant,

I highly recommend using Cactus ;-) (I am one of its author). I started
like you, doing my own framework and very quickly I had to add lots of
stuff to make it work. You have 2 options I believe:
- try to write your own. End to end you'll probably spend 2 weeks/man in
total for that.
- use Cactus. You may spend 1 to 2 days to learn it and integrate it in
your build process.

That said, I haven't read your initial email so I don't know whether you
want to write unit tests or functional tests and what type of component
you need to test.

Feel free to continue this discussion on the cactus mailing list as the
Ant one may not be the most appropriate to discuss Cactus stuff.

Thanks and good luck.
-Vincent

> -----Original Message-----
> From: Dushyant Shrivastava [mailto:dushys@yambay.com]
> Sent: 26 September 2002 10:12
> To: Ant Users List
> Subject: RE: Running Junit tests inside the same VM
> 
> Hi Uli,
> Thanks for the prompt reply mate! Now I did have a vague idea of what
I
> need to do to get the tests running in the same JVM. However my
> understanding was that Ant already does that for you! More
specifically, I
> am referring to the second option u mentioned!
> 
> Ok here is a snippet from my Ant file:
> 
>    <!--
> ===================================================================
-->
>    <!-- Creates the jar archives
> -->
>    <!--
> ===================================================================
-->
> 
>    <target name="jar" depends="compile">
>       <mkdir dir="${build.deploy.dir}"/>
>       <mkdir dir="${build.bin.dir}"/>
>       <jar
> 
>       </jar>
>    </target>
> 
>    <!--
> ===================================================================
-->
>    <!-- Creates the client binary  , deploys it in JBoss
> -->
>    <!--
> ===================================================================
-->
> 
>    <target name="deploy-server" depends="jar">
>       <copy todir="${jboss.deploy}">
>          <fileset dir="${build.deploy.dir}" includes="*.jar">
>          </fileset>
>       </copy>
>    </target>
> 
> 
>    <!--
> ===================================================================
-->
>    <!-- Runs the test
> -->
>    <!--
> ===================================================================
-->
> 
> 
> <target name="test" depends="jar, deploy-server">
>    <mkdir dir="${reports}"/>
>    <junit printsummary="true" >
>           <formatter type="xml" />
>                 <jvmarg value = "-
> Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory"
/>
>                 <jvmarg value = "-
> Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces"/>
>                 <jvmarg value =
"-Djava.naming.provider.url=10.61.6.142"/>
>                 <jvmarg value = "-Djava.security.policy=C:/J2EE/jboss-
> 3.0.0/server/default/conf/server.policy"/>
> 
>           <test  name="com.yambay.nps.istesting.MessagingTestCase"
>                     todir="${reports}" />
> 
>           <classpath>
>                    <pathelement location="/MACH/jacob.jar"/>
>                   <fileset dir="${ant.home}/lib">
> 
>           </classpath>
> 
>   </target>
> 
> 
> 
> Now, according to this xml, dosen;t it first deploy the test.jar into
> jboss and then remotely trigger execution of the test, like you
mentioned
> in your second point. If I am wrong, could you please tell me, what
else
> do i need to do in my JUnit task to do so!
> Option 1 is not a very feasible option for me, so I would like to get
> option 2 working. Now if I do run this build.xml i get the following
> error,
> "Need to specify class name in environment or system property, or as
an
> applet parameter : java.naming.factory.initial expected
> 
> Finally,  our project team dosen't want to go through a hassle of
using
> yet another tool like Cactus, do you think that we can achieve the
same
> through simple JUnit clases inside JBoss or Cactus is the way to go?
> 
> Thank you so much once again,
> Dushy
> 
> 
> 
> -----Original Message-----
> From: Ulrich Winter [ mailto:ulrich.winter@gmx.de]
> Sent: Thursday, September 26, 2002 4:02 PM
> To: Ant Users List
> Subject: Re: Running Junit tests inside the same VM
> 
> 
> The fork="off" option in your build file doesn't touch the jboss
server
> process at all.
> 
> If you want to execute the tests in the server process, you have two
> options:
> 1) start the jboss server environment from within your tests
> 2) deploy the tests inside the server and let the buildfile remotely
>    trigger execution of that tests. This approach is used by the
>    jakarta cactus testing frmework.
> 
> Bye,
> Uli
> 
> 
> 
> --
> To unsubscribe, e-mail:   < mailto:ant-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: < mailto:ant-user-
> help@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message