Dear All:
While utilizing Junit task to run TestCase in ANT , occur following error , The Test Cases work fine While running in Eclipse as Junit Test .
Below are error trace and Ant task code:
error trace:
quote:
ANT target code:
quote:
Thank you for anyone give me help or where to find the solution
While utilizing Junit task to run TestCase in ANT , occur following error , The Test Cases work fine While running in Eclipse as Junit Test .
Below are error trace and Ant task code:
error trace:
quote:
java 代码
- jtest:
- [junit] Running com.reyes.business.DefaultBookingServiceTest
- [junit] Testsuite: com.reyes.business.DefaultBookingServiceTest
- [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
- [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
- [junit] Null Test: Caused an ERROR
- [junit] com.reyes.business.DefaultBookingServiceTest
- [junit] java.lang.ClassNotFoundException: com.reyes.business.DefaultBookingServiceTest
- [junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
- [junit] at java.security.AccessController.doPrivileged(Native Method)
- [junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
- [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
- [junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
- [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
- [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
- [junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
- [junit] at java.lang.Class.forName0(Native Method)
- [junit] at java.lang.Class.forName(Class.java:247)
- [junit] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
- [junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
- [junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
- [junit] Test com.reyes.business.DefaultBookingServiceTest FAILED
ANT target code:
quote:
xml 代码
- -- =================================
- target: jtest
- ================================= -->
- <target name="jtest" depends="compile" description="--> description">
- <junit printsummary="on" fork="false" haltonfailure="false" failureproperty="tests.failed" showoutput="true">
- <classpath refid="master-classpath" />
- <formatter type="brief" usefile="false" />
- <batchtest>
- <fileset dir="${build.dir}">
- <include name="**/*Test.*" />
- fileset>
- batchtest>
- junit>
- target>
Thank you for anyone give me help or where to find the solution