move multi-node-testkit into its own module, see #2981
This commit is contained in:
parent
29b274b9c0
commit
c3b363c9b3
18 changed files with 103 additions and 33 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
.. _akka-contrib:
|
||||||
|
|
||||||
External Contributions
|
External Contributions
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -543,7 +543,7 @@ How to Test
|
||||||
:ref:`multi-node-testing` is useful for testing cluster applications.
|
:ref:`multi-node-testing` is useful for testing cluster applications.
|
||||||
|
|
||||||
Set up your project according to the instructions in :ref:`multi-node-testing` and :ref:`multi-jvm-testing`, i.e.
|
Set up your project according to the instructions in :ref:`multi-node-testing` and :ref:`multi-jvm-testing`, i.e.
|
||||||
add the ``sbt-multi-jvm`` plugin and the dependency to ``akka-remote-tests-experimental``.
|
add the ``sbt-multi-jvm`` plugin and the dependency to ``akka-multi-node-testkit``.
|
||||||
|
|
||||||
First, as described in :ref:`multi-node-testing`, we need some scaffolding to configure the ``MultiNodeSpec``.
|
First, as described in :ref:`multi-node-testing`, we need some scaffolding to configure the ``MultiNodeSpec``.
|
||||||
Define the participating roles and their :ref:`cluster_configuration_scala` in an object extending ``MultiNodeConfig``:
|
Define the participating roles and their :ref:`cluster_configuration_scala` in an object extending ``MultiNodeConfig``:
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ Here is an example Build.scala file that uses the MultiJvm plugin:
|
||||||
// ---- test dependencies ----
|
// ---- test dependencies ----
|
||||||
"com.typesafe.akka" %% "akka-testkit" % "@version@" %
|
"com.typesafe.akka" %% "akka-testkit" % "@version@" %
|
||||||
"test" @crossString@,
|
"test" @crossString@,
|
||||||
"com.typesafe.akka" %% "akka-remote-tests-experimental" % "@version@" %
|
"com.typesafe.akka" %% "akka-multi-node-testkit" % "@version@" %
|
||||||
"test" @crossString@,
|
"test" @crossString@,
|
||||||
"org.scalatest" %% "scalatest" % "1.9.1" % "test",
|
"org.scalatest" %% "scalatest" % "1.9.1" % "test",
|
||||||
"junit" % "junit" % "4.5" % "test"
|
"junit" % "junit" % "4.5" % "test"
|
||||||
|
|
|
||||||
|
|
@ -173,10 +173,10 @@ The multi node testing kit is a separate jar file. Make sure that you have the f
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
"com.typesafe.akka" %% "akka-remote-tests-experimental" % "@version@" @crossString@
|
"com.typesafe.akka" %% "akka-multi-node-testkit" % "@version@" @crossString@
|
||||||
|
|
||||||
If you are using the latest nightly build you should pick a timestamped Akka version from
|
If you are using the latest nightly build you should pick a timestamped Akka version from
|
||||||
`<http://repo.typesafe.com/typesafe/snapshots/com/typesafe/akka/akka-remote-tests-experimental_@binVersion@/>`_.
|
`<http://repo.typesafe.com/typesafe/snapshots/com/typesafe/akka/akka-multi-node-testkit_@binVersion@/>`_.
|
||||||
We recommend against using ``SNAPSHOT`` in order to obtain stable builds.
|
We recommend against using ``SNAPSHOT`` in order to obtain stable builds.
|
||||||
|
|
||||||
A Multi Node Testing Example
|
A Multi Node Testing Example
|
||||||
|
|
|
||||||
|
|
@ -31,16 +31,55 @@ Modules
|
||||||
|
|
||||||
Akka is very modular and consists of several JARs containing different features.
|
Akka is very modular and consists of several JARs containing different features.
|
||||||
|
|
||||||
- ``akka-actor`` -- Classic Actors, Typed Actors, IO Actor etc.
|
- ``akka-actor`` – Classic Actors, Typed Actors, IO Actor etc.
|
||||||
- ``akka-remote`` -- Remote Actors
|
|
||||||
- ``akka-testkit`` -- Toolkit for testing Actor systems
|
- ``akka-agent`` – Agents, integrated with Scala STM
|
||||||
- ``akka-kernel`` -- Akka microkernel for running a bare-bones mini application server
|
|
||||||
- ``akka-transactor`` -- Transactors - transactional actors, integrated with Scala STM
|
- ``akka-camel`` – Apache Camel integration
|
||||||
- ``akka-agent`` -- Agents, integrated with Scala STM
|
|
||||||
- ``akka-camel`` -- Apache Camel integration
|
- ``akka-dataflow`` – add-on to SIP-14 futures supporting implicit
|
||||||
- ``akka-zeromq`` -- ZeroMQ integration
|
continuation-passing style
|
||||||
- ``akka-slf4j`` -- SLF4J Logger (event bus listener)
|
|
||||||
- ``akka-filebased-mailbox`` -- Akka durable mailbox (find more among community projects)
|
- ``akka-file-mailbox`` – Akka durable mailbox (find more among community
|
||||||
|
projects)
|
||||||
|
|
||||||
|
- ``akka-kernel`` – Akka microkernel for running a bare-bones mini application
|
||||||
|
server
|
||||||
|
|
||||||
|
- ``akka-mailboxes-common`` – common infrastructure for implementing durable
|
||||||
|
mailboxes
|
||||||
|
|
||||||
|
- ``akka-osgi`` – base bundle for using Akka in OSGi containers, containing the
|
||||||
|
``akka-actor`` classes
|
||||||
|
|
||||||
|
- ``akka-osgi-aries`` – Aries blueprint for provisioning actor systems
|
||||||
|
|
||||||
|
- ``akka-remote`` – Remote Actors
|
||||||
|
|
||||||
|
- ``akka-slf4j`` – SLF4J Logger (event bus listener)
|
||||||
|
|
||||||
|
- ``akka-testkit`` – Toolkit for testing Actor systems
|
||||||
|
|
||||||
|
- ``akka-transactor`` – Transactors - transactional actors, integrated with
|
||||||
|
Scala STM
|
||||||
|
|
||||||
|
- ``akka-zeromq`` – ZeroMQ integration
|
||||||
|
|
||||||
|
In addition to these stable modules there are several which are on their way
|
||||||
|
into the stable core but are still marked “experimental” at this point. This
|
||||||
|
does not mean that they do not function as intended, it primarily means that
|
||||||
|
their API has not yet solidified enough in order to be considered frozen. You
|
||||||
|
can help accelerating this process by giving feedback on these modules on our
|
||||||
|
mailing list.
|
||||||
|
|
||||||
|
- ``akka-channels-experimental`` – Typed Channels on top of untyped Actors,
|
||||||
|
using Scala 2.10 macros
|
||||||
|
|
||||||
|
- ``akka-cluster-experimental`` – Cluster membership management, leader
|
||||||
|
election, elastic routers.
|
||||||
|
|
||||||
|
- ``akka-contrib`` – an assortment of contributions which may or may not be
|
||||||
|
moved into core modules, see :ref:`akka-contrib` for more details.
|
||||||
|
|
||||||
The filename of the actual JAR is for example ``@jarName@`` (and analog for
|
The filename of the actual JAR is for example ``@jarName@`` (and analog for
|
||||||
the other modules).
|
the other modules).
|
||||||
|
|
|
||||||
|
|
@ -362,13 +362,18 @@ It is possible to listen to events that occur in Akka Remote, and to subscribe/u
|
||||||
you simply register as listener to the below described types in on the ``ActorSystem.eventStream``.
|
you simply register as listener to the below described types in on the ``ActorSystem.eventStream``.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
To subscribe to any remote event, subscribe to :meth:``RemotingLifecycleEvent`
|
|
||||||
To subscribe to events related only to the lifecycle of associations, subscribe to :meth:`akka.remote.AssociationEvent`
|
To subscribe to any remote event, subscribe to
|
||||||
|
:meth:`RemotingLifecycleEvent`. To subscribe to events related only to the
|
||||||
|
lifecycle of associations, subscribe to
|
||||||
|
:meth:`akka.remote.AssociationEvent`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
The use of term "Association" instead of "Connection" reflects that the remoting subsystem may use
|
|
||||||
connectionless transports, but an association similar to transport layer connections is maintained between endpoints
|
The use of term "Association" instead of "Connection" reflects that the
|
||||||
by the Akka protocol.
|
remoting subsystem may use connectionless transports, but an association
|
||||||
|
similar to transport layer connections is maintained between endpoints by
|
||||||
|
the Akka protocol.
|
||||||
|
|
||||||
By default an event listener is registered which logs all of the events
|
By default an event listener is registered which logs all of the events
|
||||||
described below. This default was chosen to help setting up a system, but it is
|
described below. This default was chosen to help setting up a system, but it is
|
||||||
|
|
@ -376,6 +381,7 @@ quite common to switch this logging off once that phase of the project is
|
||||||
finished.
|
finished.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
In order to switch off the logging, set
|
In order to switch off the logging, set
|
||||||
``akka.remote.log-remote-lifecycle-events = off`` in your
|
``akka.remote.log-remote-lifecycle-events = off`` in your
|
||||||
``application.conf``.
|
``application.conf``.
|
||||||
|
|
|
||||||
|
|
@ -363,13 +363,18 @@ It is possible to listen to events that occur in Akka Remote, and to subscribe/u
|
||||||
you simply register as listener to the below described types in on the ``ActorSystem.eventStream``.
|
you simply register as listener to the below described types in on the ``ActorSystem.eventStream``.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
To subscribe to any remote event, subscribe to :meth:``RemotingLifecycleEvent`
|
|
||||||
To subscribe to events related only to the lifecycle of associations, subscribe to :meth:`akka.remote.AssociationEvent`
|
To subscribe to any remote event, subscribe to
|
||||||
|
:meth:`RemotingLifecycleEvent`. To subscribe to events related only to
|
||||||
|
the lifecycle of associations, subscribe to
|
||||||
|
:meth:`akka.remote.AssociationEvent`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
The use of term "Association" instead of "Connection" reflects that the remoting subsystem may use
|
|
||||||
connectionless transports, but an association similar to transport layer connections is maintained between endpoints
|
The use of term "Association" instead of "Connection" reflects that the
|
||||||
by the Akka protocol.
|
remoting subsystem may use connectionless transports, but an association
|
||||||
|
similar to transport layer connections is maintained between endpoints by
|
||||||
|
the Akka protocol.
|
||||||
|
|
||||||
By default an event listener is registered which logs all of the events
|
By default an event listener is registered which logs all of the events
|
||||||
described below. This default was chosen to help setting up a system, but it is
|
described below. This default was chosen to help setting up a system, but it is
|
||||||
|
|
@ -377,6 +382,7 @@ quite common to switch this logging off once that phase of the project is
|
||||||
finished.
|
finished.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
In order to switch off the logging, set
|
In order to switch off the logging, set
|
||||||
``akka.remote.log-remote-lifecycle-events = off`` in your
|
``akka.remote.log-remote-lifecycle-events = off`` in your
|
||||||
``application.conf``.
|
``application.conf``.
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,9 @@ object AkkaBuild extends Build {
|
||||||
id = "akka-dataflow",
|
id = "akka-dataflow",
|
||||||
base = file("akka-dataflow"),
|
base = file("akka-dataflow"),
|
||||||
dependencies = Seq(testkit % "test->test"),
|
dependencies = Seq(testkit % "test->test"),
|
||||||
settings = defaultSettings ++ scaladocSettings ++ OSGi.dataflow ++ cpsPlugin
|
settings = defaultSettings ++ scaladocSettings ++ OSGi.dataflow ++ cpsPlugin ++ Seq(
|
||||||
|
previousArtifact := akkaPreviousArtifact("akka-dataflow")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val testkit = Project(
|
lazy val testkit = Project(
|
||||||
|
|
@ -118,6 +120,7 @@ object AkkaBuild extends Build {
|
||||||
dependencies = Seq(testkit % "compile;test->test"),
|
dependencies = Seq(testkit % "compile;test->test"),
|
||||||
settings = defaultSettings ++ scaladocSettings ++ Seq(
|
settings = defaultSettings ++ scaladocSettings ++ Seq(
|
||||||
autoCompilerPlugins := true,
|
autoCompilerPlugins := true,
|
||||||
|
publishArtifact in Compile := false,
|
||||||
libraryDependencies ++= Dependencies.actorTests
|
libraryDependencies ++= Dependencies.actorTests
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -129,15 +132,25 @@ object AkkaBuild extends Build {
|
||||||
settings = defaultSettings ++ scaladocSettings ++ OSGi.remote ++ Seq(
|
settings = defaultSettings ++ scaladocSettings ++ OSGi.remote ++ Seq(
|
||||||
libraryDependencies ++= Dependencies.remote,
|
libraryDependencies ++= Dependencies.remote,
|
||||||
// disable parallel tests
|
// disable parallel tests
|
||||||
parallelExecution in Test := false
|
parallelExecution in Test := false,
|
||||||
|
previousArtifact := akkaPreviousArtifact("akka-remote")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val multiNodeTests = Project(
|
||||||
|
id = "akka-multi-node-testkit",
|
||||||
|
base = file("akka-multi-node-testkit"),
|
||||||
|
dependencies = Seq(remote, testkit),
|
||||||
|
settings = defaultSettings ++ scaladocSettings ++ Seq(
|
||||||
|
previousArtifact := akkaPreviousArtifact("akka-multi-node-testkit")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val remoteTests = Project(
|
lazy val remoteTests = Project(
|
||||||
id = "akka-remote-tests-experimental",
|
id = "akka-remote-tests",
|
||||||
base = file("akka-remote-tests"),
|
base = file("akka-remote-tests"),
|
||||||
dependencies = Seq(remote, actorTests % "test->test", testkit),
|
dependencies = Seq(actorTests % "test->test", multiNodeTests),
|
||||||
settings = defaultSettings ++ scaladocSettings ++ multiJvmSettings ++ experimentalSettings ++ Seq(
|
settings = defaultSettings ++ scaladocSettings ++ multiJvmSettings ++ Seq(
|
||||||
libraryDependencies ++= Dependencies.remoteTests,
|
libraryDependencies ++= Dependencies.remoteTests,
|
||||||
// disable parallel tests
|
// disable parallel tests
|
||||||
parallelExecution in Test := false,
|
parallelExecution in Test := false,
|
||||||
|
|
@ -145,7 +158,8 @@ object AkkaBuild extends Build {
|
||||||
(name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq
|
(name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq
|
||||||
},
|
},
|
||||||
scalatestOptions in MultiJvm := defaultMultiJvmScalatestOptions,
|
scalatestOptions in MultiJvm := defaultMultiJvmScalatestOptions,
|
||||||
previousArtifact := akkaPreviousArtifact("akka-remote")
|
publishArtifact in Compile := false,
|
||||||
|
previousArtifact := akkaPreviousArtifact("akka-remote-tests")
|
||||||
)
|
)
|
||||||
) configs (MultiJvm)
|
) configs (MultiJvm)
|
||||||
|
|
||||||
|
|
@ -161,7 +175,7 @@ object AkkaBuild extends Build {
|
||||||
(name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq
|
(name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq
|
||||||
},
|
},
|
||||||
scalatestOptions in MultiJvm := defaultMultiJvmScalatestOptions,
|
scalatestOptions in MultiJvm := defaultMultiJvmScalatestOptions,
|
||||||
previousArtifact := akkaPreviousArtifact("akka-remote")
|
previousArtifact := akkaPreviousArtifact("akka-cluster-experimental")
|
||||||
)
|
)
|
||||||
) configs (MultiJvm)
|
) configs (MultiJvm)
|
||||||
|
|
||||||
|
|
@ -170,7 +184,8 @@ object AkkaBuild extends Build {
|
||||||
base = file("akka-slf4j"),
|
base = file("akka-slf4j"),
|
||||||
dependencies = Seq(actor, testkit % "test->test"),
|
dependencies = Seq(actor, testkit % "test->test"),
|
||||||
settings = defaultSettings ++ scaladocSettings ++ OSGi.slf4j ++ Seq(
|
settings = defaultSettings ++ scaladocSettings ++ OSGi.slf4j ++ Seq(
|
||||||
libraryDependencies ++= Dependencies.slf4j
|
libraryDependencies ++= Dependencies.slf4j,
|
||||||
|
previousArtifact := akkaPreviousArtifact("akka-slf4j")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -412,6 +427,7 @@ object AkkaBuild extends Build {
|
||||||
enableOutput in generateEpub in Sphinx := true,
|
enableOutput in generateEpub in Sphinx := true,
|
||||||
unmanagedSourceDirectories in Test <<= sourceDirectory in Sphinx apply { _ ** "code" get },
|
unmanagedSourceDirectories in Test <<= sourceDirectory in Sphinx apply { _ ** "code" get },
|
||||||
libraryDependencies ++= Dependencies.docs,
|
libraryDependencies ++= Dependencies.docs,
|
||||||
|
publishArtifact in Compile := false,
|
||||||
unmanagedSourceDirectories in ScalariformKeys.format in Test <<= unmanagedSourceDirectories in Test,
|
unmanagedSourceDirectories in ScalariformKeys.format in Test <<= unmanagedSourceDirectories in Test,
|
||||||
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
|
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
|
||||||
)
|
)
|
||||||
|
|
@ -451,6 +467,7 @@ object AkkaBuild extends Build {
|
||||||
base = file("akka-channels-tests"),
|
base = file("akka-channels-tests"),
|
||||||
dependencies = Seq(channels, testkit % "compile;test->test"),
|
dependencies = Seq(channels, testkit % "compile;test->test"),
|
||||||
settings = defaultSettings ++ experimentalSettings ++ Seq(
|
settings = defaultSettings ++ experimentalSettings ++ Seq(
|
||||||
|
publishArtifact in Compile := false,
|
||||||
libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-compiler" % _)
|
libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-compiler" % _)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -22,4 +22,4 @@
|
||||||
# check for an sbt command
|
# check for an sbt command
|
||||||
type -P sbt &> /dev/null || fail "sbt command not found"
|
type -P sbt &> /dev/null || fail "sbt command not found"
|
||||||
|
|
||||||
sbt "project akka-remote-tests-experimental" "test:run-main akka.remote.testkit.LogRoleReplace $1 $2"
|
sbt "project akka-remote-tests" "test:run-main akka.remote.testkit.LogRoleReplace $1 $2"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue