public class JUnitTextReporter extends JUnitReporter
JUnitReporter that produces a text based report
in the same format as that produced by the Maven Surefire plugin.
Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
JUnitReporter.TestResultsJUnitTestListener.Event| Modifier and Type | Field and Description |
|---|---|
static String |
DASHES
A line of dashes used on reports.
|
| Constructor and Description |
|---|
JUnitTextReporter()
Create a
JUnitTextReporter that prints the
report to System.out. |
JUnitTextReporter(File reportFolder)
Create a
JUnitTextReporter that prints the
report to a file in the specified folder. |
| Modifier and Type | Method and Description |
|---|---|
static com.oracle.bedrock.Option |
at(File folder)
Obtain a
JUnitTextReporter as an Option
that will print test reports to the specified folder. |
String |
getReportFileName(Class testClass)
Obtain the file name that will be used to print a test
report for the specified
Class. |
String |
getReportFileName(String className)
Obtain the file name to use for the test report for the
specified class name.
|
static com.oracle.bedrock.Option |
toConsole()
|
void |
writeReport(PrintStream out,
JUnitReporter.TestResults test)
Write the test report for the specified
JUnitReporter.TestResults to
the specified PrintStream. |
asOption, ensureTest, getReportFolder, getTestProperties, junitCompleted, junitStarted, testAssumptionFailure, testClassFinished, testClassStarted, testError, testFailed, testIgnored, testRunFinished, testRunStarted, testStarted, testSucceededpublic static final String DASHES
public JUnitTextReporter()
JUnitTextReporter that prints the
report to System.out.public JUnitTextReporter(File reportFolder)
JUnitTextReporter that prints the
report to a file in the specified folder.reportFolder - the folder to print the report file topublic void writeReport(PrintStream out, JUnitReporter.TestResults test)
JUnitReporterJUnitReporter.TestResults to
the specified PrintStream.writeReport in class JUnitReporterout - the PrintStream to write the test totest - the JUnitReporter.TestResults to use to write the reportpublic String getReportFileName(String className)
JUnitReportergetReportFileName in class JUnitReporterclassName - the name of the test classpublic String getReportFileName(Class testClass)
Class.testClass - the Class to obtain the file name forpublic static com.oracle.bedrock.Option at(File folder)
JUnitTextReporter as an Option
that will print test reports to the specified folder.folder - the folder to print test reports toJUnitTextReporter as an Option
that will print test reports to the specified folderpublic static com.oracle.bedrock.Option toConsole()
JUnitTextReporter as an Option
that will print test reports to System.outCopyright © 2017. All rights reserved.