| Author |
Why doesn't the JUnit test OUTPUT appear using the Ant build?
|
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
Why doesn't the JUnit test OUTPUT appear using the Ant build
<target name="JUnit test">
<junit printsummary="true" showoutput="yes">
<classpath refid="test.classpath"/>
<formatter type="plain"/>
</junit>
</target>
Thanks.
|
 |
Seamus Minogue
Ranch Hand
Joined: Jun 24, 2008
Posts: 41
|
|
Think you might be missing this...
From my build file
|
 |
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
Seamus Minogue wrote:
Think you might be missing this...
From my build file
Thank you very much.
|
 |
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
Why do I get this error when I run the Ant build file?
Testsuite: JUnit
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
Caused an ERROR
JUnit
java.lang.ClassNotFoundException: JUnit
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
|
 |
Seamus Minogue
Ranch Hand
Joined: Jun 24, 2008
Posts: 41
|
|
looks like you need to tweak that classpath entry I gave you so that junit.jar is on it.
^^ Idiocy please ignore
Actually im sorry I am seeing things. Your test case is called JUnit!
Ok well THAT isnt on the classpath...
|
 |
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
Seamus Minogue wrote:looks like you need to tweak that classpath entry I gave you so that junit.jar is on it.
Since I'm using "Eclipse", I added JUnit to Ant, so it is working properly.
But, as for the test that you gave me, what should I change in it?
Thanks.
|
 |
Seamus Minogue
Ranch Hand
Joined: Jun 24, 2008
Posts: 41
|
|
|
Create a property called build.tests which has a value that is the same as where your javac command compiled your test classes to and it should work
|
 |
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
Seamus Minogue wrote:Create a property called build.tests which has a value that is the same as where your javac command compiled your test classes to and it should work
This is what I get when I run it:
Testsuite: PojoTests
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
Caused an ERROR
PojoTests
java.lang.ClassNotFoundException: PojoTests
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Provided that I thin you should have a "/" at the end of the following line:
<pathelement path="${classpath}" >
|
 |
Seamus Minogue
Ranch Hand
Joined: Jun 24, 2008
Posts: 41
|
|
oops... copy paste error.
I think you're right
Sorry about that
|
 |
Abder-Rahman Ali
Ranch Hand
Joined: May 22, 2008
Posts: 138
|
|
Seamus Minogue wrote:oops... copy paste error.
I think you're right
Sorry about that
Thats fine. but, still is not working, don't know why.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26201
|
|
Abder-Rahman Ali wrote:Thats fine. but, still is not working, don't know why.
What does 'not working" mean? Do you get an error message?
|
[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
|
 |
 |
|
|
subject: Why doesn't the JUnit test OUTPUT appear using the Ant build?
|
|
|