Reputation: 37
import junitexample.MessageUtil;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class TestJunit {
String message = "Hello World";
MessageUtil messageUtil = new MessageUtil(message);
@Test
public void testPrintMessage() {
assertEquals(message,messageUtil.printMessage());
}
}
i want to load this junit test result ouput into csv in eclipse. Is there any way ?
Upvotes: 2
Views: 3182
Reputation: 357
On the JUnit view in Eclipse, on the Test Run History... menu, there is an Export option that lets you export to an XML file. The menu option is slightly difficult to see, it's near the top-right of the JUnit view. On Eclipse Luna it's the black down triangle at the top right.
Then you can use XSLT to convert the XML to CSV. Some previous questions touched on this technique:
Upvotes: 3