=doc add props static method to IODocText

This commit is contained in:
Saeed Zarinfam 2015-02-14 20:36:51 +03:30 committed by Roland Kuhn
parent 7a0345ca0e
commit c2853f7159

View file

@ -40,6 +40,10 @@ public class IODocTest {
public Server(ActorRef manager) { public Server(ActorRef manager) {
this.manager = manager; this.manager = manager;
} }
public static Props props(ActorRef manager) {
return Props.create(Server.class, manager);
}
@Override @Override
public void preStart() throws Exception { public void preStart() throws Exception {
@ -90,6 +94,10 @@ public class IODocTest {
final InetSocketAddress remote; final InetSocketAddress remote;
final ActorRef listener; final ActorRef listener;
public static Props props(InetSocketAddress remote, ActorRef listener) {
return Props.create(Client.class, remote, listener);
}
public Client(InetSocketAddress remote, ActorRef listener) { public Client(InetSocketAddress remote, ActorRef listener) {
this.remote = remote; this.remote = remote;
@ -150,9 +158,9 @@ public class IODocTest {
new JavaTestKit(system) { new JavaTestKit(system) {
{ {
@SuppressWarnings("unused") @SuppressWarnings("unused")
final ActorRef server = system.actorOf(Props.create(Server.class, getRef()), "server1"); final ActorRef server = system.actorOf(Server.props(getRef()), "server1");
final InetSocketAddress listen = expectMsgClass(Bound.class).localAddress(); final InetSocketAddress listen = expectMsgClass(Bound.class).localAddress();
final ActorRef client = system.actorOf(Props.create(Client.class, listen, getRef()), "client1"); final ActorRef client = system.actorOf(Client.props(listen, getRef()), "client1");
final Connected c1 = expectMsgClass(Connected.class); final Connected c1 = expectMsgClass(Connected.class);
final Connected c2 = expectMsgClass(Connected.class); final Connected c2 = expectMsgClass(Connected.class);