flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerTest.java
/**
	 * Tests that if we have received a slot report with some allocated slots, then we don't accept
	 * slot requests with allocated allocation ids.
	 */
Tests that if we have received a slot report with some allocated slots, then we don't accept
slot requests with allocated allocation ids.
Tests that if we have received a slot report with some allocated slots then we don ' t accept slot requests with allocated allocation ids .
@Test
	public void testDuplicatePendingSlotRequestAfterSlotReport() throws Exception {
		final ResourceManagerId resourceManagerId = ResourceManagerId.generate();
		final ResourceActions resourceManagerActions = mock(ResourceActions.class);
		final JobID jobId = new JobID();
		final AllocationID allocationId = new AllocationID();
		final ResourceProfile resourceProfile = new ResourceProfile(1.0, 1);
		final SlotID slotId = new SlotID(ResourceID.generate(), 0);
		final TaskExecutorGateway taskExecutorGateway = mock(TaskExecutorGateway.class);
		final TaskExecutorConnection taskManagerConnection = new TaskExecutorConnection(taskExecutorGateway);
		final SlotStatus slotStatus = new SlotStatus(slotId, resourceProfile, jobId, allocationId);
		final SlotReport slotReport = new SlotReport(slotStatus);
		final SlotRequest slotRequest = new SlotRequest(jobId, allocationId, resourceProfile, "foobar");
		try (SlotManager slotManager = createSlotManager(resourceManagerId, resourceManagerActions)) {
			slotManager.registerTaskManager(taskManagerConnection, slotReport);
			assertFalse(slotManager.registerSlotRequest(slotRequest));
		}
	}
@ Test public void testDuplicatePendingSlotRequestAfterSlotReport ( ) throws Exception { final ResourceManagerId resourceManagerId = ResourceManagerId . generate ( ) ; final ResourceActions resourceManagerActions = mock ( ResourceActions . class ) ; final JobID jobId = new JobID ( ) ; final AllocationID allocationId = new AllocationID ( ) ; final ResourceProfile resourceProfile = new ResourceProfile ( 1.0 , 1 ) ; final SlotID slotId = new SlotID ( ResourceID . generate ( ) , 0 ) ; final TaskExecutorGateway taskExecutorGateway = mock ( TaskExecutorGateway . class ) ; final TaskExecutorConnection taskManagerConnection = new TaskExecutorConnection ( taskExecutorGateway ) ; final SlotStatus slotStatus = new SlotStatus ( slotId , resourceProfile , jobId , allocationId ) ; final SlotReport slotReport = new SlotReport ( slotStatus ) ; final SlotRequest slotRequest = new SlotRequest ( jobId , allocationId , resourceProfile , "foobar" ) ; try ( SlotManager slotManager = createSlotManager ( resourceManagerId , resourceManagerActions ) ) { slotManager . registerTaskManager ( taskManagerConnection , slotReport ) ; assertFalse ( slotManager . registerSlotRequest ( slotRequest ) ) ; } }
Tests that if we have received a slot report with some allocated slots, then we don't accept
 slot requests with allocated allocation ids.
Tests that if we have received a slot report with some allocated slots then we don ' t accept slot requests with allocated allocation ids .