Interface WithLogCapturing

All Superinterfaces:
org.scalatest.SuiteMixin
All Known Implementing Classes:
ClientCancellationSpec, ClientServerHttp2EnabledSpec, ClientServerSpec, ClientServerSpecBase, ClientTransportWithCustomResolverSpec, EntityDiscardingSpec, FramingSpec, GracefulTerminationSpec, HighLevelOutgoingConnectionSpec, HostConnectionPoolSpec, HttpEntitySpec, HttpExtensionApiSpec, HttpHeaderParserCRLFSpec, HttpHeaderParserLFSpec, HttpHeaderParserSpec, HttpServerBug21008Spec, HttpServerSpec, HttpServerWithExplicitSchedulerSpec, HttpsProxyGraphStageSpec, LowLevelOutgoingConnectionSpec, MessageSpec, MultipartSpec, NewConnectionPoolSpec, PekkoSpecWithMaterializer, RenderingSpec, ResponseParserCRLFSpec, ResponseParserLFSpec, ResponseParserSpec, TlsEndpointVerificationSpec, Utf8CodingSpecs, WebSocketClientSpec, WebSocketIntegrationSpec, WebSocketServerSpec

public interface WithLogCapturing extends org.scalatest.SuiteMixin
Mixin this trait to a test to make log lines appear only when the test failed.
  • Method Summary

    Modifier and Type
    Method
    Description
    scala.Option<String>
    We expect a severe message but the message should contain this text.
    boolean
    Can be overridden to return true to check that no warning or error messages are logged during the execution of the test
    boolean
    isSevere(org.apache.pekko.event.Logging.LogEvent event)
    Can be overridden to adapt which events should be considered as severe if failOnSevereMessages is enabled.
    org.apache.pekko.actor.ActorSystem
     
    org.scalatest.Outcome
    withFixture(org.scalatest.TestSuite.NoArgTest test)
     
    <T> T
    withPrefixedOut(String prefix, scala.Function0<T> thunk)
    Adds a prefix to every line printed out during execution of the thunk.

    Methods inherited from interface org.scalatest.SuiteMixin

    expectedTestCount, nestedSuites, rerunner, run, runNestedSuites, runTest, runTests, styleName, suiteId, suiteName, tags, testDataFor, testNames
  • Method Details

    • expectSevereLogsOnlyToMatch

      scala.Option<String> expectSevereLogsOnlyToMatch()
      We expect a severe message but the message should contain this text. If there are any other severe messages, the test will fail.
      Returns:
      (undocumented)
    • failOnSevereMessages

      boolean failOnSevereMessages()
      Can be overridden to return true to check that no warning or error messages are logged during the execution of the test
      Returns:
      (undocumented)
    • isSevere

      boolean isSevere(org.apache.pekko.event.Logging.LogEvent event)
      Can be overridden to adapt which events should be considered as severe if failOnSevereMessages is enabled.
      Parameters:
      event - (undocumented)
      Returns:
      (undocumented)
    • system

      org.apache.pekko.actor.ActorSystem system()
    • withFixture

      org.scalatest.Outcome withFixture(org.scalatest.TestSuite.NoArgTest test)
    • withPrefixedOut

      <T> T withPrefixedOut(String prefix, scala.Function0<T> thunk)
      Adds a prefix to every line printed out during execution of the thunk.