flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java
/**
	 * Tests that we can extend existing RpcEndpoints and can communicate with them via the
	 * self gateways.
	 */
Tests that we can extend existing RpcEndpoints and can communicate with them via the
self gateways.
Tests that we can extend existing RpcEndpoints and can communicate with them via the self gateways .
@Test
	public void testEndpointInheritance() throws Exception {
		int foobar = 1;
		int barfoo = 2;
		String foo = "foobar";
		ExtendedEndpoint endpoint = new ExtendedEndpoint(rpcService, foobar, barfoo, foo);
		try {
			endpoint.start();
			BaseGateway baseGateway = endpoint.getSelfGateway(BaseGateway.class);
			ExtendedGateway extendedGateway = endpoint.getSelfGateway(ExtendedGateway.class);
			DifferentGateway differentGateway = endpoint.getSelfGateway(DifferentGateway.class);
			assertEquals(Integer.valueOf(foobar), baseGateway.foobar().get());
			assertEquals(Integer.valueOf(foobar), extendedGateway.foobar().get());
			assertEquals(Integer.valueOf(barfoo), extendedGateway.barfoo().get());
			assertEquals(foo, differentGateway.foo().get());
		} finally {
			endpoint.shutDown();
		}
	}
@ Test public void testEndpointInheritance ( ) throws Exception { int foobar = 1 ; int barfoo = 2 ; String foo = "foobar" ; ExtendedEndpoint endpoint = new ExtendedEndpoint ( rpcService , foobar , barfoo , foo ) ; try { endpoint . start ( ) ; BaseGateway baseGateway = endpoint . getSelfGateway ( BaseGateway . class ) ; ExtendedGateway extendedGateway = endpoint . getSelfGateway ( ExtendedGateway . class ) ; DifferentGateway differentGateway = endpoint . getSelfGateway ( DifferentGateway . class ) ; assertEquals ( Integer . valueOf ( foobar ) , baseGateway . foobar ( ) . get ( ) ) ; assertEquals ( Integer . valueOf ( foobar ) , extendedGateway . foobar ( ) . get ( ) ) ; assertEquals ( Integer . valueOf ( barfoo ) , extendedGateway . barfoo ( ) . get ( ) ) ; assertEquals ( foo , differentGateway . foo ( ) . get ( ) ) ; } finally { endpoint . shutDown ( ) ; } }
Tests that we can extend existing RpcEndpoints and can communicate with them via the
 self gateways.
Tests that we can extend existing RpcEndpoints and can communicate with them via the self gateways .