S
sylsau
Hello,
I use JUnit 4 in an Eclipse project which is built with an Ant script.
I included the junit-report Ant task in my script to generate an HTML
report of the tests executed with JUnit.
I followed the JUnit faq on the official site to configure the junit-
report task. It runs well since I obtain an HTML report like I wanted.
However, the problem is that in my report there is no name for the
tests displayed.
I haven't found the way to named my tests in the JUnit 4
documentation. This is an example of my JUnit tests :
public class UtilsTest {
// Adapter for execute Junit Test v4 in Junit Test v3
public static junit.framework.Test suite() {
return new
junit.framework.JUnit4TestAdapter(testUtils.class);
}
@Test public void testGetName1(){
String filePath = "path...";
String result = "test1";
Assert.assertTrue("Test Utils.getName 1",
result.equals(Utils.getName(filePath)));
}
@Test public void testGetName2(){
String filePath = "path2...";
String result = "test2";
Assert.assertTrue("Test Utils.getName 2",
result.equals(Utils.getName(filePath)));
}
...etc ...
}
So, someone would know how I can name my tests to generate an HTML
report with tests name ?
Or, how can I use JUnit 3 to get the same result ?
Thanks to help me.
I use JUnit 4 in an Eclipse project which is built with an Ant script.
I included the junit-report Ant task in my script to generate an HTML
report of the tests executed with JUnit.
I followed the JUnit faq on the official site to configure the junit-
report task. It runs well since I obtain an HTML report like I wanted.
However, the problem is that in my report there is no name for the
tests displayed.
I haven't found the way to named my tests in the JUnit 4
documentation. This is an example of my JUnit tests :
public class UtilsTest {
// Adapter for execute Junit Test v4 in Junit Test v3
public static junit.framework.Test suite() {
return new
junit.framework.JUnit4TestAdapter(testUtils.class);
}
@Test public void testGetName1(){
String filePath = "path...";
String result = "test1";
Assert.assertTrue("Test Utils.getName 1",
result.equals(Utils.getName(filePath)));
}
@Test public void testGetName2(){
String filePath = "path2...";
String result = "test2";
Assert.assertTrue("Test Utils.getName 2",
result.equals(Utils.getName(filePath)));
}
...etc ...
}
So, someone would know how I can name my tests to generate an HTML
report with tests name ?
Or, how can I use JUnit 3 to get the same result ?
Thanks to help me.