#2292 - Removing akka.util.Duration etc and replace it with scala.concurrent.util.Duration
This commit is contained in:
parent
4f1caeefd4
commit
54a3a44bf8
200 changed files with 347 additions and 854 deletions
|
|
@ -8,6 +8,7 @@ import org.specs2.specification.{ Step, Scope }
|
|||
|
||||
import akka.actor.{ Props, ActorSystem, Actor }
|
||||
import akka.testkit.{ TestKit, ImplicitSender }
|
||||
import scala.concurrent.util.{ FiniteDuration, Duration }
|
||||
|
||||
class Specs2DemoAcceptance extends Specification {
|
||||
def is =
|
||||
|
|
@ -22,8 +23,7 @@ class Specs2DemoAcceptance extends Specification {
|
|||
val system = ActorSystem()
|
||||
|
||||
// an alternative to mixing in NoTimeConversions
|
||||
implicit def d2d(d: org.specs2.time.Duration): akka.util.FiniteDuration =
|
||||
akka.util.Duration(d.inMilliseconds, "millis")
|
||||
implicit def d2d(d: org.specs2.time.Duration): FiniteDuration = Duration(d.inMilliseconds, "millis")
|
||||
|
||||
def e1 = new TestKit(system) with Scope with ImplicitSender {
|
||||
within(1 second) {
|
||||
|
|
@ -35,5 +35,5 @@ class Specs2DemoAcceptance extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
def e2 = ((1 second): akka.util.Duration).toMillis must be equalTo 1000
|
||||
def e2 = ((1 second): Duration).toMillis must be equalTo 1000
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import org.specs2.time.NoTimeConversions
|
|||
|
||||
import akka.actor.{ Props, ActorSystem, Actor }
|
||||
import akka.testkit.{ TestKit, ImplicitSender }
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
|
||||
class Specs2DemoUnitSpec extends Specification with NoTimeConversions {
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import akka.actor.Props
|
|||
import akka.testkit.DefaultTimeout
|
||||
import akka.testkit.ImplicitSender
|
||||
import akka.testkit.TestKit
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
|
||||
/**
|
||||
* a Test to show some TestKit examples
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import language.postfixOps
|
|||
|
||||
//#imports-test-probe
|
||||
import akka.testkit.TestProbe
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
import akka.actor._
|
||||
import akka.dispatch.Futures
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
//#test-fsm-ref
|
||||
import akka.testkit.TestFSMRef
|
||||
import akka.actor.FSM
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
|
||||
val fsm = TestFSMRef(new Actor with FSM[Int, String] {
|
||||
startWith(1, "")
|
||||
|
|
@ -121,7 +121,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
|
||||
//#test-behavior
|
||||
import akka.testkit.TestActorRef
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.pattern.ask
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
type Worker = MyActor
|
||||
//#test-within
|
||||
import akka.actor.Props
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
|
||||
val worker = system.actorOf(Props[Worker])
|
||||
within(200 millis) {
|
||||
|
|
@ -173,7 +173,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
|
||||
"demonstrate dilated duration" in {
|
||||
//#duration-dilation
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
import akka.testkit._
|
||||
10.milliseconds.dilated
|
||||
//#duration-dilation
|
||||
|
|
@ -206,7 +206,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
|
||||
"demonstrate probe reply" in {
|
||||
import akka.testkit.TestProbe
|
||||
import akka.util.duration._
|
||||
import scala.concurrent.util.duration._
|
||||
import akka.pattern.ask
|
||||
//#test-probe-reply
|
||||
val probe = TestProbe()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue