Adding a test for ticket 703
This commit is contained in:
parent
8256672ad3
commit
ec42d71e69
1 changed files with 34 additions and 0 deletions
34
akka-actor/src/test/scala/akka/ticket/Ticket703Spec.scala
Normal file
34
akka-actor/src/test/scala/akka/ticket/Ticket703Spec.scala
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package akka.ticket
|
||||
|
||||
import akka.actor.Actor._
|
||||
import akka.actor._
|
||||
import akka.routing._
|
||||
import org.scalatest.WordSpec
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
|
||||
class Ticket703Spec extends WordSpec with MustMatchers {
|
||||
|
||||
"A !!! call to an actor pool" should {
|
||||
"reuse the proper timeout" in {
|
||||
val actorPool = actorOf(
|
||||
new Actor with DefaultActorPool with BoundedCapacityStrategy with MailboxPressureCapacitor with SmallestMailboxSelector with BasicNoBackoffFilter {
|
||||
def lowerBound = 2
|
||||
def upperBound = 20
|
||||
def rampupRate = 0.1
|
||||
def partialFill = true
|
||||
def selectionCount = 1
|
||||
def instance = factory
|
||||
def receive = _route
|
||||
def pressureThreshold = 1
|
||||
def factory = actorOf(new Actor {
|
||||
def receive = {
|
||||
case req: String =>
|
||||
Thread.sleep(6000L)
|
||||
self.reply_?("Response")
|
||||
}
|
||||
})
|
||||
}).start
|
||||
(actorPool.!!).await.result must be === Some("Response")
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue