Updated samples and tutorial to Akka 2.0. Added projects to SBT project file. Fixes #1278
This commit is contained in:
parent
c0d3c523e2
commit
823a68ac0f
33 changed files with 1291 additions and 1209 deletions
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.tutorial.first.scala
|
||||
|
||||
import org.junit.runner.RunWith
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
import org.scalatest.WordSpec
|
||||
import akka.testkit.TestActorRef
|
||||
import akka.tutorial.first.scala.Pi.Worker
|
||||
import akka.actor.ActorSystem
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class WorkerSpec extends WordSpec with MustMatchers {
|
||||
|
||||
implicit def system = ActorSystem()
|
||||
|
||||
"Worker" must {
|
||||
"calculate pi correctly" in {
|
||||
val testActor = TestActorRef[Worker]
|
||||
val actor = testActor.underlyingActor
|
||||
actor.calculatePiFor(0, 0) must equal(0.0)
|
||||
actor.calculatePiFor(1, 1) must equal(-1.3333333333333333)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue