Merge branch 'master' of git@github.com:jboner/akka

This commit is contained in:
Debasish Ghosh 2010-04-02 16:50:23 +05:30
commit c110b86b5c
10 changed files with 20 additions and 37 deletions

View file

@ -48,8 +48,7 @@ class ActorFireForgetRequestReplyTest extends JUnitSuite {
val senderActor = new SenderActor(replyActor)
senderActor.start
senderActor ! "Init"
state.finished.await(1, TimeUnit.SECONDS)
assert(0 === state.finished.getCount)
assert(state.finished.await(1, TimeUnit.SECONDS))
assert("Reply" === state.s)
}
@ -62,8 +61,7 @@ class ActorFireForgetRequestReplyTest extends JUnitSuite {
val senderActor = new SenderActor(replyActor)
senderActor.start
senderActor ! "InitImplicit"
state.finished.await(1, TimeUnit.SECONDS)
assert(0 === state.finished.getCount)
assert(state.finished.await(1, TimeUnit.SECONDS))
assert("ReplyImplicit" === state.s)
}
}

View file

@ -1,5 +1,6 @@
package se.scalablesolutions.akka.actor
import _root_.java.util.concurrent.TimeUnit
import se.scalablesolutions.akka.actor.Actor.transactor
import se.scalablesolutions.akka.stm.Transaction.atomic
import se.scalablesolutions.akka.util.Logging
@ -80,7 +81,7 @@ with ActorTestUtil with Logging {
}
}
tx ! Go
latch.await // FIXME should await with timeout and fail if timeout
assert(latch.await(1, TimeUnit.SECONDS))
agent.close
tx.stop
assert(true)

View file

@ -85,8 +85,7 @@ class ClientInitiatedRemoteActorTest extends JUnitSuite {
actor.makeRemote(HOSTNAME, PORT1)
actor.start
val result = actor ! "OneWay"
Global.oneWay.await(1, TimeUnit.SECONDS)
assert(0 === Global.oneWay.getCount)
assert(Global.oneWay.await(1, TimeUnit.SECONDS))
actor.stop
}
@ -111,8 +110,7 @@ class ClientInitiatedRemoteActorTest extends JUnitSuite {
sender.setReplyToAddress(HOSTNAME, PORT1)
sender.start
sender.send(actor)
Global.remoteReply.await(1, TimeUnit.SECONDS)
assert(0 === Global.remoteReply.getCount)
assert(Global.remoteReply.await(1, TimeUnit.SECONDS))
actor.stop
}

View file

@ -30,8 +30,7 @@ class ExecutorBasedEventDrivenDispatcherActorTest extends JUnitSuite {
}
actor.start
val result = actor ! "OneWay"
oneWay.await(1, TimeUnit.SECONDS)
assert(0 === oneWay.getCount)
assert(oneWay.await(1, TimeUnit.SECONDS))
actor.stop
}

View file

