[opentestbed] 2 new revisions pushed by bluegaspode on 2010-11-13 22:18 GMT

1 view
Skip to first unread message

opent...@googlecode.com

unread,
Nov 13, 2010, 5:20:06 PM11/13/10
to opent...@googlegroups.com
2 new revisions:

Revision: 29d2503b14
Author: bluegaspode
Date: Sat Nov 13 13:18:53 2010
Log: fixed Junit-Test
http://code.google.com/p/opentestbed/source/detail?r=29d2503b14

Revision: cdc523213f
Author: bluegaspode
Date: Sat Nov 13 14:17:09 2010
Log: tried to reproduce issue#30
http://code.google.com/p/opentestbed/source/detail?r=cdc523213f

==============================================================================
Revision: 29d2503b14
Author: bluegaspode
Date: Sat Nov 13 13:18:53 2010
Log: fixed Junit-Test
http://code.google.com/p/opentestbed/source/detail?r=29d2503b14

Modified:
/junit/bots/BotRepositoryTest.java

=======================================
--- /junit/bots/BotRepositoryTest.java Sun Nov 7 06:35:47 2010
+++ /junit/bots/BotRepositoryTest.java Sat Nov 13 13:18:53 2010
@@ -17,10 +17,10 @@
public void testGetBot() {
BotRepository botRepository = new BotRepository();
Set<String> botNames = botRepository.getBotNames();
- assertTrue(botNames.contains("SimpleBot/SimpleBot"));
-
- BotMetaData botMetaData =
botRepository.getBotMetaData("SimpleBot/SimpleBot");
- assertEquals("SimpleBot/SimpleBot", botMetaData.getBotName());
+ assertTrue(botNames.contains("DemoBot/SimpleBot"));
+
+ BotMetaData botMetaData =
botRepository.getBotMetaData("DemoBot/SimpleBot");
+ assertEquals("DemoBot/SimpleBot", botMetaData.getBotName());
assertEquals("bots.demobots.SimpleBot", botMetaData.getBotClassName());
assertNotNull(botMetaData.getBotPreferences());
}
@@ -28,7 +28,7 @@
@Test
public void testCreateBot() {
BotRepository botRepository = new BotRepository();
- Player bot = botRepository.createBot("SimpleBot/SimpleBot");
+ Player bot = botRepository.createBot("DemoBot/SimpleBot");
assertNotNull(bot);
assertTrue(bot instanceof SimpleBot);
}

==============================================================================
Revision: cdc523213f
Author: bluegaspode
Date: Sat Nov 13 14:17:09 2010
Log: tried to reproduce issue#30
http://code.google.com/p/opentestbed/source/detail?r=cdc523213f

Added:
/junit/game/playerTestLog_issue30.txt
Modified:
/junit/game/DealerTest.java

=======================================
--- /dev/null
+++ /junit/game/playerTestLog_issue30.txt Sat Nov 13 14:17:09 2010
@@ -0,0 +1,33 @@
+#gameStartEvent
+#stageEvent 0, board
+#actionEvent 0 action:5 (toCall: 0.0, amount:0.1)
+#gameStateChanged
+#actionEvent 1 action:6 (toCall: 0.0, amount:0.2)
+#gameStateChanged
+#dealHoleCardsEvent
+#actionEvent 2 action:2 (toCall: 0.2, amount:0.0)
+#gameStateChanged
+#actionEvent 0 action:2 (toCall: 0.1, amount:0.0)
+#gameStateChanged
+#actionEvent 1 action:3 (toCall: 0.0, amount:0.6)
+#gameStateChanged
+#actionEvent 2 action:2 (toCall: 0.6, amount:0.0)
+#gameStateChanged
+#actionEvent 0 action:4 (toCall: 0.6, amount:0.2)
+#gameStateChanged
+#actionEvent 1 action:2 (toCall: 0.2, amount:0.0)
+#gameStateChanged
+#actionEvent 2 action:2 (toCall: 0.2, amount:0.0)
+#gameStateChanged
+#stageEvent 1, board 4d 2d 7h
+#actionEvent 1 action:3 (toCall: 0.0, amount:0.5)
+#gameStateChanged
+#actionEvent 2 action:0 (toCall: 0.5, amount:0.0)
+#gameStateChanged
+#actionEvent 1 action:100 (toCall: 0.0, amount:0.5)
+#showdownEvent: As7d seat:1
+#showdownEvent: 2c7s seat:0
+#stageEvent 2, board 4d 2d 7h 5h
+#stageEvent 3, board 4d 2d 7h 5h Kh
+#winEvent 0, amount 3.0, hand two pair, Sevens and Deuces with a King
kicker
+#gameOverEvent
=======================================
--- /junit/game/DealerTest.java Sun Nov 7 06:35:47 2010
+++ /junit/game/DealerTest.java Sat Nov 13 14:17:09 2010
@@ -346,6 +346,47 @@
String playerLog =
IOUtils.toString(this.getClass().getResourceAsStream("./playerTestLog_bigBlindRaise.txt")).replace("\r", "");
assertEquals(playerLog, botLog.getLog());
}
+
+ /**
+ * see issue #30
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testIssue30() throws Exception {
+ Deck deck = new MockDeck(new String[] { "4d 2d 7h 5h Kh" }, new String[]
{ "2c 7s|As 7d|Ah 7c" });
+ PublicGameInfo gameInfo = new PublicGameInfo();
+ gameInfo.setNumSeats(3);
+ gameInfo.setBlinds(0.1, 0.2);
+
+ // we use one player at all seats
+ Player mockPlayer = new PrerecordedPlayerMock( //
+ Action.callAction(0.02), // p3 call
+ Action.callAction(0.01), // p1 (SB) call
+ Action.betAction(0.6), // p2 (BB): bet/raise
+ Action.callAction(0.6), // p3 call
+ Action.raiseAction(0.6, 0.2), // p1 - allin - raise
+ Action.callAction(0.2), // p2 - call
+ Action.callAction(0.2), // p3 - call
+
+ // -- flop --
+ Action.betAction(0.5), // player2: bet
+ Action.foldAction(0.5) // player3: fold
+ );
+
+ gameInfo.setPlayer(0, PublicPlayerInfo.create("player1 (SB)", 1.00,
mockPlayer));
+ gameInfo.setPlayer(1, PublicPlayerInfo.create("player2 (BB)", 2.00,
mockPlayer));
+ BotLoggingDecorator botLog = new BotLoggingDecorator(mockPlayer, false);
+ gameInfo.setPlayer(2, PublicPlayerInfo.create("player3 ", 2.00, botLog));
+
+ Dealer dealer = new Dealer(deck, gameInfo);
+ dealer.moveButton();
+ dealer.moveButton();
+ dealer.playHand();
+
+ String playerLog =
IOUtils.toString(this.getClass().getResourceAsStream("./playerTestLog_issue30.txt")).replace("\r", "");
+ assertEquals(playerLog, botLog.getLog());
+ }

/**
* simple Testbot, whose first action is to raise

Reply all
Reply to author
Forward
0 new messages