	@Test(expected = IllegalStateException.class)
	public void testRejectSecondContextExclusiveInContextExclusiveDifferentContext() throws IOException {


		RuntimeInfo runtimeInfo = createRuntimeInfo();

		ProcessManagerContext managerContext = new ProcessManagerContext(clusterContext, runtimeInfo);

		setUpTaskHandle(taskHandle1, CONTEXT_EXCLUSIVE, taskId1, contextId1);
		setUpTaskHandle(taskHandle2, CONTEXT_EXCLUSIVE, taskId2, contextId2);

		try {
			managerContext.tryAcceptTask(taskHandle1);
		} catch (Exception e) {
			assertFalse(true); // no exception allowed
		}

		try {
			managerContext.tryAcceptTask(taskHandle2);
		} finally {
			verifySetAcceptedCalled(taskHandle1);
			verifySetAcceptedNotCalled(taskHandle2);

			verifyMangerContext(managerContext, 1, CONTEXT_EXCLUSIVE, contextId1, runtimeInfo);

		}

	}