ask-2.3
This commit is contained in:
parent
0558e11aff
commit
877075cdac
6 changed files with 46 additions and 21 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue