=doc:3472 Updated Stash docs to reflect new mailbox requirements

This commit is contained in:
Endre Sándor Varga 2013-07-01 15:55:59 +02:00
parent c77d9cc18d
commit cebdc7202b
7 changed files with 132 additions and 43 deletions

View file

@ -6,8 +6,6 @@ import akka.testkit.TestProbe;
import org.junit.ClassRule;
import org.junit.Test;
import com.typesafe.config.ConfigFactory;
public class StashJavaAPI {
@ClassRule
@ -16,14 +14,30 @@ public class StashJavaAPI {
private final ActorSystem system = actorSystemResource.getSystem();
@Test
public void mustBeAbleToUseStash() {
ActorRef ref = system.actorOf(Props.create(StashJavaAPITestActor.class));
final TestProbe probe = new TestProbe(system);
probe.send(ref, "Hello");
probe.send(ref, "Hello2");
probe.send(ref, "Hello12");
probe.expectMsg(5);
private void testAStashApi(Props props) {
ActorRef ref = system.actorOf(props);
final TestProbe probe = new TestProbe(system);
probe.send(ref, "Hello");
probe.send(ref, "Hello2");
probe.send(ref, "Hello12");
probe.expectMsg(5);
}
@Test
public void mustBeAbleToUseStash() {
testAStashApi(Props.create(StashJavaAPITestActors.WithStash.class));
}
@Test
public void mustBeAbleToUseUnboundedStash() {
testAStashApi(Props.create(StashJavaAPITestActors.WithUnboundedStash.class));
}
@Test
public void mustBeAbleToUseUnrestrictedStash() {
testAStashApi(Props.create(StashJavaAPITestActors.WithUnrestrictedStash.class)
.withMailbox("akka.actor.mailbox.unbounded-deque-based"));
}
}