Class LogCapturing
java.lang.Object
org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing
- All Implemented Interfaces:
org.junit.rules.TestRule
JUnit
TestRule to make log lines appear only when the test failed.
Use this in test by adding a public field annotated with @TestRule:
@Rule public final LogCapturing logCapturing = new LogCapturing();
Requires Logback and configuration like the following the logback-test.xml:
<appender name="CapturingAppender" class="org.apache.pekko.actor.testkit.typed.internal.CapturingAppender" />
<logger name="org.apache.pekko.actor.testkit.typed.internal.CapturingAppenderDelegate" >
<appender-ref ref="STDOUT"/>
</logger>
<root level="DEBUG">
<appender-ref ref="CapturingAppender"/>
</root>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
-
Constructor Details
-
LogCapturing
public LogCapturing()
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
applyin interfaceorg.junit.rules.TestRule
-