Package org.citrusframework.report
Class LoggingReporter
java.lang.Object
org.citrusframework.report.AbstractTestReporter
org.citrusframework.report.LoggingReporter
- All Implemented Interfaces:
org.citrusframework.common.ShutdownPhase,org.citrusframework.report.MessageListener,org.citrusframework.report.TestActionListener,org.citrusframework.report.TestListener,org.citrusframework.report.TestReporter,org.citrusframework.report.TestSuiteListener
- Direct Known Subclasses:
OutputStreamReporter
public class LoggingReporter
extends AbstractTestReporter
implements org.citrusframework.report.MessageListener, org.citrusframework.report.TestSuiteListener, org.citrusframework.report.TestListener, org.citrusframework.report.TestActionListener, org.citrusframework.common.ShutdownPhase
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.voiddestroy()protected voidWrite error level output.protected voidWrite error level output.voidgenerate(org.citrusframework.report.TestResults testResults) Subclasses must implement this method and generate the test report for given test results.protected voidWrite info level output.protected static voidinitialized(boolean value) protected booleanIs debug level enabled.protected booleanbooleanprotected voidnewLine()Adds new line to console logging output.voidonFinish()voidonFinishFailure(Throwable cause) voidvoidonInboundMessage(org.citrusframework.message.Message message, org.citrusframework.context.TestContext context) voidonOutboundMessage(org.citrusframework.message.Message message, org.citrusframework.context.TestContext context) voidonStart()voidonStartFailure(Throwable cause) voidvoidonTestActionFailed(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction, Throwable cause) voidonTestActionFinish(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction) voidonTestActionSkipped(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction) voidonTestActionStart(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction) voidonTestExecutionEnd(org.citrusframework.TestCase test) voidonTestFailure(org.citrusframework.TestCase testCase, Throwable cause) voidonTestSkipped(org.citrusframework.TestCase test) voidonTestStart(org.citrusframework.TestCase test) voidonTestSuccess(org.citrusframework.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, setReportDirectoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.report.TestListener
onAfterTestEnd, onAfterTestStart, onBeforeTestEnd, onBeforeTestStart, onFinalActionsEnd, onFinalActionsStart, onTestEnd, onTestExecutionStart, onTestFinish
-
Constructor Details
-
LoggingReporter
public LoggingReporter() -
LoggingReporter
public LoggingReporter(boolean stackTraceOutputEnabled)
-
-
Method Details
-
initialized
protected static void initialized(boolean value) -
isStackTraceOutputEnabled
public boolean isStackTraceOutputEnabled() -
generate
public void generate(org.citrusframework.report.TestResults testResults) 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 interfaceorg.citrusframework.report.TestListener
-
onTestSkipped
public void onTestSkipped(org.citrusframework.TestCase test) - Specified by:
onTestSkippedin interfaceorg.citrusframework.report.TestListener
-
onTestStart
public void onTestStart(org.citrusframework.TestCase test) - Specified by:
onTestStartin interfaceorg.citrusframework.report.TestListener
-
onTestExecutionEnd
public void onTestExecutionEnd(org.citrusframework.TestCase test) - Specified by:
onTestExecutionEndin interfaceorg.citrusframework.report.TestListener
-
onTestSuccess
public void onTestSuccess(org.citrusframework.TestCase test) - Specified by:
onTestSuccessin interfaceorg.citrusframework.report.TestListener
-
onFinish
public void onFinish()- Specified by:
onFinishin interfaceorg.citrusframework.report.TestSuiteListener
-
onStart
public void onStart()- Specified by:
onStartin interfaceorg.citrusframework.report.TestSuiteListener
-
onFinishFailure
- Specified by:
onFinishFailurein interfaceorg.citrusframework.report.TestSuiteListener
-
onFinishSuccess
public void onFinishSuccess()- Specified by:
onFinishSuccessin interfaceorg.citrusframework.report.TestSuiteListener
-
onStartFailure
- Specified by:
onStartFailurein interfaceorg.citrusframework.report.TestSuiteListener
-
onStartSuccess
public void onStartSuccess()- Specified by:
onStartSuccessin interfaceorg.citrusframework.report.TestSuiteListener
-
onTestActionStart
public void onTestActionStart(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction) - Specified by:
onTestActionStartin interfaceorg.citrusframework.report.TestActionListener
-
onTestActionFinish
public void onTestActionFinish(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction) - Specified by:
onTestActionFinishin interfaceorg.citrusframework.report.TestActionListener
-
onTestActionFailed
public void onTestActionFailed(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction, Throwable cause) - Specified by:
onTestActionFailedin interfaceorg.citrusframework.report.TestActionListener
-
onTestActionSkipped
public void onTestActionSkipped(org.citrusframework.TestCase testCase, org.citrusframework.TestAction testAction) - Specified by:
onTestActionSkippedin interfaceorg.citrusframework.report.TestActionListener
-
onInboundMessage
public void onInboundMessage(org.citrusframework.message.Message message, org.citrusframework.context.TestContext context) - Specified by:
onInboundMessagein interfaceorg.citrusframework.report.MessageListener
-
onOutboundMessage
public void onOutboundMessage(org.citrusframework.message.Message message, org.citrusframework.context.TestContext context) - Specified by:
onOutboundMessagein interfaceorg.citrusframework.report.MessageListener
-
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() -
destroy
public void destroy()- Specified by:
destroyin interfaceorg.citrusframework.common.ShutdownPhase
-