public abstract class JUnitReporter extends Object implements JUnitTestListener
Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
| Modifier and Type | Class and Description |
|---|---|
static class |
JUnitReporter.TestResults
A holder for the results of the tests for a particular test class.
|
JUnitTestListener.Event| Modifier | Constructor and Description |
|---|---|
protected |
JUnitReporter(File reportFolder)
Create a
JUnitReporter with the specified output folder. |
| Modifier and Type | Method and Description |
|---|---|
com.oracle.bedrock.Option |
asOption()
Obtain this
JUnitReporter instance as an Option |
JUnitReporter.TestResults |
ensureTest(String className)
Ensure that an instance of
JUnitReporter.TestResults results exists for the
specified test class. |
abstract String |
getReportFileName(String className)
Obtain the file name to use for the test report for the
specified class name.
|
File |
getReportFolder()
Obtain the folder to use to write the test reports to.
|
Properties |
getTestProperties()
Obtain the System properties used by the test run.
|
void |
junitCompleted(JUnitTestListener.Event event)
Indicates the end of a JUnit application
|
void |
junitStarted(JUnitTestListener.Event event)
Indicates the start of a JUnit application
|
void |
testAssumptionFailure(JUnitTestListener.Event event)
Event fired when a test assumption failure was encountered.
|
void |
testClassFinished(JUnitTestListener.Event event)
Indicates end of a given test-set
|
void |
testClassStarted(JUnitTestListener.Event event)
Indicates the start of a given test-set
|
void |
testError(JUnitTestListener.Event event)
Event fired when a test ended with an error (non anticipated problem)
|
void |
testFailed(JUnitTestListener.Event event)
Event fired when a test ended with a failure (anticipated problem)
|
void |
testIgnored(JUnitTestListener.Event event)
Event fired when a test is skipped
|
void |
testRunFinished(JUnitTestListener.Event event)
Indicates end of a given test-set
|
void |
testRunStarted(JUnitTestListener.Event event)
Indicates the start of a given test-set
|
void |
testStarted(JUnitTestListener.Event event)
Event fired when a test is about to start
|
void |
testSucceeded(JUnitTestListener.Event event)
Event fired when a test ended successfully
|
abstract void |
writeReport(PrintStream out,
JUnitReporter.TestResults test)
Write the test report for the specified
JUnitReporter.TestResults to
the specified PrintStream. |
protected JUnitReporter(File reportFolder)
JUnitReporter with the specified output folder.
If the output folder is null the report will be written to System.out.
reportFolder - the folder to write the report file to or null if the
report should be written to System.outpublic File getReportFolder()
public JUnitReporter.TestResults ensureTest(String className)
JUnitReporter.TestResults results exists for the
specified test class.className - the name of the class to obtain tests results forJUnitReporter.TestResults instance for the specified test class namepublic Properties getTestProperties()
public com.oracle.bedrock.Option asOption()
JUnitReporter instance as an OptionJUnitReporter instance as an Optionpublic abstract void writeReport(PrintStream out, JUnitReporter.TestResults test)
JUnitReporter.TestResults to
the specified PrintStream.out - the PrintStream to write the test totest - the JUnitReporter.TestResults to use to write the reportpublic abstract String getReportFileName(String className)
className - the name of the test classpublic void junitStarted(JUnitTestListener.Event event)
JUnitTestListenerjunitStarted in interface JUnitTestListenerevent - the eventpublic void junitCompleted(JUnitTestListener.Event event)
JUnitTestListenerjunitCompleted in interface JUnitTestListenerevent - the eventpublic void testRunStarted(JUnitTestListener.Event event)
JUnitTestListenertestRunStarted in interface JUnitTestListenerevent - the report entry describing the test suitepublic void testRunFinished(JUnitTestListener.Event event)
JUnitTestListenertestRunFinished in interface JUnitTestListenerevent - the report entry describing the test suitetpublic void testStarted(JUnitTestListener.Event event)
JUnitTestListenertestStarted in interface JUnitTestListenerevent - The report entry to log forpublic void testClassStarted(JUnitTestListener.Event event)
JUnitTestListenertestClassStarted in interface JUnitTestListenerevent - the report entry describing the test suitepublic void testClassFinished(JUnitTestListener.Event event)
JUnitTestListenertestClassFinished in interface JUnitTestListenerevent - the report entry describing the test suitepublic void testSucceeded(JUnitTestListener.Event event)
JUnitTestListenertestSucceeded in interface JUnitTestListenerevent - The report entry to log forpublic void testIgnored(JUnitTestListener.Event event)
JUnitTestListenertestIgnored in interface JUnitTestListenerevent - The report entry to log forpublic void testFailed(JUnitTestListener.Event event)
JUnitTestListenertestFailed in interface JUnitTestListenerevent - The report entry to log forpublic void testError(JUnitTestListener.Event event)
JUnitTestListenertestError in interface JUnitTestListenerevent - The report entry to log forpublic void testAssumptionFailure(JUnitTestListener.Event event)
JUnitTestListenertestAssumptionFailure in interface JUnitTestListenerevent - The report entry to log forCopyright © 2017. All rights reserved.