From 31db13a99c97f7e429666a88cd6f55ee5f56a100 Mon Sep 17 00:00:00 2001 From: Kirill Yankov Date: Fri, 10 Nov 2017 16:16:35 +0300 Subject: [PATCH] Multi-jvm testing docs improved #23954 (#23957) * multi-jvm testing docs improved #23954 --- .../src/main/paradox/multi-jvm-testing.md | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/akka-docs/src/main/paradox/multi-jvm-testing.md b/akka-docs/src/main/paradox/multi-jvm-testing.md index b44151416d..a67fdab958 100644 --- a/akka-docs/src/main/paradox/multi-jvm-testing.md +++ b/akka-docs/src/main/paradox/multi-jvm-testing.md @@ -6,21 +6,24 @@ Useful for integration testing where multiple systems communicate with each othe ## Setup The multi-JVM testing is an sbt plugin that you can find at [https://github.com/sbt/sbt-multi-jvm](https://github.com/sbt/sbt-multi-jvm). +To configure it in your project you should do the following steps: -You can add it as a plugin by adding the following to your project/plugins.sbt: +1. Add it as a plugin by adding the following to your project/plugins.sbt: -@@snip [plugins.sbt]($akka$/project/plugins.sbt) { #sbt-multi-jvm } + @@snip [plugins.sbt]($akka$/project/plugins.sbt) { #sbt-multi-jvm } -You can then add multi-JVM testing to `build.sbt` or `project/Build.scala` by including the `MultiJvm` -settings and config. Please note that MultiJvm test sources are located in `src/multi-jvm/...`, +2. Add multi-JVM testing to `build.sbt` or `project/Build.scala` by enabling `MultiJvmPlugin` and +setting the `MultiJvm` config. + + ```none + lazy val root = (project in file(".")) + .enablePlugins(MultiJvmPlugin) + .configs(MultiJvm) + ``` + +**Please note** that by default MultiJvm test sources are located in `src/multi-jvm/...`, and not in `src/test/...`. -You can specify JVM options for the forked JVMs: - -``` -jvmOptions in MultiJvm := Seq("-Xmx256M") -``` - Here is an example of a @extref[sample project](samples:akka-sample-multi-node-scala) that uses the `sbt-multi-jvm` plugin. ## Running tests @@ -113,6 +116,12 @@ spawned, one for each node. It will look like this: ## Changing Defaults +You can specify JVM options for the forked JVMs: + +``` +jvmOptions in MultiJvm := Seq("-Xmx256M") +``` + You can change the name of the multi-JVM test source directory by adding the following configuration to your project: