Class JUnitXmlFormatter
java.lang.Object
org.ek9lang.cli.JUnitXmlFormatter
- All Implemented Interfaces:
TestResultFormatter
JUnit XML test output formatter (-t3).
Compatible with Jenkins, GitHub Actions, GitLab CI, and other CI/CD tools.
Produces standard JUnit XML format with EK9 test type extensions:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="test.module" tests="4" failures="1" errors="0" skipped="0" time="0.010">
<properties>
<property name="ek9.types.assert" value="1"/>
<property name="ek9.types.blackbox" value="1"/>
<property name="ek9.types.parameterized" value="2"/>
</properties>
<testcase name="SimpleTest" classname="test.module" time="0.003">
<properties>
<property name="ek9.test_type" value="assert"/>
</properties>
</testcase>
<testcase name="ParamTest [case: hello]" classname="test.module" time="0.004">
<properties>
<property name="ek9.test_type" value="parameterized"/>
<property name="ek9.case_id" value="hello"/>
</properties>
</testcase>
</testsuite>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreportDiscovery(List<DiscoveredTest> tests, PrintStream out) Report the discovery of tests before execution begins.voidreportExecutionStart(int testCount, PrintStream out) Report that test execution is starting.voidreportResults(List<TestResult> results, PrintStream out) Report all test results after execution completes.
-
Constructor Details
-
JUnitXmlFormatter
JUnitXmlFormatter()
-
-
Method Details
-
reportDiscovery
Description copied from interface:TestResultFormatterReport the discovery of tests before execution begins.The discovery report should include:
- Test type breakdown (assert-based vs blackbox vs parameterized)
- Total test case count (including parameterized cases)
- Group information if applicable
- Specified by:
reportDiscoveryin interfaceTestResultFormatter- Parameters:
tests- The discovered tests with metadataout- The output stream
-
reportExecutionStart
Description copied from interface:TestResultFormatterReport that test execution is starting. Some formatters may output a progress message here.- Specified by:
reportExecutionStartin interfaceTestResultFormatter- Parameters:
testCount- The number of tests to executeout- The output stream
-
reportResults
Description copied from interface:TestResultFormatterReport all test results after execution completes.- Specified by:
reportResultsin interfaceTestResultFormatter- Parameters:
results- The test resultsout- The output stream
-