diff --git a/tests/src/pokerth_protocol/AmountOfMoney.java b/tests/src/pokerth_protocol/AmountOfMoney.java new file mode 100644 index 00000000..90623026 --- /dev/null +++ b/tests/src/pokerth_protocol/AmountOfMoney.java @@ -0,0 +1,58 @@ + +package pokerth_protocol; +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +import org.bn.*; +import org.bn.annotations.*; +import org.bn.annotations.constraints.*; +import org.bn.coders.*; +import org.bn.types.*; + + + + + @ASN1PreparedElement + @ASN1BoxedType ( name = "AmountOfMoney" ) + public class AmountOfMoney implements IASN1PreparedElement { + + @ASN1Integer( name = "AmountOfMoney" ) + @ASN1ValueRangeConstraint ( + + min = 0L, + + max = 10000000L + + ) + + private Integer value; + + public AmountOfMoney() { + } + + public AmountOfMoney(Integer value) { + this.value = value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } + + public void initWithDefaults() { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(AmountOfMoney.class); + public IASN1PreparedElementData getPreparedData() { + return preparedData; + } + + + } + \ No newline at end of file diff --git a/tests/src/pokerth_protocol/EndOfHandHideCards.java b/tests/src/pokerth_protocol/EndOfHandHideCards.java index 39536709..d221650d 100644 --- a/tests/src/pokerth_protocol/EndOfHandHideCards.java +++ b/tests/src/pokerth_protocol/EndOfHandHideCards.java @@ -23,31 +23,15 @@ import org.bn.types.*; private NonZeroId playerId = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "moneyWon", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer moneyWon = null; + private AmountOfMoney moneyWon = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "playerMoney", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer playerMoney = null; + private AmountOfMoney playerMoney = null; @@ -63,25 +47,25 @@ import org.bn.types.*; - public Integer getMoneyWon () { + public AmountOfMoney getMoneyWon () { return this.moneyWon; } - public void setMoneyWon (Integer value) { + public void setMoneyWon (AmountOfMoney value) { this.moneyWon = value; } - public Integer getPlayerMoney () { + public AmountOfMoney getPlayerMoney () { return this.playerMoney; } - public void setPlayerMoney (Integer value) { + public void setPlayerMoney (AmountOfMoney value) { this.playerMoney = value; } diff --git a/tests/src/pokerth_protocol/InitialAmountOfMoney.java b/tests/src/pokerth_protocol/InitialAmountOfMoney.java new file mode 100644 index 00000000..47ad5775 --- /dev/null +++ b/tests/src/pokerth_protocol/InitialAmountOfMoney.java @@ -0,0 +1,58 @@ + +package pokerth_protocol; +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +import org.bn.*; +import org.bn.annotations.*; +import org.bn.annotations.constraints.*; +import org.bn.coders.*; +import org.bn.types.*; + + + + + @ASN1PreparedElement + @ASN1BoxedType ( name = "InitialAmountOfMoney" ) + public class InitialAmountOfMoney implements IASN1PreparedElement { + + @ASN1Integer( name = "InitialAmountOfMoney" ) + @ASN1ValueRangeConstraint ( + + min = 0L, + + max = 1000000L + + ) + + private Integer value; + + public InitialAmountOfMoney() { + } + + public InitialAmountOfMoney(Integer value) { + this.value = value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } + + public void initWithDefaults() { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(InitialAmountOfMoney.class); + public IASN1PreparedElementData getPreparedData() { + return preparedData; + } + + + } + \ No newline at end of file diff --git a/tests/src/pokerth_protocol/InitialNonZeroAmountOfMoney.java b/tests/src/pokerth_protocol/InitialNonZeroAmountOfMoney.java new file mode 100644 index 00000000..7834d85f --- /dev/null +++ b/tests/src/pokerth_protocol/InitialNonZeroAmountOfMoney.java @@ -0,0 +1,58 @@ + +package pokerth_protocol; +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +import org.bn.*; +import org.bn.annotations.*; +import org.bn.annotations.constraints.*; +import org.bn.coders.*; +import org.bn.types.*; + + + + + @ASN1PreparedElement + @ASN1BoxedType ( name = "InitialNonZeroAmountOfMoney" ) + public class InitialNonZeroAmountOfMoney implements IASN1PreparedElement { + + @ASN1Integer( name = "InitialNonZeroAmountOfMoney" ) + @ASN1ValueRangeConstraint ( + + min = 1L, + + max = 1000000L + + ) + + private Integer value; + + public InitialNonZeroAmountOfMoney() { + } + + public InitialNonZeroAmountOfMoney(Integer value) { + this.value = value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public Integer getValue() { + return this.value; + } + + public void initWithDefaults() { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(InitialNonZeroAmountOfMoney.class); + public IASN1PreparedElementData getPreparedData() { + return preparedData; + } + + + } + \ No newline at end of file diff --git a/tests/src/pokerth_protocol/MyActionRequestMessage.java b/tests/src/pokerth_protocol/MyActionRequestMessage.java index 750f9f1a..b4088a93 100644 --- a/tests/src/pokerth_protocol/MyActionRequestMessage.java +++ b/tests/src/pokerth_protocol/MyActionRequestMessage.java @@ -44,18 +44,10 @@ import org.bn.types.*; private NetPlayerAction myAction = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "myRelativeBet", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer myRelativeBet = null; + private AmountOfMoney myRelativeBet = null; @@ -107,13 +99,13 @@ import org.bn.types.*; - public Integer getMyRelativeBet () { + public AmountOfMoney getMyRelativeBet () { return this.myRelativeBet; } - public void setMyRelativeBet (Integer value) { + public void setMyRelativeBet (AmountOfMoney value) { this.myRelativeBet = value; } diff --git a/tests/src/pokerth_protocol/NetGameInfo.java b/tests/src/pokerth_protocol/NetGameInfo.java index e0cf56df..035e8942 100644 --- a/tests/src/pokerth_protocol/NetGameInfo.java +++ b/tests/src/pokerth_protocol/NetGameInfo.java @@ -295,34 +295,17 @@ import org.bn.types.*; private Integer firstSmallBlind = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 1000000L - - ) - + @ASN1Element ( name = "endRaiseSmallBlindValue", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer endRaiseSmallBlindValue = null; + private InitialAmountOfMoney endRaiseSmallBlindValue = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 1L, - - max = 1000000L - - ) - + @ASN1Element ( name = "startMoney", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer startMoney = null; + private InitialNonZeroAmountOfMoney startMoney = null; - @ASN1Integer( name = "" ) - + @ASN1SequenceOf( name = "manualBlinds", isSetOf = false ) @ASN1ValueRangeConstraint ( @@ -335,7 +318,7 @@ import org.bn.types.*; @ASN1Element ( name = "manualBlinds", isOptional = false , hasTag = false , hasDefaultValue = false ) - private java.util.Collection manualBlinds = null; + private java.util.Collection manualBlinds = null; @@ -447,37 +430,37 @@ import org.bn.types.*; - public Integer getEndRaiseSmallBlindValue () { + public InitialAmountOfMoney getEndRaiseSmallBlindValue () { return this.endRaiseSmallBlindValue; } - public void setEndRaiseSmallBlindValue (Integer value) { + public void setEndRaiseSmallBlindValue (InitialAmountOfMoney value) { this.endRaiseSmallBlindValue = value; } - public Integer getStartMoney () { + public InitialNonZeroAmountOfMoney getStartMoney () { return this.startMoney; } - public void setStartMoney (Integer value) { + public void setStartMoney (InitialNonZeroAmountOfMoney value) { this.startMoney = value; } - public java.util.Collection getManualBlinds () { + public java.util.Collection getManualBlinds () { return this.manualBlinds; } - public void setManualBlinds (java.util.Collection value) { + public void setManualBlinds (java.util.Collection value) { this.manualBlinds = value; } diff --git a/tests/src/pokerth_protocol/PlayerResult.java b/tests/src/pokerth_protocol/PlayerResult.java index ff0aab5b..af40b2b9 100644 --- a/tests/src/pokerth_protocol/PlayerResult.java +++ b/tests/src/pokerth_protocol/PlayerResult.java @@ -50,31 +50,15 @@ import org.bn.types.*; private Long cardsValue = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "moneyWon", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer moneyWon = null; + private AmountOfMoney moneyWon = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "playerMoney", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer playerMoney = null; + private AmountOfMoney playerMoney = null; @@ -138,25 +122,25 @@ import org.bn.types.*; - public Integer getMoneyWon () { + public AmountOfMoney getMoneyWon () { return this.moneyWon; } - public void setMoneyWon (Integer value) { + public void setMoneyWon (AmountOfMoney value) { this.moneyWon = value; } - public Integer getPlayerMoney () { + public AmountOfMoney getPlayerMoney () { return this.playerMoney; } - public void setPlayerMoney (Integer value) { + public void setPlayerMoney (AmountOfMoney value) { this.playerMoney = value; } diff --git a/tests/src/pokerth_protocol/PlayersActionDoneMessage.java b/tests/src/pokerth_protocol/PlayersActionDoneMessage.java index 02b5ccfd..021ae642 100644 --- a/tests/src/pokerth_protocol/PlayersActionDoneMessage.java +++ b/tests/src/pokerth_protocol/PlayersActionDoneMessage.java @@ -44,57 +44,25 @@ import org.bn.types.*; private NetPlayerAction playerAction = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "totalPlayerBet", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer totalPlayerBet = null; + private AmountOfMoney totalPlayerBet = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "playerMoney", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer playerMoney = null; + private AmountOfMoney playerMoney = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "highestSet", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer highestSet = null; + private AmountOfMoney highestSet = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "minimumRaise", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer minimumRaise = null; + private AmountOfMoney minimumRaise = null; @@ -146,49 +114,49 @@ import org.bn.types.*; - public Integer getTotalPlayerBet () { + public AmountOfMoney getTotalPlayerBet () { return this.totalPlayerBet; } - public void setTotalPlayerBet (Integer value) { + public void setTotalPlayerBet (AmountOfMoney value) { this.totalPlayerBet = value; } - public Integer getPlayerMoney () { + public AmountOfMoney getPlayerMoney () { return this.playerMoney; } - public void setPlayerMoney (Integer value) { + public void setPlayerMoney (AmountOfMoney value) { this.playerMoney = value; } - public Integer getHighestSet () { + public AmountOfMoney getHighestSet () { return this.highestSet; } - public void setHighestSet (Integer value) { + public void setHighestSet (AmountOfMoney value) { this.highestSet = value; } - public Integer getMinimumRaise () { + public AmountOfMoney getMinimumRaise () { return this.minimumRaise; } - public void setMinimumRaise (Integer value) { + public void setMinimumRaise (AmountOfMoney value) { this.minimumRaise = value; } diff --git a/tests/src/pokerth_protocol/RejoinPlayerData.java b/tests/src/pokerth_protocol/RejoinPlayerData.java index e2f3a9c8..79eed2c5 100644 --- a/tests/src/pokerth_protocol/RejoinPlayerData.java +++ b/tests/src/pokerth_protocol/RejoinPlayerData.java @@ -23,18 +23,10 @@ import org.bn.types.*; private NonZeroId playerId = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "playerMoney", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer playerMoney = null; + private AmountOfMoney playerMoney = null; @@ -50,13 +42,13 @@ import org.bn.types.*; - public Integer getPlayerMoney () { + public AmountOfMoney getPlayerMoney () { return this.playerMoney; } - public void setPlayerMoney (Integer value) { + public void setPlayerMoney (AmountOfMoney value) { this.playerMoney = value; } diff --git a/tests/src/pokerth_protocol/YourActionRejectedMessage.java b/tests/src/pokerth_protocol/YourActionRejectedMessage.java index 160cb1aa..720288c6 100644 --- a/tests/src/pokerth_protocol/YourActionRejectedMessage.java +++ b/tests/src/pokerth_protocol/YourActionRejectedMessage.java @@ -39,18 +39,10 @@ import org.bn.types.*; private NetPlayerAction yourAction = null; - @ASN1Integer( name = "" ) - @ASN1ValueRangeConstraint ( - - min = 0L, - - max = 10000000L - - ) - + @ASN1Element ( name = "yourRelativeBet", isOptional = false , hasTag = false , hasDefaultValue = false ) - private Integer yourRelativeBet = null; + private AmountOfMoney yourRelativeBet = null; @@ -140,13 +132,13 @@ import org.bn.types.*; - public Integer getYourRelativeBet () { + public AmountOfMoney getYourRelativeBet () { return this.yourRelativeBet; } - public void setYourRelativeBet (Integer value) { + public void setYourRelativeBet (AmountOfMoney value) { this.yourRelativeBet = value; } diff --git a/tests/src/pokerth_test/ChatTest.java b/tests/src/pokerth_test/ChatTest.java index f6fd97cf..a60ea1c6 100644 --- a/tests/src/pokerth_test/ChatTest.java +++ b/tests/src/pokerth_test/ChatTest.java @@ -36,6 +36,7 @@ import pokerth_protocol.ChatRequestMessage.ChatRequestMessageSequenceType; import pokerth_protocol.ChatRequestMessage.ChatRequestMessageSequenceType.ChatRequestTypeChoiceType; import pokerth_protocol.NetGameInfo.EndRaiseModeEnumType; import pokerth_protocol.NetGameInfo.NetGameTypeEnumType; +import pokerth_protocol.InitialNonZeroAmountOfMoney; public class ChatTest extends TestBase { @@ -162,7 +163,7 @@ public class ChatTest extends TestBase { assertEquals(playerId[0], msg.getChatMessage().getValue().getChatType().getChatTypePrivate().getPlayerId().getValue().longValue()); // Game messages can be sent by registered users within a game. - Collection l = new ArrayList(); + Collection l = new ArrayList(); NetGameInfo gameInfo = createGameInfo(5, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 100, GuestUser + " game list normal game", l, 10, 0, 2, 2000); sendMessage(createGameRequestMsg( gameInfo, diff --git a/tests/src/pokerth_test/CreateGameTest.java b/tests/src/pokerth_test/CreateGameTest.java index 304f984e..23c694d2 100644 --- a/tests/src/pokerth_test/CreateGameTest.java +++ b/tests/src/pokerth_test/CreateGameTest.java @@ -34,10 +34,10 @@ public class CreateGameTest extends TestBase { public void testJoinGameRequestMessage() throws Exception { guestInit(); - Collection l = new ArrayList(); - l.add(250); - l.add(600); - l.add(1000); + Collection l = new ArrayList(); + l.add(new InitialNonZeroAmountOfMoney(250)); + l.add(new InitialNonZeroAmountOfMoney(600)); + l.add(new InitialNonZeroAmountOfMoney(1000)); NetGameInfo gameInfo = createGameInfo(8, EndRaiseModeEnumType.EnumType.raiseByEndValue, 1000, 100, GuestUser + " create test game", l, 10, 0, 7, 2000); sendMessage(createGameRequestMsg( gameInfo, diff --git a/tests/src/pokerth_test/CreateRankingGameTest.java b/tests/src/pokerth_test/CreateRankingGameTest.java index 0213b21b..2b91db17 100644 --- a/tests/src/pokerth_test/CreateRankingGameTest.java +++ b/tests/src/pokerth_test/CreateRankingGameTest.java @@ -35,7 +35,7 @@ public class CreateRankingGameTest extends TestBase { private void createRankingGame(String password) throws Exception { counter++; - Collection l = new ArrayList(); + Collection l = new ArrayList(); NetGameInfo gameInfo = createGameInfo(8, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 50, GuestUser + " create ranking game " + counter, l, 10, 0, 11, 10000); sendMessage(createGameRequestMsg( gameInfo, diff --git a/tests/src/pokerth_test/GameListTest.java b/tests/src/pokerth_test/GameListTest.java index 012e4b0e..d71f77fb 100644 --- a/tests/src/pokerth_test/GameListTest.java +++ b/tests/src/pokerth_test/GameListTest.java @@ -33,6 +33,7 @@ import pokerth_protocol.NetGameMode; import pokerth_protocol.PokerTHMessage; import pokerth_protocol.NetGameInfo.EndRaiseModeEnumType; import pokerth_protocol.NetGameInfo.NetGameTypeEnumType; +import pokerth_protocol.InitialNonZeroAmountOfMoney; public class GameListTest extends TestBase { @@ -67,7 +68,7 @@ public class GameListTest extends TestBase { assertTrue(msg.isPlayerListMessageSelected()); // Create a new game. - Collection l = new ArrayList(); + Collection l = new ArrayList(); NetGameInfo gameInfo = createGameInfo(5, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 100, GuestUser + " game list normal game", l, 10, 0, 2, 2000); sendMessage(createGameRequestMsg( gameInfo, diff --git a/tests/src/pokerth_test/LoadTest.java b/tests/src/pokerth_test/LoadTest.java index 78ed3f85..8b6c06d8 100644 --- a/tests/src/pokerth_test/LoadTest.java +++ b/tests/src/pokerth_test/LoadTest.java @@ -64,7 +64,7 @@ public class LoadTest extends TestBase { fail("Invalid message."); } - Collection l = new ArrayList(); + Collection l = new ArrayList(); String gameName = AuthUser + " load game " + i; NetGameInfo gameInfo = createGameInfo(5, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 200, gameName, l, 10, 0, 1, 10000); sendMessage(createGameRequestMsg( @@ -142,7 +142,7 @@ public class LoadTest extends TestBase { myRequest.setGameState(msg.getPlayersTurnMessage().getValue().getGameState()); myRequest.setHandNum(new NonZeroId(handNum)); myRequest.setMyAction(action); - myRequest.setMyRelativeBet(0); + myRequest.setMyRelativeBet(new AmountOfMoney(0)); MyActionRequestMessage myAction = new MyActionRequestMessage(); myAction.setValue(myRequest); PokerTHMessage outMsg = new PokerTHMessage(); diff --git a/tests/src/pokerth_test/LobbySubscriptionTest.java b/tests/src/pokerth_test/LobbySubscriptionTest.java index 392ee66b..3fd58807 100644 --- a/tests/src/pokerth_test/LobbySubscriptionTest.java +++ b/tests/src/pokerth_test/LobbySubscriptionTest.java @@ -33,6 +33,7 @@ import pokerth_protocol.NetGameInfo.EndRaiseModeEnumType; import pokerth_protocol.NetGameInfo.NetGameTypeEnumType; import pokerth_protocol.SubscriptionRequestMessage.SubscriptionRequestMessageSequenceType; import pokerth_protocol.SubscriptionRequestMessage.SubscriptionRequestMessageSequenceType.SubscriptionActionEnumType; +import pokerth_protocol.InitialNonZeroAmountOfMoney; public class LobbySubscriptionTest extends TestBase { @@ -59,7 +60,7 @@ public class LobbySubscriptionTest extends TestBase { sendMessage(msg); // Create a new game. - Collection l = new ArrayList(); + Collection l = new ArrayList(); NetGameInfo gameInfo = createGameInfo(5, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 100, GuestUser + " game list normal game", l, 10, 0, 2, 2000); sendMessage(createGameRequestMsg( gameInfo, diff --git a/tests/src/pokerth_test/RunNormalGameTest.java b/tests/src/pokerth_test/RunNormalGameTest.java index ca86379a..dbc0beba 100644 --- a/tests/src/pokerth_test/RunNormalGameTest.java +++ b/tests/src/pokerth_test/RunNormalGameTest.java @@ -37,6 +37,7 @@ import pokerth_protocol.NetGameInfo.EndRaiseModeEnumType; import pokerth_protocol.NetGameInfo.NetGameTypeEnumType; import pokerth_protocol.StartEventAckMessage.StartEventAckMessageSequenceType; import pokerth_protocol.StartEventMessage.StartEventMessageSequenceType; +import pokerth_protocol.InitialNonZeroAmountOfMoney; public class RunNormalGameTest extends TestBase { @@ -45,7 +46,7 @@ public class RunNormalGameTest extends TestBase { public void testRunNormalGameAsGuest() throws Exception { guestInit(); - Collection l = new ArrayList(); + Collection l = new ArrayList(); NetGameInfo gameInfo = createGameInfo(5, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 100, GuestUser + " run normal game", l, 10, 0, 2, 2000); sendMessage(createGameRequestMsg( gameInfo, @@ -147,14 +148,14 @@ public class RunNormalGameTest extends TestBase { msg = receiveMessage(); if (msg.isEndOfHandMessageSelected()) { if (msg.getEndOfHandMessage().getValue().getEndOfHandType().isEndOfHandHideCardsSelected()) { - lastPlayerMoney = msg.getEndOfHandMessage().getValue().getEndOfHandType().getEndOfHandHideCards().getPlayerMoney(); + lastPlayerMoney = msg.getEndOfHandMessage().getValue().getEndOfHandType().getEndOfHandHideCards().getPlayerMoney().getValue(); } else if (msg.getEndOfHandMessage().getValue().getEndOfHandType().isEndOfHandShowCardsSelected()) { Collection result = msg.getEndOfHandMessage().getValue().getEndOfHandType().getEndOfHandShowCards().getPlayerResults(); assertFalse(result.isEmpty()); long maxPlayerMoney = 0; for (Iterator it = result.iterator(); it.hasNext(); ) { PlayerResult r = it.next(); - long curMoney = r.getPlayerMoney(); + long curMoney = r.getPlayerMoney().getValue(); if (curMoney > maxPlayerMoney) { maxPlayerMoney = curMoney; } diff --git a/tests/src/pokerth_test/RunRankingGameTest.java b/tests/src/pokerth_test/RunRankingGameTest.java index cc9cbcd2..d3f390c2 100644 --- a/tests/src/pokerth_test/RunRankingGameTest.java +++ b/tests/src/pokerth_test/RunRankingGameTest.java @@ -26,7 +26,6 @@ import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; -import java.util.StringTokenizer; import org.junit.Test; @@ -58,7 +57,7 @@ public class RunRankingGameTest extends TestBase { fail("Invalid message."); } - Collection l = new ArrayList(); + Collection l = new ArrayList(); String gameName = AuthUser + " run ranking game"; NetGameInfo gameInfo = createGameInfo(5, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 50, gameName, l, 10, 0, 11, 10000); sendMessage(createGameRequestMsg( @@ -216,7 +215,7 @@ public class RunRankingGameTest extends TestBase { myRequest.setGameState(msg.getPlayersTurnMessage().getValue().getGameState()); myRequest.setHandNum(new NonZeroId(handNum)); myRequest.setMyAction(action); - myRequest.setMyRelativeBet(0); + myRequest.setMyRelativeBet(new AmountOfMoney(0)); MyActionRequestMessage myAction = new MyActionRequestMessage(); myAction.setValue(myRequest); PokerTHMessage outMsg = new PokerTHMessage(); @@ -237,7 +236,7 @@ public class RunRankingGameTest extends TestBase { myRequest.setGameState(inMsg.getPlayersTurnMessage().getValue().getGameState()); myRequest.setHandNum(new NonZeroId(handNum)); myRequest.setMyAction(action); - myRequest.setMyRelativeBet(0); + myRequest.setMyRelativeBet(new AmountOfMoney(0)); MyActionRequestMessage myAction = new MyActionRequestMessage(); myAction.setValue(myRequest); PokerTHMessage outMsg = new PokerTHMessage(); @@ -247,14 +246,14 @@ public class RunRankingGameTest extends TestBase { } else if (inMsg.isEndOfHandMessageSelected()) { if (inMsg.getEndOfHandMessage().getValue().getEndOfHandType().isEndOfHandHideCardsSelected()) { - lastPlayerMoney = inMsg.getEndOfHandMessage().getValue().getEndOfHandType().getEndOfHandHideCards().getPlayerMoney(); + lastPlayerMoney = inMsg.getEndOfHandMessage().getValue().getEndOfHandType().getEndOfHandHideCards().getPlayerMoney().getValue(); } else if (inMsg.getEndOfHandMessage().getValue().getEndOfHandType().isEndOfHandShowCardsSelected()) { Collection result = inMsg.getEndOfHandMessage().getValue().getEndOfHandType().getEndOfHandShowCards().getPlayerResults(); assertFalse(result.isEmpty()); long maxPlayerMoney = 0; for (Iterator it = result.iterator(); it.hasNext(); ) { PlayerResult r = it.next(); - long curMoney = r.getPlayerMoney(); + long curMoney = r.getPlayerMoney().getValue(); if (curMoney > maxPlayerMoney) { maxPlayerMoney = curMoney; } diff --git a/tests/src/pokerth_test/StartNormalGameTest.java b/tests/src/pokerth_test/StartNormalGameTest.java index 7d2c773e..4ee777a5 100644 --- a/tests/src/pokerth_test/StartNormalGameTest.java +++ b/tests/src/pokerth_test/StartNormalGameTest.java @@ -35,7 +35,7 @@ public class StartNormalGameTest extends TestBase { public void testGameStartMessage() throws Exception { guestInit(); - Collection l = new ArrayList(); + Collection l = new ArrayList(); NetGameInfo gameInfo = createGameInfo(10, EndRaiseModeEnumType.EnumType.doubleBlinds, 0, 100, GuestUser + " start normal game", l, 10, 0, 11, 20000); sendMessage(createGameRequestMsg( gameInfo, diff --git a/tests/src/pokerth_test/TestBase.java b/tests/src/pokerth_test/TestBase.java index 5aa9213f..078eecd0 100644 --- a/tests/src/pokerth_test/TestBase.java +++ b/tests/src/pokerth_test/TestBase.java @@ -288,13 +288,13 @@ public abstract class TestBase { } public NetGameInfo createGameInfo(int delayBetweenHands, EndRaiseModeEnumType.EnumType endMode, int endRaiseValue, int sb, String gameName, - Collection manualBlinds, int maxNumPlayers, int raiseEveryMinutes, int raiseEveryHands, int startMoney) { + Collection manualBlinds, int maxNumPlayers, int raiseEveryMinutes, int raiseEveryHands, int startMoney) { NetGameInfo gameInfo = new NetGameInfo(); EndRaiseModeEnumType endRaise = new EndRaiseModeEnumType(); endRaise.setValue(endMode); gameInfo.setDelayBetweenHands(delayBetweenHands); gameInfo.setEndRaiseMode(endRaise); - gameInfo.setEndRaiseSmallBlindValue(endRaiseValue); + gameInfo.setEndRaiseSmallBlindValue(new InitialAmountOfMoney(endRaiseValue)); gameInfo.setFirstSmallBlind(sb); gameInfo.setGameName(gameName); gameInfo.setManualBlinds(manualBlinds); @@ -307,7 +307,7 @@ public abstract class TestBase { raiseInterval.selectRaiseEveryHands(raiseEveryHands); } gameInfo.setRaiseIntervalMode(raiseInterval); - gameInfo.setStartMoney(startMoney); + gameInfo.setStartMoney(new InitialNonZeroAmountOfMoney(startMoney)); return gameInfo; }