hi,

I have been looking through the docs to run my junit tests in the same jvm where server is started, but i could not achieve it through parallel task,

shown below is the sample code:

<target name="startserver" description="Starting Server">
     <parallel>
             <exec dir="/producthome/bin" executable="/bin/sh" os="Linux">
* <!-- I expect all the unit tests to happen in this jvm where start server starts a main java class -->*
                   <arg line="startserver.sh"/>
             </exec>
             <sequential>
                 <sleep seconds="30"/>
                       <mkdir dir="${target.report.dir}/html"/>
* <!-- But I thik this task starts a separate jvm and hence my results fails -->* <junit printsummary="withOutAndErr" showoutput="true" forkmode="once">
                               <classpath path="${clp}"/>
                               <batchtest todir="${target.report.dir}">
                                       <fileset dir="${classes.dir}">
<include name="**/Test*.class"/>
                                        </fileset>
                            </batchtest>
                             <formatter type="xml" />
                       </junit>
     <echo message="Junit complete and starting junit report......... "/>
   <junitreport todir="${target.report.dir}">
     <fileset dir="${target.report.dir}">
       <include name="TEST-*.xml"/>
     </fileset>
    <report todir="${target.report.dir}/html"/>
</junitreport>
     <echo message="Junit report complete and stopping server......... "/>
     <exec dir="producthome/bin" executable="/bin/sh" os="Linux">
         <arg line="stopserver.sh"/>
     </exec>
   </sequential>
   </parallel>
</target>

How do i achieve this ? Is there any other way to do this ?

Lokesh

Reply via email to