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:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]>
For additional commands, e-mail: < mailto:[EMAIL PROTECTED]>



Reply via email to