removed some deprecation warnings from akka-contrib
This commit is contained in:
parent
3e8597d94b
commit
3ffabf00ec
5 changed files with 14 additions and 14 deletions
|
|
@ -46,8 +46,8 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
}
|
||||
}))
|
||||
// The throttler for this example, setting the rate
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(
|
||||
3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler],
|
||||
3 msgsPer (1.second.dilated)))
|
||||
// Set the target
|
||||
throttler ! SetTarget(Some(printer))
|
||||
// These three messages will be sent to the echoer immediately
|
||||
|
|
@ -62,7 +62,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"keep messages until a target is set" in {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
1 to 6 foreach { throttler ! _ }
|
||||
expectNoMsg(1 second)
|
||||
throttler ! SetTarget(Some(echo))
|
||||
|
|
@ -73,7 +73,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"send messages after a `SetTarget(None)` pause" in {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 3 foreach { throttler ! _ }
|
||||
throttler ! SetTarget(None)
|
||||
|
|
@ -91,7 +91,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"keep messages when the target is set to None" in {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 7 foreach { throttler ! _ }
|
||||
throttler ! SetTarget(None)
|
||||
|
|
@ -108,7 +108,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"respect the rate (3 msg/s)" in within(1.5 seconds, 2.5 seconds) {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 7 foreach { throttler ! _ }
|
||||
1 to 7 foreach { expectMsg(_) }
|
||||
|
|
@ -116,7 +116,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"respect the rate (4 msg/s)" in within(1.5 seconds, 2.5 seconds) {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(4 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 4 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 9 foreach { throttler ! _ }
|
||||
1 to 9 foreach { expectMsg(_) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue