Ejemplo n.º 1
0
 @Test
 public void simpleStatelessThreeStages()
     throws ExecutionException, InterruptedException, TimeoutException {
   final Stage stage1 = createStage();
   StatelessThing actor = Actor.getReference(StatelessThing.class, "1000");
   stage1.bind();
   assertNotNull(actor.sayHello().get(10, TimeUnit.SECONDS));
   final Stage stage2 = createStage();
   stage2.bind();
   assertNotNull(actor.sayHello().get(10, TimeUnit.SECONDS));
   final Stage stage3 = createStage();
   stage1.stop().join();
   stage2.stop().join();
   stage3.bind();
   assertNotNull(actor.sayHello().get(10, TimeUnit.SECONDS));
   Thread.sleep(500);
   stage3.stop().join();
   dumpMessages();
 }
Ejemplo n.º 2
0
  @Test
  public void testConstruction() throws Exception {

    final Stage stage = new Stage.Builder().extensions(new TestConstructionExtension()).build();

    try {

      stage.start().join();

      final TestConstruction actor = Actor.getReference(TestConstruction.class, "0");
      assertEquals(OTHER_ID, actor.getId().get());

    } finally {
      stage.stop().join();
    }
  }