Summary: | junitlauncher does not identify and execute unit test which uses mocking framework Mockito | ||
---|---|---|---|
Product: | Ant | Reporter: | mgandhi |
Component: | Optional Tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.10.5 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
mgandhi
2020-07-13 06:05:46 UTC
Would you be able to attach a simple build.xml file which will help us reproduce this issue easily? Here is the build step which invokes the JUnit <!-- Run Unit Tests and Generate Report --> <target name="test.junit.launcher" depends="compile.module.goda1.production"> <echo message="Launcher Started" /> <mkdir dir="${test.report.dir}" /> <junitlauncher haltOnFailure="true" printSummary="true" > <classpath> <!-- the test classes themselves --> <pathelement location="${goda1.testoutput.dir}"/> <pathelement location="${goda1.output.dir}"/> </classpath> <testclasses outputdir="${test.report.dir}"> <fileset dir="${goda1.testoutput.dir}"> <include name="**/*Test.class"/> </fileset> <listener type="legacy-xml" sendSysOut="true" sendSysErr="true"/> <listener type="legacy-plain" sendSysOut="true" /> </testclasses> </junitlauncher> </target> The ${goda1.testoutput.dir} represents compiled output of the test classes and the ${goda1.output.dir} represents the compiled output of the project source code. Thank you for that build snippet. I just gave this a quick try locally and was able to see that the test runs fine. I noticed in your output that you are using Ant 1.10.5 release. Could you try this against the latest released 1.10.8 (the version I tried against) and see if it works there? Yes, I am using ANT 1.10.5 and also mentioned that at the time of raising defect. Going through your response, does that mean ANT 1.10.5 doesn't recognize unit test written using mocking framework MOckito 3.3? Is it a Bug? Also, I gave a try using ANT 1.10.8 having the same structure and got below error: failed to launch in-vm tests. Can anyone please look into this? Appreciate earliest resolution. Thanks. I've tried to reproduce this against latest released Ant versions but haven't been able to reproduce this. If you are still running into this problem, please let us know if there is any way you can share a latest reproducer for this that fails against our latest released Ant version (1.10.11) |