NoPolActor extends UntypedActor { public NoPolActor(ActorSystem system) { for (int i = 0; i < 10; i++) this.pool.put(system.actorOf(Props.create(InternalNopolActor.class), "InternalNopolActor_" + i), Boolean.TRUE); } NoPolActor(ActorSystem system); @Override void onReceive(Object message); static void run(); static void main(String[] args);  }
@Test public void nopolActor() throws Exception { com.typesafe.config.Config config = ConfigFactory.load("nopol"); String ACTOR_SYSTEM_NAME = config.getString("nopol.system.name"); String ACTOR_NAME = config.getString("nopol.actor.name"); system = ActorSystem.create(ACTOR_SYSTEM_NAME, config); actorNopol = system.actorOf(Props.create(NoPolActor.class, system), ACTOR_NAME); ActorRef actorClient = system.actorOf(Props.create(ActorClient.class, "../test-projects",fullQualifiedNameTest, patchAsString), "Client"); Timeout timeout = new Timeout(scala.concurrent.duration.Duration.fromNanos(20*1000000000)); Future<Object> future = Patterns.ask(actorClient, "start", timeout); Patch patch = (Patch) Await.result(future, timeout.duration()); assertEquals(patchAsString, patch.asString()); }