@Test
public void testLaunchGame() {

	TestUserProxy user = new TestUserProxy(testLobby, "Test User");
	testLobby.addUserProxy(user);
	user.getUser().setReady(true);
	testLobby.setGameType(GameType.FREETEST);
	
	// Assert that game will not start with no robot registered
	testLobby.launchGame();
	assertEquals(false, testLobby.gameInProgress());
	
	// Assert that the game will not start with no readied players
	RobotProxy robot = new TestRobotProxy(testLobby, "test:mac:addr");
	user.getUser().setReady(false);
	testLobby.launchGame();
	assertEquals(false, testLobby.gameInProgress());
	
	// Assert that the game will not start with less than the minimum
	// players connected
	testLobby.setGameType(GameType.TANK_SIMULATION);
	RobotProxy robot2 = new TestRobotProxy(testLobby, "test:mac:addr2");
	user.getUser().setReady(true);
	testLobby.launchGame();
	assertEquals(false, testLobby.gameInProgress());
	
	// Assert that the game will not start when not all upcoming players are
	// readied
	TestUserProxy user2 = new TestUserProxy(testLobby, "Test User 2");
	testLobby.addUserProxy(user2);
	user2.getUser().setReady(false);
	testLobby.launchGame();
	assertEquals(false, testLobby.gameInProgress());
	
	// Assert that game will not start if a pure spectator would be
	// required to play
	user2.getUser().setReady(true);
	user2.getUser().setPureSpectator(true);
	testLobby.launchGame();
	assertEquals(false, testLobby.gameInProgress());
	
	
	// Assert that game starts when all players are ready and no players
	// are spectators, and that a game launch event was generated
	user2.getUser().setPureSpectator(false);
	testLobby.launchGame();
	assertEquals(true, testLobby.gameInProgress());
	assertEquals(ServerLobbyEvent.EVENT_GAME_LAUNCH,
			testListener.getLastGameEvent().getEventType());
	testLobby.endCurrentGame();
}