@Test
public void testShutdown() {

	try {
		InstanceManager cm = new InstanceManager();
		cm.shutdown();
		try {
			ResourceID resID = ResourceID.generate();
			HardwareDescription resources = HardwareDescription.extractFromSystem(4096);
			InetAddress address = InetAddress.getByName("127.0.0.1");
			TaskManagerLocation ici = new TaskManagerLocation(resID, address, 20000);
			JavaTestKit probe = new JavaTestKit(system);
			cm.registerTaskManager(
				new ActorTaskManagerGateway(new AkkaActorGateway(probe.getRef(), leaderSessionID)),
				ici,
				resources,
				1);
			fail("Should raise exception in shutdown state");
		}
		catch (IllegalStateException e) {
			// expected
		}
		
		assertFalse(cm.reportHeartBeat(new InstanceID()));
	}
	catch (Exception e) {
		System.err.println(e.getMessage());
		e.printStackTrace();
		Assert.fail("Test erroneous: " + e.getMessage());
	}
}