Class MultiNodeSpec
Note: To be able to run tests with everything ignored or excluded by tags
you must not use testconductor
, or helper methods that use testconductor
,
from the constructor of your test class. Otherwise the controller node might
be shutdown before other nodes have completed and you will see errors like:
AskTimeoutException: sending to terminated ref breaks promises
. Using lazy
val is fine.
Inheritance
MultiNodeSpec
Assembly: Akka.Remote.TestKit.dll
Syntax
public abstract class MultiNodeSpec : TestKitBase, IActorRefFactory, IMultiNodeSpecCallbacks, IDisposable
Constructors
|
Edit this page
View Source
MultiNodeSpec(MultiNodeConfig, Type)
Declaration
protected MultiNodeSpec(MultiNodeConfig config, Type type)
Parameters
|
Edit this page
View Source
MultiNodeSpec(RoleName, ActorSystem, ImmutableList<RoleName>, Func<RoleName, ImmutableList<string>>)
Declaration
protected MultiNodeSpec(RoleName myself, ActorSystem system, ImmutableList<RoleName> roles, Func<RoleName, ImmutableList<string>> deployments)
Parameters
|
Edit this page
View Source
MultiNodeSpec(RoleName, ActorSystemSetup, ImmutableList<RoleName>, Func<RoleName, ImmutableList<string>>)
Declaration
protected MultiNodeSpec(RoleName myself, ActorSystemSetup setup, ImmutableList<RoleName> roles, Func<RoleName, ImmutableList<string>> deployments)
Parameters
Fields
|
Edit this page
View Source
TestConductor
Declaration
protected TestConductor TestConductor
Field Value
Properties
|
Edit this page
View Source
BaseConfig
Declaration
public static Config BaseConfig { get; }
Property Value
|
Edit this page
View Source
InitialParticipants
MUST BE DEFINED BY USER.
Defines the number of participants required for starting the test. This
might not be equals to the number of nodes available to the test.
Declaration
public int InitialParticipants { get; }
Property Value
|
Edit this page
View Source
InitialParticipantsValueFactory
Declaration
protected abstract int InitialParticipantsValueFactory { get; }
Property Value
|
Edit this page
View Source
MaxNodes
Number of nodes node taking part in this test.
-Dmultinode.max-nodes=4
Declaration
public static int MaxNodes { get; }
Property Value
|
Edit this page
View Source
Myself
Declaration
public RoleName Myself { get; }
Property Value
|
Edit this page
View Source
NodeConfig
Declaration
public static Config NodeConfig { get; }
Property Value
|
Edit this page
View Source
Roles
Declaration
public ImmutableList<RoleName> Roles { get; }
Property Value
|
Edit this page
View Source
SelfIndex
Index of this node in the roles sequence. The TestConductor
is started in "controller" mode on selfIndex 0, i.e. there you can inject
failures and shutdown other nodes etc.
Declaration
public static int SelfIndex { get; }
Property Value
|
Edit this page
View Source
SelfName
Name (or IP address; must be resolvable)
of the host this node is running on
-Dmultinode.host=host.example.com
InetAddress.getLocalHost.getHostAddress is used if empty or "localhost"
is defined as system property "multinode.host".
Declaration
public static string SelfName { get; }
Property Value
|
Edit this page
View Source
SelfPort
Port number of this node. Defaults to 0 which means a random port.
-Dmultinode.port=0
Declaration
public static int SelfPort { get; }
Property Value
|
Edit this page
View Source
ServerName
Name (or IP address; must be resolvable using InetAddress.getByName)
of the host that the server node is running on.
-Dmultinode.server-host=server.example.com
Declaration
public static string ServerName { get; }
Property Value
|
Edit this page
View Source
ServerPort
Port number of the node that's running the server system. Defaults to 4711.
-Dmultinode.server-port=4711
Declaration
public static int ServerPort { get; }
Property Value
|
Edit this page
View Source
ShutdownTimeout
Declaration
protected virtual TimeSpan ShutdownTimeout { get; }
Property Value
|
Edit this page
View Source
VerifySystemShutdown
Override this and return true
to assert that the
shutdown of the ActorSystem
was done properly.
Declaration
protected virtual bool VerifySystemShutdown { get; }
Property Value
Methods
|
Edit this page
View Source
AfterTermination()
Override this method to do something when the whole test is terminating.
Declaration
protected virtual void AfterTermination()
|
Edit this page
View Source
AtStartup()
Override this method to do something when the whole test is starting up.
Declaration
protected virtual void AtStartup()
|
Edit this page
View Source
AttachConductor(TestConductor)
Declaration
protected void AttachConductor(TestConductor tc)
Parameters
|
Edit this page
View Source
Dispose()
Declaration
|
Edit this page
View Source
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
bool |
disposing |
if set to true the method has been called directly or indirectly by a
user's code. Managed and unmanaged resources will be disposed.
if set to false the method has been called by the runtime from inside the finalizer and only
unmanaged resources can be disposed.
|
|
Edit this page
View Source
EnterBarrier(params string[])
Enter the named barriers in the order given. Use the remaining duration from
the innermost enclosing within
block or the default BarrierTimeout
Declaration
public void EnterBarrier(params string[] name)
Parameters
Type |
Name |
Description |
string[] |
name |
|
|
Edit this page
View Source
InjectDeployments(ActorSystem, RoleName)
Declaration
protected void InjectDeployments(ActorSystem system, RoleName role)
Parameters
|
Edit this page
View Source
IsNode(params RoleName[])
Verify that the running node matches one of the given nodes
Declaration
public bool IsNode(params RoleName[] nodes)
Parameters
Returns
|
Edit this page
View Source
MultiNodeSpecAfterAll()
Call this after the all test cases have run. NOT after every test case.
Declaration
public void MultiNodeSpecAfterAll()
|
Edit this page
View Source
MultiNodeSpecBeforeAll()
Call this before the start of the test run. NOT before every test case.
Declaration
public void MultiNodeSpecBeforeAll()
|
Edit this page
View Source
MuteDeadLetters(ActorSystem, params Type[])
Declaration
public void MuteDeadLetters(ActorSystem system = null, params Type[] messageClasses)
Parameters
|
Edit this page
View Source
Node(RoleName)
Query the controller for the transport address of the given node (by role name) and
return that as an ActorPath for easy composition:
var serviceA = Sys.ActorSelection(Node(new RoleName("master")) / "user" / "serviceA");
Declaration
public ActorPath Node(RoleName role)
Parameters
Returns
|
Edit this page
View Source
RunOn(Action, params RoleName[])
Execute the given block of code only on the given nodes (names according
to the roleMap
).
Declaration
public void RunOn(Action thunk, params RoleName[] nodes)
Parameters
|
Edit this page
View Source
RunOnAsync(Func<Task>, params RoleName[])
Execute the given block of code only on the given nodes (names according
to the roleMap
).
Declaration
public Task RunOnAsync(Func<Task> thunkAsync, params RoleName[] nodes)
Parameters
Returns
|
Edit this page
View Source
StartNewSystem()
Declaration
protected ActorSystem StartNewSystem()
Returns
Implements
Extension Methods