Package org.apache.pekko.testkit
Class TestEventListener
- java.lang.Object
-
- org.apache.pekko.event.Logging.DefaultLogger
-
- org.apache.pekko.testkit.TestEventListener
-
- All Implemented Interfaces:
Actor,RequiresMessageQueue<LoggerMessageQueueSemantics>,Logging.StdOutLogger
public class TestEventListener extends Logging.DefaultLogger
EventListener for running tests, which allows selectively filtering out expected messages. To use it, include something like this intopekko.test.confand run your tests with system property"pekko.mode"set to"test":pekko { loggers = ["org.apache.pekko.testkit.TestEventListener"] }
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pekko.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
Constructor Summary
Constructors Constructor Description TestEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFilter(EventFilter filter)booleanfilter(Logging.LogEvent event)scala.collection.immutable.List<EventFilter>filters()voidfilters_$eq(scala.collection.immutable.List<EventFilter> x$1)scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>receive()Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.voidremoveFilter(EventFilter filter)-
Methods inherited from class org.apache.pekko.event.Logging.DefaultLogger
context, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, self
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pekko.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, postRestart, postStop, preRestart, preStart, sender, supervisorStrategy, unhandled
-
-
-
-
Method Detail
-
addFilter
public void addFilter(EventFilter filter)
-
filter
public boolean filter(Logging.LogEvent event)
-
filters
public scala.collection.immutable.List<EventFilter> filters()
-
filters_$eq
public void filters_$eq(scala.collection.immutable.List<EventFilter> x$1)
-
receive
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface:ActorScala API: This defines the initial actor behavior, it must return a partial function with the actor logic.- Specified by:
receivein interfaceActor- Overrides:
receivein classLogging.DefaultLogger
-
removeFilter
public void removeFilter(EventFilter filter)
-
-