Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.05 KB

readme.md

File metadata and controls

27 lines (18 loc) · 1.05 KB

#JUnitXmlFormatter

This repository contains an AntXmlRunListener, based on the one contained in Schmant. This RunListener can be used to generate JUnit XML reports which can be read by various integration servers and development tools.

Programmatic Usage:

// default constructor will look for system property "org.schmant.task.junit4.target", with path to output XML file.
AntXmlRunListener runListener = new AntXmlRunListener()

// or you can set the output stream
runListener.setOutputStream(new FileOutputStream(new File("file_name.xml")));

// then you need to configure the RunListener to be used by JUnit, depending on your setup. Have a look at
// org.junit.runner.JUnitCore as well as barrypitman.junitXmlFormatter.Runner

Commandline usage:

# Run the test mypackage.Suite1, using barrypitman.junitXmlFormatter.Runner#main(String...) to run the tests
java -cp test-jar-with-dependencies.jar -Dorg.schmant.task.junit4.target=junit_report.xml barrypitman.junitXmlFormatter.Runner mypackage.Suite1