Added 'withRouter[TYPE]' to 'Props'.

Added docs (Scala and Java) and (code for the docs) for 'Props'.
Renamed UntypedActorTestBase to UntypedActorDocTestBase.

Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
Jonas Bonér 2011-12-14 14:05:44 +01:00
parent 66e7155ef1
commit 80600abc33
10 changed files with 178 additions and 83 deletions

View file

@ -0,0 +1,5 @@
package akka.docs.actor
import org.scalatest.junit.JUnitSuite
class UntypedActorDocTest extends UntypedActorDocTestBase with JUnitSuite

View file

@ -1,5 +1,7 @@
package akka.docs.actor;
import akka.actor.Timeout;
//#imports
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
@ -33,7 +35,26 @@ import scala.Option;
import static org.junit.Assert.*;
public class UntypedActorTestBase {
public class UntypedActorDocTestBase {
@Test
public void createProps() {
//#creating-props-config
Props props1 = new Props();
Props props2 = new Props(MyUntypedActor.class);
Props props3 = new Props(new UntypedActorFactory() {
public UntypedActor create() {
return new MyUntypedActor();
}
});
Props props4 = props1.withCreator(new UntypedActorFactory() {
public UntypedActor create() {
return new MyUntypedActor();
}
});
Props props5 = props4.withTimeout(new Timeout(1000));
//#creating-props-config
}
@Test
public void systemActorOf() {

View file

@ -1,5 +0,0 @@
package akka.docs.actor
import org.scalatest.junit.JUnitSuite
class UntypedActorTest extends UntypedActorTestBase with JUnitSuite