ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dushyant Shrivastava" <>
Subject RE: Running Junit tests inside the same VM
Date Thu, 26 Sep 2002 09:11:45 GMT
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}"/>

   <!-- =================================================================== -->
   <!-- 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">

   <!-- =================================================================== -->
   <!-- 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="/>
                <jvmarg value = ""/>

          <test  name="com.yambay.nps.istesting.MessagingTestCase"
                    todir="${reports}" />

                   <pathelement location="/MACH/jacob.jar"/>
                  <fileset dir="${ant.home}/lib">


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,

-----Original Message-----
From: Ulrich Winter []
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
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.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message