flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/heartbeat/HeartbeatManagerTest.java
/**
	 * Tests that the last heartbeat from an unregistered target equals -1.
	 */
Tests that the last heartbeat from an unregistered target equals -1.
Tests that the last heartbeat from an unregistered target equals - 1 .
@Test
	public void testLastHeartbeatFromUnregisteredTarget() {
		final long heartbeatTimeout = 100L;
		final ResourceID resourceId = ResourceID.generate();
		@SuppressWarnings("unchecked")
		final HeartbeatListener<Object, Object> heartbeatListener = mock(HeartbeatListener.class);
		HeartbeatManager<?, ?> heartbeatManager = new HeartbeatManagerImpl<>(
			heartbeatTimeout,
			resourceId,
			heartbeatListener,
			Executors.directExecutor(),
			mock(ScheduledExecutor.class),
			LOG);
		try {
			assertEquals(-1L, heartbeatManager.getLastHeartbeatFrom(ResourceID.generate()));
		} finally {
			heartbeatManager.stop();
		}
	}
@ Test public void testLastHeartbeatFromUnregisteredTarget ( ) { final long heartbeatTimeout = 100L ; final ResourceID resourceId = ResourceID . generate ( ) ; @ SuppressWarnings ( "unchecked" ) final HeartbeatListener < Object , Object > heartbeatListener = mock ( HeartbeatListener . class ) ; HeartbeatManager < ? , ? > heartbeatManager = new HeartbeatManagerImpl < > ( heartbeatTimeout , resourceId , heartbeatListener , Executors . directExecutor ( ) , mock ( ScheduledExecutor . class ) , LOG ) ; try { assertEquals ( - 1L , heartbeatManager . getLastHeartbeatFrom ( ResourceID . generate ( ) ) ) ; } finally { heartbeatManager . stop ( ) ; } }
Tests that the last heartbeat from an unregistered target equals -1.
Tests that the last heartbeat from an unregistered target equals - 1 .