Akka.TestKit Namespace |
Class | Description | |
---|---|---|
AkkaSpecExtensions |
TBD
| |
AutoPilot |
Creates an AutoPilot.
An AutoPilot will be called for each received message and can be used to send or forward messages, etc. Each invocation must return the AutoPilot for the next round. To reuse an AutoPilot for the next message either return the instance or return KeepRunning. Return NoAutoPilot to stop handling messages. | |
CallingThreadDispatcher |
TBD
| |
CallingThreadDispatcherConfigurator |
TBD
| |
DeadLettersFilter |
Filter which matches DeadLetter events, if the wrapped message conforms to the given type.
| |
DelegateAutoPilot |
Creates an AutoPilot.
The AutoPilotDelegate specified in the constructor will be called for each received message and can be used to send or forward messages, etc. Each invocation must return the AutoPilot for the next round. To have this instance handle the next message either return this instance or return KeepRunning. Return NoAutoPilot to stop handling messages. | |
EventFilterFactory |
TBD
| |
FSMSpecHelpers |
TBD
| |
KeepRunning | ||
MessageEnvelope |
TBD
| |
NoAutoPilot | ||
NullMessageEnvelope |
TBD
| |
RealMessageEnvelope |
TBD
| |
TestActor |
TBD
| |
TestActorSetAutoPilot | ||
TestActorSetIgnore | ||
TestActorUnwatch |
Message that is supposed to be sent to a TestActor to make it unwatch
a previously watched actor.
| |
TestActorWatch |
Message that is supposed to be sent to a TestActor to make it watch
the specified actor and receive death notifications,
i.e. Terminated messages.
| |
TestActorRefTActor |
This special ActorRef is exclusively for use during unit testing in a single-threaded environment. Therefore, it
overrides the dispatcher to CallingThreadDispatcher and sets the receiveTimeout to None. Otherwise,
it acts just like a normal ActorRef. You may retrieve a reference to the underlying actor to test internal logic.
A TestActorRefTActor can be implicitly casted to an IActorRef or you can get the actual
IActorRef from the Ref property.
| |
TestActorRefBaseTActor |
This is the base class for TestActorRefs
| |
TestBarrier |
Wraps a Barrier for use in testing.
It always uses a timeout when waiting.
Timeouts will always throw an exception. The default timeout is based on
TestKits default out, see DefaultTimeout.
| |
TestBreaker |
TBD
| |
TestEventListener |
EventListener for running tests, which allows selectively filtering out
expected messages. To use it, include something like this in
the configuration:
akka.loggers = ["Akka.TestKit.TestEventListener, Akka.TestKit"] | |
TestFSMRefTActor, TState, TData |
This is a specialized form of the TestActorRefTActor with support for querying and
setting the state of a FSMTState, TData.
| |
TestKitAssertionsExtension |
TBD
| |
TestKitAssertionsProvider |
Contains ITestKitAssertions.
| |
TestKitBase | Remarks Unless you're creating a TestKit for a specific test framework, you should probably not inherit directly from this class. | |
TestKitExtension |
A extension to be used together with the TestKit.
Examples
To get the settings:
var testKitSettings = TestKitExtension.For(system); | |
TestKitSettings |
Contains settings to be used when writing tests with TestKit.
| |
TestLatch | A count down latch that initially is closed. In order for it to become open CountDown must be called. By default one call is enough, but this can be changed by specifying the count in the constructor. By default a timeout of 5 seconds is used. When created using TestKit.CreateTestLatch the default timeout from DefaultTimeout is used and all timeouts are dilated, i.e. multiplied by TestTimeFactor Timeouts will always throw an exception. | |
TestProbe |
TestKit-based probe which allows sending, reception and reply.
Use CreateTestProbe(String) inside your test
to create new instances.
| |
TestScheduler |
TBD
|
Interface | Description | |
---|---|---|
IEventFilter |
TBD
| |
IEventFilterApplier |
TBD
| |
INoImplicitSender |
Normally test classes has TestActor as implicit sender.
So when no sender is specified when sending messages, TestActor
is used.
When a a test class implements INoImplicitSender this behavior is removed and the normal
behavior is restored, i.e. NoSender is used as sender when no sender has been specified.
Examples public class WithImplicitSender : TestKit { public void TheTestMethod() { ... someActor.Tell("message"); //TestActor is used as Sender someActor.Tell("message", TestActor); //TestActor is used as Sender } } public class WithNoImplicitSender : TestKit, INoImplicitSender { public void TheTestMethod() { ... someActor.Tell("message"); //ActorRefs.NoSender is used as Sender } } | |
ITestKitAssertions |
TBD
| |
IUnmutableFilter |
TBD
|
Delegate | Description | |
---|---|---|
AutoPilotDelegate |
TBD
| |
TestActorIgnore |
A delegate that returns true if the message should be ignored.
|