flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActorTest.java
/**
	 * Tests that we receive a RpcConnectionException when calling a rpc method (with return type)
	 * on a wrong rpc endpoint.
	 *
	 * @throws Exception
	 */
Tests that we receive a RpcConnectionException when calling a rpc method (with return type)
on a wrong rpc endpoint.

@throws Exception
Tests that we receive a RpcConnectionException when calling a rpc method ( with return type ) on a wrong rpc endpoint . @throws Exception
@Test
	public void testWrongGatewayEndpointConnection() throws Exception {
		DummyRpcEndpoint rpcEndpoint = new DummyRpcEndpoint(akkaRpcService);
		rpcEndpoint.start();
		CompletableFuture<WrongRpcGateway> futureGateway = akkaRpcService.connect(rpcEndpoint.getAddress(), WrongRpcGateway.class);
		WrongRpcGateway gateway = futureGateway.get(timeout.getSize(), timeout.getUnit());
		gateway.tell("foobar");
		CompletableFuture<Boolean> result = gateway.barfoo();
		try {
			result.get(timeout.getSize(), timeout.getUnit());
			fail("We expected a RpcConnectionException.");
		} catch (ExecutionException executionException) {
			assertTrue(executionException.getCause() instanceof RpcConnectionException);
		}
	}
@ Test public void testWrongGatewayEndpointConnection ( ) throws Exception { DummyRpcEndpoint rpcEndpoint = new DummyRpcEndpoint ( akkaRpcService ) ; rpcEndpoint . start ( ) ; CompletableFuture < WrongRpcGateway > futureGateway = akkaRpcService . connect ( rpcEndpoint . getAddress ( ) , WrongRpcGateway . class ) ; WrongRpcGateway gateway = futureGateway . get ( timeout . getSize ( ) , timeout . getUnit ( ) ) ; gateway . tell ( "foobar" ) ; CompletableFuture < Boolean > result = gateway . barfoo ( ) ; try { result . get ( timeout . getSize ( ) , timeout . getUnit ( ) ) ; fail ( "We expected a RpcConnectionException." ) ; } catch ( ExecutionException executionException ) { assertTrue ( executionException . getCause ( ) instanceof RpcConnectionException ) ; } }
Tests that we receive a RpcConnectionException when calling a rpc method (with return type)
 on a wrong rpc endpoint.
Tests that we receive a RpcConnectionException when calling a rpc method ( with return type ) on a wrong rpc endpoint .
// since it is a tell operation we won't receive a RpcConnectionException, it's only logged