ANT issues - Unable to create JUnit Reports- Please help
Micky Morgan
Greenhorn
Joined: Sep 20, 2006
Posts: 19
posted
0
Hi,
I am having trouble creating JUnit Report using Ant
My Env: Java 1.5/Ant 1.6.5/Junit 4.1
The below summary shows that 2 Tests Passed...but the actual JUnit report says that both tetss Failed. Looks very wierd. Could anyone please help me to figureout the issue. I have noticed that I saw com.acme.MyTester has no methods to run ??? But it does have 2 tests and hence OK (2 tests)
************* JUNIT summary *************
init:
compile: [javac] Compiling 1 source file to C:\UnitTests
Create_Jar: [jar] Building jar: C:\UnitTests\JUnitTester.jar Run: [java] JUnit version 4.1 [java] .. [java] Time: 6.406
[java] OK (2 tests)
Create_Report: [echo] Running unit tests... [junit] Running com.acme.MyTester [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.031 sec [junit] Test com.acme.MyTester FAILED [junit] Running com.acme.MyTester [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.031 sec [junit] Test com.acme.MyTester FAILED [junitreport] Transform time: 734ms
Here is the skeleton of my JUnit Tester...
************* JUNIT Tester *************
package com.acme; import org.junit.*;
public class MyTester{
public void setUp() { }
public void tearDown() { }
public void testA() throws Throwable {
System.out.println("from testA");
}
public void testB() throws Throwable {
System.out.println("from testB");
}
}
************* Ant Script *************
Here is the skeleton of Ant build.xml to run and create JUnit Report for the above Tester