コード例 #1
0
  @Before
  public void setUp() throws InterruptedException {
    pojo = new Pojo(serverInstance);
    PojoSlice slice = new PojoSlice(pojo);

    server = new SliceServer(slice, 100);
    server.start();

    Thread.sleep(1000);

    proxyProvider = new ProxyProviderImpl("default", clientInstance);
    proxyProvider.setLocalCallOptimizationEnabled(false);
  }
コード例 #2
0
  @Test
  public void whenTimeoutNotInterruptible() throws InterruptedException {
    TestService testService = proxyProvider.getProxy(TestService.class);

    try {
      testService.fiveSecondTimeoutNotInterruptible(10000);
      fail();
    } catch (DistributedMethodTimeoutException expected) {

    }
    Thread.sleep(10000);

    assertFalse(pojo.testService.interrupted.get());
  }
コード例 #3
0
 @Test
 public void whenCallDoesntTimeout() {
   TestService testService = proxyProvider.getProxy(TestService.class);
   testService.fiveSecondTimeoutAndInterruptible(1000);
 }