Interface LogCapturing
-
- All Superinterfaces:
org.scalatest.BeforeAndAfterAll,org.scalatest.SuiteMixin
public interface LogCapturing extends org.scalatest.BeforeAndAfterAllMixin this trait to a ScalaTest test to make log lines appear only when the test failed.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>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterAll()voidclearCapturedLogs()May be called to explicitly clear the captured logs.booleanclearLogsAfterEachTest()If true, the logs will be cleared after each test.voidsuper$afterAll()org.scalatest.OutcomewithFixture(org.scalatest.TestSuite.NoArgTest test)
-
-
-
Method Detail
-
afterAll
void afterAll()
- Specified by:
afterAllin interfaceorg.scalatest.BeforeAndAfterAll
-
clearCapturedLogs
void clearCapturedLogs()
May be called to explicitly clear the captured logs.Useful for when logs are not cleared after each test. If clearing after every test is desirable, overriding
clearLogsAfterEachTest()is preferable.
-
clearLogsAfterEachTest
boolean clearLogsAfterEachTest()
If true, the logs will be cleared after each test.This is not enabled by default for Scala tests, since state may be shared between sequential tests, and logs from earlier tests may be important.
-
super$afterAll
void super$afterAll()
-
withFixture
org.scalatest.Outcome withFixture(org.scalatest.TestSuite.NoArgTest test)
-
-