2012-02-27 22:38:26 +01:00
|
|
|
package akka.actor;
|
|
|
|
|
|
2013-05-02 17:12:36 +02:00
|
|
|
import akka.testkit.AkkaJUnitActorSystemResource;
|
2013-05-22 11:49:30 +02:00
|
|
|
import akka.testkit.TestProbe;
|
|
|
|
|
|
2013-05-02 17:12:36 +02:00
|
|
|
import org.junit.ClassRule;
|
2012-02-27 22:38:26 +01:00
|
|
|
import org.junit.Test;
|
2012-09-19 23:55:53 +02:00
|
|
|
|
|
|
|
|
import com.typesafe.config.ConfigFactory;
|
2012-02-27 22:38:26 +01:00
|
|
|
|
|
|
|
|
public class StashJavaAPI {
|
|
|
|
|
|
2013-05-02 17:12:36 +02:00
|
|
|
@ClassRule
|
|
|
|
|
public static AkkaJUnitActorSystemResource actorSystemResource =
|
|
|
|
|
new AkkaJUnitActorSystemResource("StashJavaAPI", ActorWithBoundedStashSpec.testConf());
|
2012-09-19 23:55:53 +02:00
|
|
|
|
2013-05-02 17:12:36 +02:00
|
|
|
private final ActorSystem system = actorSystemResource.getSystem();
|
2012-09-19 23:55:53 +02:00
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void mustBeAbleToUseStash() {
|
2013-05-22 11:49:30 +02:00
|
|
|
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);
|
2012-09-19 23:55:53 +02:00
|
|
|
}
|
2012-02-27 22:38:26 +01:00
|
|
|
|
|
|
|
|
}
|