flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceTest.java
/**
	 * Tests that the {@link AkkaRpcService} can execute callables and returns their result as
	 * a {@link CompletableFuture}.
	 */
Tests that the  AkkaRpcService can execute callables and returns their result as
a  CompletableFuture.
Tests that the AkkaRpcService can execute callables and returns their result as a CompletableFuture .
@Test
	public void testExecuteCallable() throws InterruptedException, ExecutionException, TimeoutException {
		final OneShotLatch latch = new OneShotLatch();
		final int expected = 42;
		CompletableFuture<Integer> result = akkaRpcService.execute(new Callable<Integer>() {
			@Override
			public Integer call() throws Exception {
				latch.trigger();
				return expected;
			}
		});
		int actual = result.get(30L, TimeUnit.SECONDS);
		assertEquals(expected, actual);
		assertTrue(latch.isTriggered());
	}
@ Test public void testExecuteCallable ( ) throws InterruptedException , ExecutionException , TimeoutException { final OneShotLatch latch = new OneShotLatch ( ) ; final int expected = 42 ; CompletableFuture < Integer > result = akkaRpcService . execute ( new Callable < Integer > ( ) { @ Override public Integer call ( ) throws Exception { latch . trigger ( ) ; return expected ; } } ) ; int actual = result . get ( 30L , TimeUnit . SECONDS ) ; assertEquals ( expected , actual ) ; assertTrue ( latch . isTriggered ( ) ) ; }
Tests that the {@link AkkaRpcService} can execute callables and returns their result as
 a {@link CompletableFuture}.
Tests that the { @link AkkaRpcService } can execute callables and returns their result as a { @link CompletableFuture } .