2014-05-11 1 views
0

테스트하고 싶은 간단한 스칼라 애플리케이션 (taken from here)이 있습니다. 전체 프로젝트가 SBT가 포함 된으로 성공적으로 컴파일됩니다. 내 버전 중 일부는 호환되지 않는다는 인상을 얻을하지만 그건 단지 추측, 인터넷 검색에서스칼라 액터의 java.util.NoSuchMethodError

Could not run test ConnectionTest:java.lang.NoSuchMethodError: akka.actor.Props$.apply(Lscala/Function0;)Lakka/actor/Props; 

: 나는 sbt test으로 테스트를 시작할 때, 나는 다음과 같은 오류 메시지가 나타납니다. 무엇이 잘못되었을 수 있습니까?

[테스트 케이스]

import akka.actor.{Props, Actor, ActorSystem, ActorRef} 
import akka.testkit.{TestKit, TestActorRef, ImplicitSender} 
import org.scalatest.{WordSpecLike, BeforeAndAfterAll} 
import org.scalatest.matchers.MustMatchers 

class ConnectionTest extends TestKit(ActorSystem("ConnectionSpec")) 
    with WordSpecLike 
    with MustMatchers 
    with BeforeAndAfterAll { 

    override def afterAll() { system.shutdown() } 

    "Server" must { 
    "bind to port " in { 
     // create server 
     val server = system.actorOf(Props[Server], name = "server") 

     expectMsg("Bound to /127.0.0.1:8888") 
    }  
    } 
} 

는 [build.sbt]

name := "MyApp" 

version := "0.2" 

scalaVersion := "2.10.4" 

mainClass := Some("akka.Main") 

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" 

libraryDependencies += 
"com.typesafe.akka" %% "akka-actor" % "2.3.2" 

libraryDependencies += 
"com.typesafe.akka" %% "akka-testkit" % "2.1.4" % "test" 

libraryDependencies += 
"org.scalatest" % "scalatest_2.10" % "2.0" % "test" 

답변

3

당신은 testkit에 대한 Akka의 동일한 버전을 사용해야합니다.

libraryDependencies += 
"com.typesafe.akka" %% "akka-testkit" % "2.1.4" % "test" 

libraryDependencies += 
"com.typesafe.akka" %% "akka-testkit" % "2.3.2" % "test" 
+0

큰해야합니다, 감사합니다, 그것을 작동합니다! – Finnfalter