Add Java API class UntypedActorWithStash. Add tests for Stash Java API.

This commit is contained in:
phaller 2012-02-27 22:38:26 +01:00
parent 9244e8399d
commit 00e5bf3bdf
4 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,36 @@
package akka.actor;
import akka.actor.ActorSystem;
import akka.japi.Creator;
import akka.testkit.AkkaSpec;
import com.typesafe.config.ConfigFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class StashJavaAPI {
private static ActorSystem system;
@BeforeClass
public static void beforeAll() {
system = ActorSystem.create("StashJavaAPI", ConfigFactory.parseString(ActorWithStashSpec.testConf()));
}
@AfterClass
public static void afterAll() {
system.shutdown();
system = null;
}
@Test
public void mustBeAbleToUseStash() {
ActorRef ref = system.actorOf(new Props(StashJavaAPITestActor.class).withDispatcher("my-dispatcher"));
ref.tell("Hello", ref);
ref.tell("Hello", ref);
ref.tell(new Object());
}
}