make akka-actor-tests compile again
This commit is contained in:
parent
1e1409e796
commit
93b1ef3703
67 changed files with 1576 additions and 1813 deletions
|
|
@ -8,39 +8,39 @@ import java.util.concurrent.CountDownLatch
|
|||
import org.junit.{ After, Test }
|
||||
|
||||
class CallingThreadDispatcherModelSpec extends ActorModelSpec {
|
||||
import ActorModelSpec._
|
||||
def newInterceptedDispatcher = new CallingThreadDispatcher with MessageDispatcherInterceptor
|
||||
def dispatcherType = "Calling Thread Dispatcher"
|
||||
|
||||
// A CallingThreadDispatcher can by design not process messages in parallel,
|
||||
// so disable this test
|
||||
override def dispatcherShouldProcessMessagesInParallel {}
|
||||
//override def dispatcherShouldProcessMessagesInParallel {}
|
||||
|
||||
// This test needs to be adapted: CTD runs the flood completely sequentially
|
||||
// with start, invocation, stop, schedule shutdown, abort shutdown, repeat;
|
||||
// add "keeper" actor to lock down the dispatcher instance, since the
|
||||
// frequent attempted shutdown seems rather costly (random timing failures
|
||||
// without this fix)
|
||||
override def dispatcherShouldHandleWavesOfActors {
|
||||
implicit val dispatcher = newInterceptedDispatcher
|
||||
// override def dispatcherShouldHandleWavesOfActors {
|
||||
// implicit val dispatcher = newInterceptedDispatcher
|
||||
//
|
||||
// def flood(num: Int) {
|
||||
// val cachedMessage = CountDownNStop(new CountDownLatch(num))
|
||||
// val keeper = newTestActor
|
||||
// (1 to num) foreach { _ ⇒
|
||||
// newTestActor ! cachedMessage
|
||||
// }
|
||||
// keeper.stop()
|
||||
// assertCountDown(cachedMessage.latch, 10000, "Should process " + num + " countdowns")
|
||||
// }
|
||||
// for (run ← 1 to 3) {
|
||||
// flood(10000)
|
||||
// assertDispatcher(dispatcher)(starts = run, stops = run)
|
||||
// }
|
||||
// }
|
||||
|
||||
def flood(num: Int) {
|
||||
val cachedMessage = CountDownNStop(new CountDownLatch(num))
|
||||
val keeper = newTestActor
|
||||
(1 to num) foreach { _ ⇒
|
||||
newTestActor ! cachedMessage
|
||||
}
|
||||
keeper.stop()
|
||||
assertCountDown(cachedMessage.latch, 10000, "Should process " + num + " countdowns")
|
||||
}
|
||||
for (run ← 1 to 3) {
|
||||
flood(10000)
|
||||
assertDispatcher(dispatcher)(starts = run, stops = run)
|
||||
}
|
||||
}
|
||||
|
||||
override def dispatcherShouldCompleteAllUncompletedSenderFuturesOnDeregister {
|
||||
//Can't handle this...
|
||||
}
|
||||
//override def dispatcherShouldCompleteAllUncompletedSenderFuturesOnDeregister {
|
||||
//Can't handle this...
|
||||
//}
|
||||
|
||||
@After
|
||||
def after {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue