pekko/akka-testkit/src/test/scala/akka/testkit/CallingThreadDispatcherModelSpec.scala
Roland Kuhn 06049642d5 Merge branch 'wip-CallingThreadDispatcher'
Conflicts:
	akka-actor/src/test/scala/akka/dispatch/ActorModelSpec.scala
	project/build/AkkaProject.scala
both resolved by "union" approach

- change wavesOfActors test for CTD: scheduling SHUTDOWN 10000 times does not
  work so well...
- add executeFuture with trivial implementation, TBC
2011-03-17 22:18:39 +01:00

32 lines
995 B
Scala

package akka.testkit
import akka.actor.dispatch.ActorModelSpec
import java.util.concurrent.CountDownLatch
class CallingThreadDispatcherModelSpec extends ActorModelSpec {
import ActorModelSpec._
def newInterceptedDispatcher = new CallingThreadDispatcher with MessageDispatcherInterceptor
override def dispatcherShouldProcessMessagesInParallel {}
override def dispatcherShouldHandleWavesOfActors {
implicit val dispatcher = newInterceptedDispatcher
def flood(num: Int) {
val cachedMessage = CountDownNStop(new CountDownLatch(num))
val keeper = newTestActor.start
(1 to num) foreach {
_ => newTestActor.start ! cachedMessage
}
keeper.stop
assertCountDown(cachedMessage.latch,10000, "Should process " + num + " countdowns")
}
for(run <- 1 to 3) {
flood(10000)
await(dispatcher.stops.get == run)(withinMs = 10000)
assertDispatcher(dispatcher)(starts = run, stops = run)
}
}
}
// vim: set ts=4 sw=4 et: