I got the following JUnit stuff running well with ant, but so far I have not found how to use my formatter from within my main() method (when not using ant).
Here's the ant task:
<junit printsummary="true" errorProperty="test.failed" failureProperty="test.failed">
<classpath refid="test.class.path" />
<!-- use multiple formatters -->
<formatter type="brief" usefile="false" />
<!-- console log -->
<formatter type="xml" classname="x.selenium.output.SeleniumFrameworkFormatter" />
<!-- file log -->
<test name="x.selenium.SeleniumFramework" haltonfailure="no" outfile="result" todir="${build.temp.dir}" />
<junit>
In Java code, I have this as an alternative, but this prints to the console, and not using my formatter to create a nice html file:
JUnitCore junit = new JUnitCore();
Result result = junit.run(classes);
Does anyone know how to do a similar thing in Java code? Thanks!