@ -57,8 +57,7 @@ class ForwardActorTest extends JUnitSuite {
def shouldForwardActorReferenceWhenInvokingForwardOnBang = {
val senderActor = new BangSenderActor
senderActor.start
ForwardState.finished.await(1, TimeUnit.SECONDS)
assert(0 === ForwardState.finished.getCount)
assert(ForwardState.finished.await(1, TimeUnit.SECONDS))
assert(ForwardState.sender ne null)
assert(senderActor === ForwardState.sender)
}
@ -67,7 +66,6 @@ class ForwardActorTest extends JUnitSuite {
def shouldForwardActorReferenceWhenInvokingForwardOnBangBang = {
val senderActor = new BangBangSenderActor
senderActor.start
ForwardState.finished.await(1, TimeUnit.SECONDS)
assert(0 === ForwardState.finished.getCount)
assert(ForwardState.finished.await(1, TimeUnit.SECONDS))
}
}

View file

@ -111,8 +111,7 @@ class InMemoryActorTest extends JUnitSuite {
stateful.start
stateful ! SetMapStateOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init") // set init state
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactionrequired
stateful.notifier.await(1, TimeUnit.SECONDS)
assert(0 === stateful.notifier.getCount)
assert(stateful.notifier.await(1, TimeUnit.SECONDS))
assert("new state" === (stateful !! GetMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")).get)
}
@ -133,8 +132,7 @@ class InMemoryActorTest extends JUnitSuite {
failer.start
stateful ! SetMapStateOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "init") // set init state
stateful ! FailureOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer) // call failing transactionrequired method
stateful.notifier.await(1, TimeUnit.SECONDS)
assert(0 === stateful.notifier.getCount)
assert(stateful.notifier.await(1, TimeUnit.SECONDS))
assert("init" === (stateful !! GetMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")).get) // check that state is == init state
}
@ -158,8 +156,7 @@ class InMemoryActorTest extends JUnitSuite {
stateful.start
stateful ! SetVectorStateOneWay("init") // set init state
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactionrequired
stateful.notifier.await(1, TimeUnit.SECONDS)
assert(0 === stateful.notifier.getCount)
assert(stateful.notifier.await(1, TimeUnit.SECONDS))
assert(2 === (stateful !! GetVectorSize).get)
}
@ -181,8 +178,7 @@ class InMemoryActorTest extends JUnitSuite {
val failer = new InMemFailerActor
failer.start
stateful ! FailureOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer) // call failing transactionrequired method
stateful.notifier.await(1, TimeUnit.SECONDS)
assert(0 === stateful.notifier.getCount)
assert(stateful.notifier.await(1, TimeUnit.SECONDS))
assert(1 === (stateful !! GetVectorSize).get)
}
@ -206,8 +202,7 @@ class InMemoryActorTest extends JUnitSuite {
stateful.start
stateful ! SetRefStateOneWay("init") // set init state
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactionrequired
stateful.notifier.await(1, TimeUnit.SECONDS)
assert(0 === stateful.notifier.getCount)
assert(stateful.notifier.await(1, TimeUnit.SECONDS))
assert("new state" === (stateful !! GetRefState).get)
}
@ -229,8 +224,7 @@ class InMemoryActorTest extends JUnitSuite {
val failer = new InMemFailerActor
failer.start
stateful ! FailureOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer) // call failing transactionrequired method
stateful.notifier.await(1, TimeUnit.SECONDS)
assert(0 === stateful.notifier.getCount)
assert(stateful.notifier.await(1, TimeUnit.SECONDS))
assert("init" === (stateful !! (GetRefState, 1000000)).get) // check that state is == init state
}

View file

@ -32,8 +32,7 @@ class ReactorBasedSingleThreadEventDrivenDispatcherActorTest extends JUnitSuite
}
actor.start
val result = actor ! "OneWay"
oneWay.await(1, TimeUnit.SECONDS)
assert(0 === oneWay.getCount)
assert(oneWay.await(1, TimeUnit.SECONDS))
actor.stop
}

View file

@ -30,8 +30,7 @@ class ReactorBasedThreadPoolEventDrivenDispatcherActorTest extends JUnitSuite {
}
actor.start
val result = actor ! "OneWay"
oneWay.await(1, TimeUnit.SECONDS)
assert(0 === oneWay.getCount)
assert(oneWay.await(1, TimeUnit.SECONDS))
actor.stop
}

View file

@ -91,8 +91,7 @@ class ServerInitiatedRemoteActorTest extends JUnitSuite {
5000L,
HOSTNAME, PORT)
val result = actor ! "OneWay"
Global.oneWay.await(1, TimeUnit.SECONDS)
assert(0 === Global.oneWay.getCount)
assert(Global.oneWay.await(1, TimeUnit.SECONDS))
actor.stop
}
@ -119,8 +118,7 @@ class ServerInitiatedRemoteActorTest extends JUnitSuite {
sender.setReplyToAddress(HOSTNAME, PORT)
sender.start
sender.send(actor)
Global.remoteReply.await(1, TimeUnit.SECONDS)
assert(0 === Global.remoteReply.getCount)
assert(Global.remoteReply.await(1, TimeUnit.SECONDS))
actor.stop
}

View file

@ -32,8 +32,7 @@ class ThreadBasedActorTest extends JUnitSuite {
}
actor.start
val result = actor ! "OneWay"
oneWay.await(1, TimeUnit.SECONDS)
assert(0 === oneWay.getCount)
assert(oneWay.await(1, TimeUnit.SECONDS))
actor.stop
}