}
public void testAllAllInCase() {
try {
kenzo = new MutableSeatedPlayer(factory.createNewPlayer("Kenzo", 200), 200);
cedric = new MutableSeatedPlayer(factory.createNewPlayer("Cedric", 100),100);
guy = new MutableSeatedPlayer(factory.createNewPlayer("Guy", 150),150);
TableConfiguration configuration = new TableConfiguration();
table = new ServerTable(configuration);
table.addPlayer(kenzo);
table.addPlayer(cedric);
table.addPlayer(guy);
} catch (IllegalValueException e) {
fail(e.getMessage());
} catch (PlayerListFullException e) {
fail(e.getMessage());
}
PlayingTableState gameControl = new PlayingTableState(pokerTable, table);
events.add(newDealEvents);
try {
gameControl.deal();
} catch (IllegalActionException e1) {
fail(e1.toString());
}
Game game = gameControl.getGame();
events.add(Events.call, Events.nextPlayer);
events.add(Events.call, Events.nextPlayer);
events.add(Events.check, Events.newRound, Events.newCommunityCards, Events.nextPlayer);
try {
gameControl.call(game.getCurrentPlayer());
gameControl.call(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
events.add(Events.allIn, Events.nextPlayer);
events.add(Events.allIn, Events.nextPlayer);
events.add(Events.allIn, Events.newRound, Events.newCommunityCards);
events.add(Events.newRound, Events.newCommunityCards);
events.add(Events.showHand, Events.showHand, Events.showHand, Events.winner);
events.ignore();
// Flop Round
try {
gameControl.allIn(game.getCurrentPlayer());
gameControl.allIn(game.getCurrentPlayer());
gameControl.allIn(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
GameFlowTest.logger.info("Common Cards: " + game.getCommunityCards());
// New game
MutableSeatedPlayer testPlayer;
try {
testPlayer = new MutableSeatedPlayer(factory.createNewPlayer("Test", 150),150);
gameControl.sitIn(new SeatId(4), testPlayer);
} catch (IllegalActionException e) {
fail(e.getMessage());
} catch (IllegalValueException e) {
fail(e.getMessage());