Package rife.bld.extension
Class JUnitReporterOperation
java.lang.Object
rife.bld.operations.AbstractOperation<JUnitReporterOperation>
rife.bld.extension.JUnitReporterOperation
An operation that parses JUnit XML reports and prints test failure information grouped by test class.
Usage:
@BuildCommand(summary = "Runs the JUnit reporter")
public void reporter() throws Exception {
new JUnitReporterOperation()
.fromProject(this)
.failOnSummary(true)
.reportFile("build/test-results/test/TEST-junit-jupiter.xml")
.execute();
}
Arguments:
When configured viafromProject(BaseProject), the following arguments are consumed:
--all- Print full details for all failed tests--index=N[.M]- Print details for test N, or parameterized subtest N.M
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Performs the operation.booleanReturns whether the operation should fail if test failures are found.failOnSummary(boolean failOnSummary) Configures whether the operation should fail if test failures are found.fromProject(BaseProject project) Configures the operation from aBaseProject.Returns the path to the report file.reportFile(File reportFile) Specifies the XML report file.reportFile(String reportFile) Specifies the XML report file.reportFile(Path reportFile) Specifies the XML report file.Methods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent, verbose, verbose
-
Constructor Details
-
JUnitReporterOperation
public JUnitReporterOperation()
-
-
Method Details
-
execute
Performs the operation.- Specified by:
executein classAbstractOperation<JUnitReporterOperation>- Throws:
ExitStatusException- if the operation failsException
-
failOnSummary
Configures whether the operation should fail if test failures are found.When
true, the bld command exits with failure if any test failures are present. Whenfalse, failures are printed but the command exits successfully.- Parameters:
failOnSummary-trueto fail the build on test failures,falseto not fail- Returns:
- this operation
-
failOnSummary
public boolean failOnSummary()Returns whether the operation should fail if test failures are found.- Returns:
trueif the operation should fail on test failures,falseotherwise
-
fromProject
Configures the operation from aBaseProject.If not set, the
report fileis set to the default location for JUnit reports.Consumes
--allor--index=N[.M]fromproject.arguments()if present.- Parameters:
project- the project to use as the context for this operation- Returns:
- this operation
- Throws:
NullPointerException- ifprojectisnull
-
reportFile
Returns the path to the report file.- Returns:
- the path, or
nullif not set
-
reportFile
Specifies the XML report file.- Parameters:
reportFile- the report file path- Returns:
- this operation
- Throws:
NullPointerException- ifreportFileisnull- See Also:
-
reportFile
Specifies the XML report file.- Parameters:
reportFile- the report file path- Returns:
- this operation
- Throws:
NullPointerException- ifreportFileisnull- See Also:
-
reportFile
Specifies the XML report file.- Parameters:
reportFile- the report file path- Returns:
- this operation
- Throws:
NullPointerException- ifreportFileisnullIllegalArgumentException- ifreportFileis empty- See Also:
-