Package org.citrusframework.report
Class LoggingReporter
java.lang.Object
org.citrusframework.report.AbstractTestReporter
org.citrusframework.report.LoggingReporter
- All Implemented Interfaces:
MessageListener,TestActionListener,TestListener,TestReporter,TestSuiteListener
- Direct Known Subclasses:
OutputStreamReporter
public class LoggingReporter
extends AbstractTestReporter
implements MessageListener, TestSuiteListener, TestListener, TestActionListener
Simple logging reporter printing test start and ending to the console/logger.
This class provides an option for disablement, allowing you to suppress logging for specific instances
and delegate the logging to another facility, which could potentially be a subclass of
LoggingReporter.
It's important to note that when an instance of this class is disabled, it will not perform any logging,
irrespective of the severity level.
Implementation note: The disablement of the reporter is achieved by using a NOPLogger,
meaning that this class should primarily focus on logging operations and not extend beyond that functionality.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidWrite debug level output.protected voidWrite error level output.protected voidWrite error level output.voidgenerate(TestResults testResults) Subclasses must implement this method and generate the test report for given test results.protected voidWrite info level output.protected booleanIs debug level enabled.protected booleanprotected voidnewLine()Adds new line to console logging output.voidonFinish()voidonFinishFailure(Throwable cause) voidvoidonInboundMessage(Message message, TestContext context) voidonOutboundMessage(Message message, TestContext context) voidonStart()voidonStartFailure(Throwable cause) voidvoidonTestActionFinish(TestCase testCase, TestAction testAction) voidonTestActionSkipped(TestCase testCase, TestAction testAction) voidonTestActionStart(TestCase testCase, TestAction testAction) voidonTestFailure(TestCase testCase, Throwable cause) voidonTestFinish(TestCase test) voidonTestSkipped(TestCase test) voidonTestStart(TestCase test) voidonTestSuccess(TestCase test) protected voidHelper method to build consistent separatorsvoidsetEnabled(boolean enabled) Sets the enablement state of the reporter.Methods inherited from class org.citrusframework.report.AbstractTestReporter
generateReport, getReportDirectory, isIgnoreErrors, setIgnoreErrors, setReportDirectory
-
Constructor Details
-
LoggingReporter
public LoggingReporter()
-
-
Method Details
-
generate
Description copied from class:AbstractTestReporterSubclasses must implement this method and generate the test report for given test results.- Specified by:
generatein classAbstractTestReporter
-
onTestFailure
- Specified by:
onTestFailurein interfaceTestListener
-
onTestSkipped
- Specified by:
onTestSkippedin interfaceTestListener
-
onTestStart
- Specified by:
onTestStartin interfaceTestListener
-
onTestFinish
- Specified by:
onTestFinishin interfaceTestListener
-
onTestSuccess
- Specified by:
onTestSuccessin interfaceTestListener
-
onFinish
public void onFinish()- Specified by:
onFinishin interfaceTestSuiteListener
-
onStart
public void onStart()- Specified by:
onStartin interfaceTestSuiteListener
-
onFinishFailure
- Specified by:
onFinishFailurein interfaceTestSuiteListener
-
onFinishSuccess
public void onFinishSuccess()- Specified by:
onFinishSuccessin interfaceTestSuiteListener
-
onStartFailure
- Specified by:
onStartFailurein interfaceTestSuiteListener
-
onStartSuccess
public void onStartSuccess()- Specified by:
onStartSuccessin interfaceTestSuiteListener
-
onTestActionStart
- Specified by:
onTestActionStartin interfaceTestActionListener
-
onTestActionFinish
- Specified by:
onTestActionFinishin interfaceTestActionListener
-
onTestActionSkipped
- Specified by:
onTestActionSkippedin interfaceTestActionListener
-
onInboundMessage
- Specified by:
onInboundMessagein interfaceMessageListener
-
onOutboundMessage
- Specified by:
onOutboundMessagein interfaceMessageListener
-
separator
protected void separator()Helper method to build consistent separators -
newLine
protected void newLine()Adds new line to console logging output. -
info
Write info level output. -
error
Write error level output. -
error
Write error level output. -
debug
Write debug level output. -
isDebugEnabled
protected boolean isDebugEnabled()Is debug level enabled. -
setEnabled
public void setEnabled(boolean enabled) Sets the enablement state of the reporter. -
isEnabled
protected boolean isEnabled()
-