Updating test files for new protocol version.
This commit is contained in:
@@ -118,6 +118,12 @@ import org.bn.types.*;
|
||||
|
||||
private String password = null;
|
||||
|
||||
@ASN1Boolean( name = "" )
|
||||
|
||||
@ASN1Element ( name = "autoLeave", isOptional = false , hasTag = false , hasDefaultValue = false )
|
||||
|
||||
private Boolean autoLeave = null;
|
||||
|
||||
|
||||
|
||||
public JoinGameActionChoiceType getJoinGameAction () {
|
||||
@@ -148,6 +154,18 @@ import org.bn.types.*;
|
||||
|
||||
|
||||
|
||||
public Boolean getAutoLeave () {
|
||||
return this.autoLeave;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setAutoLeave (Boolean value) {
|
||||
this.autoLeave = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void initWithDefaults() {
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ import org.bn.types.*;
|
||||
@ASN1Integer( name = "" )
|
||||
@ASN1ValueRangeConstraint (
|
||||
|
||||
min = 5L,
|
||||
min = 0L,
|
||||
|
||||
max = 60L
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ public class CreateGameTest extends TestBase {
|
||||
NetGameTypeEnumType.EnumType.normalGame,
|
||||
20,
|
||||
7,
|
||||
GamePassword));
|
||||
GamePassword,
|
||||
false));
|
||||
|
||||
PokerTHMessage msg;
|
||||
msg = receiveMessage();
|
||||
|
||||
@@ -42,7 +42,8 @@ public class CreateRankingGameTest extends TestBase {
|
||||
NetGameTypeEnumType.EnumType.rankingGame,
|
||||
20,
|
||||
7,
|
||||
password));
|
||||
password,
|
||||
false));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -48,7 +48,8 @@ public class RunNormalGameTest extends TestBase {
|
||||
NetGameTypeEnumType.EnumType.normalGame,
|
||||
10,
|
||||
5,
|
||||
""));
|
||||
"",
|
||||
false));
|
||||
|
||||
PokerTHMessage msg;
|
||||
|
||||
|
||||
@@ -95,7 +95,8 @@ public class RunRankingGameTest extends TestBase {
|
||||
NetGameTypeEnumType.EnumType.rankingGame,
|
||||
5,
|
||||
7,
|
||||
""));
|
||||
"",
|
||||
false));
|
||||
|
||||
PokerTHMessage msg;
|
||||
|
||||
@@ -134,7 +135,7 @@ public class RunRankingGameTest extends TestBase {
|
||||
String username = "test" + (i+1);
|
||||
String password = username;
|
||||
playerId[i] = userInit(s[i], username, password);
|
||||
sendMessage(joinGameRequestMsg(gameId, ""), s[i]);
|
||||
sendMessage(joinGameRequestMsg(gameId, "", false), s[i]);
|
||||
do {
|
||||
msg = receiveMessage(s[i]);
|
||||
failOnErrorMessage(msg);
|
||||
|
||||
@@ -42,7 +42,8 @@ public class StartNormalGameTest extends TestBase {
|
||||
NetGameTypeEnumType.EnumType.normalGame,
|
||||
10,
|
||||
7,
|
||||
""));
|
||||
"",
|
||||
false));
|
||||
|
||||
PokerTHMessage msg;
|
||||
msg = receiveMessage();
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.Collection;
|
||||
|
||||
public abstract class TestBase {
|
||||
|
||||
public final int PROTOCOL_VERSION_MAJOR = 1;
|
||||
public final int PROTOCOL_VERSION_MAJOR = 2;
|
||||
public final int PROTOCOL_VERSION_MINOR = 0;
|
||||
public final String AuthUser = "user";
|
||||
public final String AuthPassword = "pencil";
|
||||
@@ -198,7 +198,7 @@ public abstract class TestBase {
|
||||
return playerId;
|
||||
}
|
||||
|
||||
public PokerTHMessage createGameRequestMsg(NetGameInfo gameInfo, NetGameTypeEnumType.EnumType type, int playerActionTimeout, int guiSpeed, String password) {
|
||||
public PokerTHMessage createGameRequestMsg(NetGameInfo gameInfo, NetGameTypeEnumType.EnumType type, int playerActionTimeout, int guiSpeed, String password, boolean autoLeave) {
|
||||
NetGameTypeEnumType gameType = new NetGameTypeEnumType();
|
||||
gameType.setValue(type);
|
||||
gameInfo.setNetGameType(gameType);
|
||||
@@ -213,6 +213,7 @@ public abstract class TestBase {
|
||||
if (!password.isEmpty()) {
|
||||
joinType.setPassword(password);
|
||||
}
|
||||
joinType.setAutoLeave(autoLeave);
|
||||
JoinGameRequestMessage joinRequest = new JoinGameRequestMessage();
|
||||
joinRequest.setValue(joinType);
|
||||
|
||||
@@ -221,7 +222,7 @@ public abstract class TestBase {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public PokerTHMessage joinGameRequestMsg(long gameId, String password) {
|
||||
public PokerTHMessage joinGameRequestMsg(long gameId, String password, boolean autoLeave) {
|
||||
JoinExistingGame joinExisting = new JoinExistingGame();
|
||||
joinExisting.setGameId(new NonZeroId(gameId));
|
||||
JoinGameActionChoiceType joinAction = new JoinGameActionChoiceType();
|
||||
@@ -231,6 +232,7 @@ public abstract class TestBase {
|
||||
if (!password.isEmpty()) {
|
||||
joinType.setPassword(password);
|
||||
}
|
||||
joinType.setAutoLeave(autoLeave);
|
||||
|
||||
JoinGameRequestMessage joinRequest = new JoinGameRequestMessage();
|
||||
joinRequest.setValue(joinType);
|
||||
|
||||
Reference in New Issue
Block a user