aspose file tools*
The moose likes Testing and the fly likes  ANT - JUNIT problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark " ANT - JUNIT problems" Watch " ANT - JUNIT problems" New topic
Author

ANT - JUNIT problems

Bob Fairchild
Greenhorn

Joined: Dec 03, 2004
Posts: 5
I have installed ant 1.6.2 and junit 3.8.1 I have set the environment vars correctly yet after the system is compiled the first test fails with the following exception.......has anyone seen this??

E:\Projects\KitchensByKip\build.xml:202: Test test.com.kitchensbykip.dao.TestDataBaseUtils failed
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.actOnTestResult(JUnitTask.java:1447)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:685)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1413)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:633)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
What happens if you run the test outside of Ant?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Bob Fairchild
Greenhorn

Joined: Dec 03, 2004
Posts: 5
The same exception gets thrown.
Bob Fairchild
Greenhorn

Joined: Dec 03, 2004
Posts: 5
wait! I misunderstood, its still early here! I have not tried to run the test directly. If I run in from inside intellij it works fine. I will try to run the test from a dos prompt.
Bob Fairchild
Greenhorn

Joined: Dec 03, 2004
Posts: 5
ok. It does not run from a does prompt. I get noclassdef exception....
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31054
    
162

Bob,
Check the classpath. The operating system classpath needs to have junit and ant. The classpath in the ant script needs all the classes the tests require.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bob Fairchild
Greenhorn

Joined: Dec 03, 2004
Posts: 5
It was a mis-typed word in my classpath!! Thanks for all the help!

Bob
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ANT - JUNIT problems