I'm trying to compile and run a Multi-JVM test I've written but trying to 
compile the test results in import errors for various akka.* packages that 
are on my classpath in the "runtime" and "test" configurations but don't 
seem to be included in my "multi-jvm" configuration. 

I've resorted (more-or-less) to copy-paste of the sample build.sbt in the 
docs found 
here: http://doc.akka.io/docs/akka/snapshot/dev/multi-jvm-testing.html  but 
still cannot get the basic test I've written to compile.

My build.sbt: 

import com.typesafe.sbt.SbtMultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm

val akkaVersion = "2.3.9"
val sprayVersion = "1.3.3"

lazy val project = Project(
  id = "akka-sample-multi-node-scala",
  base = file("."),
  settings = Project.defaultSettings ++ SbtMultiJvm.multiJvmSettings ++ Seq(
    name := "akka-sample-multi-node-scala",
    version := "2.3.9",
    scalaVersion := "2.11.5",
    libraryDependencies ++= Seq(
      "io.spray" %% "spray-can" % sprayVersion,
      "io.spray" %% "spray-routing" % sprayVersion,
      "io.spray" %% "spray-client" % sprayVersion,
      "io.spray" %% "spray-json" % "1.3.1",
      "com.typesafe" % "config" % "1.2.1",

      "com.playi" % "picommon-scala" % "15.04-SNAPSHOT",
      "ch.qos.logback" % "logback-classic" % "1.1.2",
      "org.json4s" %% "json4s-native" % "3.2.11",


      "com.typesafe.akka" %% "akka-actor" % akkaVersion,
      "com.typesafe.akka" %% "akka-remote" % akkaVersion,
      "com.typesafe.akka" %% "akka-cluster" % akkaVersion,
      "com.typesafe.akka" %% "akka-contrib" % akkaVersion,
      "com.typesafe.akka" %% "akka-persistence-experimental" % akkaVersion,
      "com.typesafe.akka" %% "akka-multi-node-testkit" % akkaVersion,
      "org.scalatest" %% "scalatest" % "2.2.1" % "test",
      "io.spray" %% "spray-testkit" % sprayVersion % "test",
      "com.typesafe.akka" %% "akka-multi-node-testkit" % akkaVersion),

    // Uncommenting the line below doesn't seem to solve the issue
    //libraryDependencies in MultiJvm <<= (libraryDependencies in Test),

    updateOptions := 
updateOptions.value.withCachedResolution(cachedResoluton = true),

    // make sure that MultiJvm test are compiled by the default test 
compilation
    compile in MultiJvm <<= (compile in MultiJvm) triggeredBy (compile in 
Test),
    // disable parallel tests
    parallelExecution in Test := false,
    // make sure that MultiJvm tests are executed by the default test 
target, 
    // and combine the results from ordinary test and multi-jvm tests
    executeTests in Test <<= (executeTests in Test, executeTests in 
MultiJvm) map {
      case (testResults, multiNodeResults)  =>
        val overall =
          if (testResults.overall.id < multiNodeResults.overall.id)
            multiNodeResults.overall
          else
            testResults.overall
        Tests.Output(overall,
          testResults.events ++ multiNodeResults.events,
          testResults.summaries ++ multiNodeResults.summaries)
    }
  )
).configs(MultiJvm)

and in "project/plugins.sbt" I have:

resolvers += Classpaths.typesafeResolver
resolvers += "spray repo" at "http://repo.spray.io";
addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.8")    




Running: `sbt multi-jvm:test` results in a list of errors that are similar 
to:

[info] Compiling 1 Scala source to 
.../akka-test-project/target/scala-2.11/multi-jvm-classes...

[error] 
.../akka-test-project/src/multi-jvm/scala/w2/referrals/ClusterSpec.scala:7: 
object remote is not a member of

 package akka

[error] import akka.remote.testkit.{MultiNodeSpec, MultiNodeConfig}

[error]             ^

[error] 
.../akka-test-project/src/multi-jvm/scala/w2/referrals/ClusterSpec.scala:8: 
object remote is not a member of

 package akka

[error] import akka.remote.testconductor.RoleName

[error]             ^

[error] 
.../akka-test-project/src/multi-jvm/scala/w2/referrals/ClusterSpec.scala:9: 
object cluster is not a member o

f package akka

[error] import akka.cluster.Cluster

[error]             ^

[error] 
.../akka-test-project/src/multi-jvm/scala/w2/referrals/ClusterSpec.scala:10: 
object testkit is not a member 

of package akka

[error] import akka.testkit.ImplicitSender

[error] 
.../akka-test-project/src/multi-jvm/scala/w2/referrals/ClusterSpec.scala:13: 
object scalatest is not a membe

r of package org

[error] import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}


As you can see from my build.sbt, the imports in question should all be on 
my classpath. One interesting thing is that executing
sbt multi-jvm:libraryDependencies

shows that the dependencies list was built correctly:

[info] List(org.scala-lang:scala-library:2.11.5, 
org.scala-lang:scala-library:2.11.5, io.spray:spray-can:1.3.3, 
io.spray:spray-routing:1.3.3, io.spray:spray-client:1.3.3, 
io.spray:spray-json:1.3.1, com.typesafe:config:1.2.1, 
com.playi:picommon-scala:15.04-SNAPSHOT, 
ch.qos.logback:logback-classic:1.1.2, org.json4s:json4s-native:3.2.11, 
com.typesafe.akka:akka-actor:2.3.9, com.typesafe.akka:akka-remote:2.3.9, 
com.typesafe.akka:akka-cluster:2.3.9, com.typesafe.akka:akka-contrib:2.3.9, 
com.typesafe.akka:akka-persistence-experimental:2.3.9, 
com.typesafe.akka:akka-multi-node-testkit:2.3.9, 
org.scalatest:scalatest:2.2.1:test, io.spray:spray-testkit:1.3.3:test, 
com.typesafe.akka:akka-multi-node-testkit:2.3.9)

> 

My scala version: 2.11.6
      sbt-version: 0.13.7

In my searching, I haven't been able to find anyone else experiencing this 
problem. 

Any help appreciated.


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to