2011-12-19 11:07:59 +01:00
|
|
|
/**
|
2012-01-19 18:21:06 +01:00
|
|
|
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
2011-12-19 11:07:59 +01:00
|
|
|
*/
|
2012-05-22 11:37:09 +02:00
|
|
|
package docs.actor.mailbox;
|
2011-12-12 08:37:18 +01:00
|
|
|
|
|
|
|
|
//#imports
|
|
|
|
|
import akka.actor.Props;
|
2012-05-15 16:01:32 +02:00
|
|
|
import akka.actor.ActorRef;
|
2011-12-12 08:37:18 +01:00
|
|
|
|
|
|
|
|
//#imports
|
|
|
|
|
|
2011-12-19 20:36:06 +01:00
|
|
|
import org.junit.After;
|
|
|
|
|
import org.junit.Before;
|
2011-12-12 08:37:18 +01:00
|
|
|
import org.junit.Test;
|
|
|
|
|
|
2011-12-19 20:36:06 +01:00
|
|
|
import akka.testkit.AkkaSpec;
|
|
|
|
|
import com.typesafe.config.ConfigFactory;
|
2011-12-12 08:37:18 +01:00
|
|
|
import akka.actor.ActorSystem;
|
2012-05-15 16:01:32 +02:00
|
|
|
import akka.actor.UntypedActor;
|
2011-12-12 08:37:18 +01:00
|
|
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
|
|
|
|
public class DurableMailboxDocTestBase {
|
|
|
|
|
|
2011-12-19 20:36:06 +01:00
|
|
|
ActorSystem system;
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
|
public void setUp() {
|
|
|
|
|
system = ActorSystem.create("MySystem",
|
|
|
|
|
ConfigFactory.parseString(DurableMailboxDocSpec.config()).withFallback(AkkaSpec.testConf()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@After
|
|
|
|
|
public void tearDown() {
|
|
|
|
|
system.shutdown();
|
|
|
|
|
}
|
|
|
|
|
|
2011-12-12 08:37:18 +01:00
|
|
|
@Test
|
2011-12-19 20:36:06 +01:00
|
|
|
public void configDefinedDispatcher() {
|
|
|
|
|
//#dispatcher-config-use
|
2012-05-15 16:01:32 +02:00
|
|
|
ActorRef myActor = system.actorOf(new Props(MyUntypedActor.class).
|
|
|
|
|
withDispatcher("my-dispatcher"), "myactor");
|
2011-12-19 20:36:06 +01:00
|
|
|
//#dispatcher-config-use
|
|
|
|
|
myActor.tell("test");
|
|
|
|
|
}
|
|
|
|
|
|
2011-12-12 08:37:18 +01:00
|
|
|
public static class MyUntypedActor extends UntypedActor {
|
|
|
|
|
public void onReceive(Object message) {
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-12-20 09:19:34 +01:00
|
|
|
|
2011-12-12 08:37:18 +01:00
|
|
|
}
|