I add a build script to the ant to run the JUnit unit tests. Created a target:
<!-- Run the JUnit Tests --> <target name="junit" depends="compile"> <junit printsummary="on" haltonfailure="no"> <classpath> <fileset dir="${junit.dir}" includes="junit-4.10.jar"/> </classpath> <formatter type="plain" /> <batchtest todir="${test.report.dir}"> <fileset dir="${unittest.dir}"> <include name="**/*.java" /> </fileset> </batchtest> </junit> </target>
but I get an error for all tests with this text:
Testsuite: Application.Enums.Timeline.TrackLabelsTest Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec Caused an ERROR Application.Enums.Timeline.TrackLabelsTest java.lang.ClassNotFoundException: Application.Enums.Timeline.TrackLabelsTest at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424) at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
Apparently, he can not find the test itself, right? I can not figure out whether to compile in the compilation target and a folder with tests, ie $ {unittest.dir}? How does it work specifically - compiles all java-files in the $ {unittest.dir} folder by * / .java for this type (that is, all), and runs the JUnit test?
Debut log Anta also did not give anything interesting.