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
|
Improve this Doc
View Source
MultiNodeSpec(MultiNodeConfig, Type)
Declaration
protected MultiNodeSpec(MultiNodeConfig config, Type type)
Parameters
|
Improve this Doc
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
|
Improve this Doc
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
|
Improve this Doc
View Source
TestConductor
Declaration
protected TestConductor TestConductor
Field Value
Properties
|
Improve this Doc
View Source
BaseConfig
Declaration
public static Config BaseConfig { get; }
Property Value
|
Improve this Doc
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
|
Improve this Doc
View Source
InitialParticipantsValueFactory
Declaration
protected abstract int InitialParticipantsValueFactory { get; }
Property Value
|
Improve this Doc
View Source
MaxNodes
Number of nodes node taking part in this test.
-Dmultinode.max-nodes=4
Declaration
public static int MaxNodes { get; }
Property Value
|
Improve this Doc
View Source
Myself
Declaration
public RoleName Myself { get; }
Property Value
|
Improve this Doc
View Source
NodeConfig
Declaration
public static Config NodeConfig { get; }
Property Value
|
Improve this Doc
View Source
Roles
Declaration
public ImmutableList<RoleName> Roles { get; }
Property Value
Type |
Description |
System.Collections.Immutable.ImmutableList<RoleName> |
|
|
Improve this Doc
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
|
Improve this Doc
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
|
Improve this Doc
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
|
Improve this Doc
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
|
Improve this Doc
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
|
Improve this Doc
View Source
ShutdownTimeout
Declaration
protected virtual TimeSpan ShutdownTimeout { get; }
Property Value
|
Improve this Doc
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
|
Improve this Doc
View Source
AfterTermination()
Override this method to do something when the whole test is terminating.
Declaration
protected virtual void AfterTermination()
|
Improve this Doc
View Source
AtStartup()
Override this method to do something when the whole test is starting up.
Declaration
protected virtual void AtStartup()
|
Improve this Doc
View Source
AttachConductor(TestConductor)
Declaration
protected void AttachConductor(TestConductor tc)
Parameters
|
Improve this Doc
View Source
Dispose()
Declaration
|
Improve this Doc
View Source
Dispose(Boolean)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
Boolean |
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.
|
|
Improve this Doc
View Source
EnterBarrier(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 |
|
|
Improve this Doc
View Source
InjectDeployments(ActorSystem, RoleName)
Declaration
protected void InjectDeployments(ActorSystem system, RoleName role)
Parameters
|
Improve this Doc
View Source
IsNode(RoleName[])
Verify that the running node matches one of the given nodes
Declaration
public bool IsNode(params RoleName[] nodes)
Parameters
Returns
|
Improve this Doc
View Source
MultiNodeSpecAfterAll()
Declaration
public void MultiNodeSpecAfterAll()
|
Improve this Doc
View Source
MultiNodeSpecBeforeAll()
Declaration
public void MultiNodeSpecBeforeAll()
|
Improve this Doc
View Source
MuteDeadLetters(ActorSystem, Type[])
Declaration
public void MuteDeadLetters(ActorSystem system = null, params Type[] messageClasses)
Parameters
|
Improve this Doc
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
|
Improve this Doc
View Source
RunOn(Action, 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
|
Improve this Doc
View Source
RunOnAsync(Func<Task>, RoleName[])
Execute the given block of code only on the given nodes (names according
to the roleMap
).
Declaration
public async Task RunOnAsync(Func<Task> thunkAsync, params RoleName[] nodes)
Parameters
Returns
|
Improve this Doc
View Source
StartNewSystem()
Declaration
protected ActorSystem StartNewSystem()
Returns
Implements
Extension Methods