Acceptance Tests

Testing the three use cases separately is a bit difficult as the three are interconnected. A Client can only declare Bingo after at least four numbers have been drawn, and the HostServer draws numbers only after a client has first joined a game. For this reason, the test sequences for the three use cases are nearly identical and have been combined into one acceptance test; what changes is how to check that each use case has been successfully completed.

Furthermore, the baseline application is not interactive. The Client automatically joins a game and automatically attempts to declare Bingo, so interaction from a human player is neither needed nor allowed. Designs for an interface are already underway, but - for the moment - testing a successful execution is only possible through tracing output statements.

Functionality Baseline
Use Case(s) All
Test distribution http://www.ece.cmu.edu/~ece846/team5/download.htm
Test sequence
  1. Start JBoss on Machine 1.
  2. Run Client as specified in readme.txt.
  3. Compare Client's console to sample text below.
Configuration/deployment issues Code has been tested only on Windows machines; testing on Linux machines is planned for next week.
Known Problems HostServer throws an exception after sending to the JMS the message that the game is stopped.

The Client's console should have output resembling the following:

<Client starts>
Listening for messages on topic/testTopic
Joining a game...
client.Join(): PlayerID:e653246e-8ed2-4545-9b1e-71a6213838b6;GameID:4;Card:6,17,8,11,10,23,21,30,26,35,48,43,0,60,47,74,66,69,67,62,83,97,90,88,92,;Draws:;
PlayerID=e653246e-8ed2-4545-9b1e-71a6213838b6, GameID=4
The PlayerID (in red) is the unique identifier created by the database. The GameID (in green) is the integer created by the database. The Card (in blue) is the Bingo card created by the AnsweringServer and stored in the database. The particular card string above corresponds to the following Bingo card:
 B  I  N  G  O
 6 23 48 74 83 
17 21 43 66 97
 8 30  0 69 90
11 26 60 67 88
10 35 47 62 92
The "B" column runs from 1-20, the "I" column from 21-40, etc. As expected, the center entry is "0" and is a "free spot."

Each Client has its own PlayerID and Card, and each game has its own GameID, verifying the "Join a Game" use case. Your actual values will vary, but the format should match this output.

Later on, the console's output should look like this:

clock=20

..Message received at 20: GID=4; MID=15; DRAW=34

Current Draws: ,88,96,17,15,63,67,81,100,71,3,11,80,51,68,34,


[WARNING] Your Bingo is invalid.
The "clock" message just marks how much time has passed, and the "GID" should (and does) match the GameID from earlier. The MID (in red) is the MessageID, confirming that a message has been received from the Java Message Service (JMS) and verifying the "Draw a Number" use case. This particular message identifies itself as the 15th draw. (All positive MID's identify the draw order; an MID of "0" signals that the game has been stopped.) The DRAW (in green) is the draw itself; in this case, "34."

The Current Draws (in blue) is a running list of the draws. As expected, "34" is the 15th draw. This particular list was held in the Client's memory, but the AnsweringServer allows the Client to retrieve this list from the database, in a procedure that has not yet been fully tested.

The "WARNING" is an artifact of the fact that the Client does not yet check its own card for Bingo. After 10 seconds, the Client automatically starts declaring Bingo to the AnsweringServer; until the Client actually has Bingo, the AnsweringServer returns a value (integer 1) that triggered this particular warning. At the end, the console's output should resemble the following:

..Message received at 46: GID=4; MID=49; DRAW=60

Current Draws: ,88,96,17,15,63,67,81,100,71,3,11,80,51,68,34,31,89,43,55,30,74,98,23,5,22,25,65,49,45,91,35,84,39,52,28,69,20,40,85,21,13,14,48,76,47,78,94,32,60,


[GAMEOVER] You are the WINNER!
Existing the client application... BYE!
"You are the WINNER!" resulted from the AnsweringServer confirming a correct declaration of Bingo, verifying the "Declare Bingo" use case.

After 60 draws, the Client's marked Bingo card would look like this:

 B  I  N  G  O
 6 23 48 74 83 
17 21 43 66 97
 8 30  0 69 90
11 26 60 67 88
10 35 47 62 92
Each number in red appeared in the 60 draws in the list of Current Draws. Bingo is found in the "N" column.

If one were to start multiple clients (which we have done, successfully), only the first Client to declare Bingo and have its PlayerID stored in the database would be the winner. All the others would see the following message:

[GAMEOVER] The current game is over, triggered by MID:0.
Existing the client application... BYE!
In further iterations of development, the Client program will automatically join a new game at the end of each game. At the moment, it terminates after the end of the first game.