This commit is contained in:
Nikolay Botev 2011-12-19 15:54:26 -08:00
parent 0558e11aff
commit 877075cdac
6 changed files with 46 additions and 21 deletions

View file

@ -18,6 +18,7 @@ import akka.actor.UntypedActor;
import akka.actor.UntypedActorFactory;
import akka.dispatch.Await;
import akka.dispatch.Future;
import static akka.dispatch.Futures.ask;
import akka.testkit.AkkaSpec;
import akka.testkit.EventFilter;
import akka.testkit.ErrorFilter;
@ -80,7 +81,7 @@ public class UntypedCoordinatedIncrementTest {
} catch (InterruptedException exception) {
}
for (ActorRef counter : counters) {
Future<Object> future = counter.ask("GetCount", timeout);
Future<Object> future = ask(counter, "GetCount", timeout);
int count = (Integer) Await.result(future, timeout.duration());
assertEquals(1, count);
}
@ -102,7 +103,7 @@ public class UntypedCoordinatedIncrementTest {
} catch (InterruptedException exception) {
}
for (ActorRef counter : counters) {
Future<Object>future = counter.ask("GetCount", timeout);
Future<Object>future = ask(counter, "GetCount", timeout);
int count = (Integer) Await.result(future, timeout.duration());
assertEquals(0, count);
}

View file

@ -18,6 +18,7 @@ import akka.actor.UntypedActor;
import akka.actor.UntypedActorFactory;
import akka.dispatch.Await;
import akka.dispatch.Future;
import static akka.dispatch.Futures.ask;
import akka.testkit.AkkaSpec;
import akka.testkit.EventFilter;
import akka.testkit.ErrorFilter;
@ -81,7 +82,7 @@ public class UntypedTransactorTest {
} catch (InterruptedException exception) {
}
for (ActorRef counter : counters) {
Future<Object> future = counter.ask("GetCount", timeout);
Future<Object> future = ask(counter, "GetCount", timeout);
int count = (Integer) Await.result(future, timeout.duration());
assertEquals(1, count);
}
@ -103,7 +104,7 @@ public class UntypedTransactorTest {
} catch (InterruptedException exception) {
}
for (ActorRef counter : counters) {
Future<Object> future = counter.ask("GetCount", timeout);
Future<Object> future = ask(counter, "GetCount", timeout);
int count = (Integer) Await.result(future, timeout.duration());
assertEquals(0, count);
}