|
Akka/Scala example source code file (StashJavaAPI.java)
The StashJavaAPI.java Akka example source codepackage akka.actor; import akka.testkit.AkkaJUnitActorSystemResource; import akka.testkit.TestProbe; import org.junit.ClassRule; import org.junit.Test; public class StashJavaAPI { @ClassRule public static AkkaJUnitActorSystemResource actorSystemResource = new AkkaJUnitActorSystemResource("StashJavaAPI", ActorWithBoundedStashSpec.testConf()); private final ActorSystem system = actorSystemResource.getSystem(); 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")); } } Other Akka source code examplesHere is a short list of links related to this Akka StashJavaAPI.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.