I have a class with many junit test methods in it using @Test annotation. all the tests rely on each other so I want to run each one in seperate vm.
When I'm using intelij to run all the tests in the class and select fork mode "method" then all test passes.
however using ant junit task the formode="perTest" does not work. i.e it does not fork a new VM for each @Test method.
ANT junit task documentation states that the fork mode exists for each TestCase class. I guess this is the "old" junit mode. right now I don't have TestCase classes but methods annotated with @Test.
Does anyone know how to for VM for each @Test method using ant junit task ?
a snapshot of my build.xml, the test target looks like this :
<target name="test" depends="compile">
<junit fork="yes" forkmode="perTest">
<batchtest haltonerror="true" haltonfailure="true">
<fileset dir="${test.dir}">
<include name="**/*Test*"></include>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
Aucun commentaire:
Enregistrer un commentaire