Package org.cspoker.server.embedded.gamecontrol

Examples of org.cspoker.server.embedded.gamecontrol.PlayingTableState$AutoDealHandler


  }

  public void testOnlyOneAllInPlayer() {

    PlayingTableState gameControl = new PlayingTableState(pokerTable, table);
   
    events.ignore(); //TODO
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    try {
      gameControl.allIn(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here


      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }

    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, kenzo);
   
    events.ignore(); //TODO
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    try {
      gameControl.allIn(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());

      gameControl.fold(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

  public void testTwoPlayersDealerChecksCase(){

    TableConfiguration configuration = new TableConfiguration();
    table = new ServerTable(configuration);
    PlayingTableState gameControl;
    try {
      kenzo = new MutableSeatedPlayer(factory.createNewPlayer("kenzo", 100), 50);
      cedric = new MutableSeatedPlayer(factory.createNewPlayer("cedric", 100), 50);
      table.addPlayer(kenzo);
      table.addPlayer(cedric);
      gameControl = new PlayingTableState(pokerTable, table, kenzo);
     
      events.ignore(); //TODO
     
      try {
        gameControl.deal();
      } catch (IllegalActionException e1) {
        fail(e1.toString());
      }




      try {
        gameControl.check(kenzo);
        fail("Exception Expected.");
      } catch (IllegalActionException e) {
      }



      try {
        gameControl.call(kenzo);
        gameControl.check(cedric);
      } catch (IllegalActionException e) {
        fail(e.getMessage());
      }

    } catch (IllegalValueException e) {
View Full Code Here

  public void testTwoPlayersNormalCase(){

    TableConfiguration configuration = new TableConfiguration();
    table = new ServerTable(configuration);
    PlayingTableState gameControl;
    try {
      kenzo = new MutableSeatedPlayer(factory.createNewPlayer("kenzo", 100), 100);
      cedric = new MutableSeatedPlayer(factory.createNewPlayer("cedric", 100), 100);
      table.addPlayer(kenzo);
      table.addPlayer(cedric);
      gameControl = new PlayingTableState(pokerTable, table, kenzo);
     
      events.ignore(); //TODO
     
      try {
        gameControl.deal();
      } catch (IllegalActionException e1) {
        fail(e1.toString());
      }
      try {
        gameControl.check(kenzo);
        fail("Exception Expected.");
      } catch (IllegalActionException e) {
      }
      try {
        gameControl.call(kenzo);
        gameControl.check(cedric);
      } catch (IllegalActionException e) {
        fail(e.getMessage());
      }

      assertEquals(FlopRound.class, gameControl.getRound().getClass());

      try {
        gameControl.check(cedric);
        gameControl.check(kenzo);
      } catch (IllegalActionException e) {
        fail(e.getMessage());
      }

      assertEquals(TurnRound.class, gameControl.getRound().getClass());

      try {
        gameControl.check(cedric);
        gameControl.check(kenzo);
      } catch (IllegalActionException e) {
        fail(e.getMessage());
      }

      assertEquals(FinalRound.class, gameControl.getRound().getClass());

      try {
        gameControl.check(cedric);
        gameControl.check(kenzo);
      } catch (IllegalActionException e) {
        fail(e.getMessage());
      }

      assertEquals(PreFlopRound.class, gameControl.getRound().getClass());

    } catch (IllegalValueException e) {
      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
View Full Code Here

  }

  public void testTwoPlayersDealerRaisesCase(){
    TableConfiguration configuration = new TableConfiguration();
    table = new ServerTable(configuration);
    PlayingTableState gameControl;
    try {
      kenzo = new MutableSeatedPlayer(factory.createNewPlayer("kenzo", 100), 100);
      cedric = new MutableSeatedPlayer(factory.createNewPlayer("cedric", 100), 100);
      table.addPlayer(kenzo);
      table.addPlayer(cedric);
      gameControl = new PlayingTableState(pokerTable, table, kenzo);
     
      events.ignore(); //TODO
     
      try {
        gameControl.deal();
      } catch (IllegalActionException e1) {
        fail(e1.toString());
      }
      try {
        gameControl.raise(kenzo, 30);
        gameControl.call(cedric);
      } catch (IllegalActionException e) {
        fail(e.getMessage());
      }

    } catch (IllegalValueException e) {
View Full Code Here

      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }

    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, guy);
   
    events.ignore(); //TODO
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }

    try {
      gameControl.call(guy);
      gameControl.check(craig);

      gameControl.check(craig);
      gameControl.check(guy);
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    } catch (IllegalValueException e) {
      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }
    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, kenzo);
    events.addNewDealEvents();
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }

    assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
   
    events.add(Events.fold, Events.winner);
    events.ignore();
   
    try {
      gameControl.fold(kenzo);
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    } catch (IllegalValueException e) {
      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }
    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, kenzo);
   
    events.ignore(); //TODO
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }

    assertEquals(PreFlopRound.class, gameControl.getRound().getClass());

    try {
      gameControl.call(kenzo);
      gameControl.raise(cedric, 20);
      gameControl.call(kenzo);

      assertEquals(FlopRound.class, gameControl.getRound().getClass());

      gameControl.bet(cedric, 20);
      gameControl.call(kenzo);

      assertEquals(TurnRound.class, gameControl.getRound().getClass());

      gameControl.bet(cedric, 20);
      gameControl.call(kenzo);

      assertEquals(FinalRound.class, gameControl.getRound().getClass());

      gameControl.bet(cedric, 20);
      gameControl.raise(kenzo, 50);
      gameControl.fold(cedric);

      assertEquals(PreFlopRound.class, gameControl.getRound().getClass());

    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }

    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, cedric);
   
    events.ignore(); //TODO
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }

    try {
      performAction(gameControl, kenzo, Action.call, 5);
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }

    //Verify auto-showdown
    assertNotSame(FlopRound.class, gameControl.getRound().getClass());

  }
View Full Code Here

    } catch (IllegalValueException e) {
      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }
    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, kenzo);
   
    events.ignore(); //TODO
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    try {
      gameControl.raise(kenzo, 20);
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
    try {
      gameControl.check(cedric);
      fail("Exception expected: can not check after raise");
    } catch (IllegalActionException e) {
    }

    try {
      gameControl.call(cedric);

      assertEquals(FlopRound.class, gameControl.getRound().getClass());
      gameControl.check(cedric);
      gameControl.check(kenzo);

      assertEquals(TurnRound.class, gameControl.getRound().getClass());
      gameControl.check(cedric);
      gameControl.check(kenzo);
      assertEquals(FinalRound.class, gameControl.getRound().getClass());
      gameControl.check(cedric);
      gameControl.check(kenzo);
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
    assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
  }
View Full Code Here

TOP

Related Classes of org.cspoker.server.embedded.gamecontrol.PlayingTableState$AutoDealHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.