wood burning stoves
The moose likes Ant, Maven and Other Build Tools and the fly likes ANT JUnit Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ANT JUnit Problem" Watch "ANT JUnit Problem" New topic

ANT JUnit Problem

Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Hi All
When I run me Test case in Ant it gives me following error. This test case works fine when I run it in Eclipse as JUnit test. Below are the error and the ant task code
[junit] Testsuite: test.com.i2c.webpos.transaction.TransHandlerFactoryTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Null Test: Caused an ERROR
[junit] test.com.i2c.webpos.transaction.TransHandlerFactoryTest
[junit] java.lang.ClassNotFoundException: test.com.i2c.webpos.transaction.TransHandlerFactoryTest
[junit] at java.net.URLClassLoader$1.run(Unknown Source)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(Unknown Source)
[junit] at java.lang.ClassLoader.loadClass(Unknown Source)
[junit] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[junit] at java.lang.ClassLoader.loadClass(Unknown Source)
[junit] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Unknown Source)
[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 test.com.i2c.webpos.transaction.TransHandlerFactoryTest FAILED

Ant Task is

Any one please help me

"Know where to find the solution and how to use it - that's the secret of success."
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
You haven't specified a classpath for the <junit/> task. See the documentation for examples.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link: http://aspose.com/file-tools
subject: ANT JUnit Problem
It's not a secret anymore!