Client
Class ClientModelTest

java.lang.Object
  extended by Client.ClientModelTest

public class ClientModelTest
extends java.lang.Object

The ClientModelTest will test all methods of the model assuming that the server is working correctly. There is no real point to testing the model by itself without the server since all of its functionality depends on the server. It is tested apart from the GUI. Although the GUI pops up as a function of the way we have written out code, it is not used in the tests of the models. Instead, the model solely tests inputing commands to the server and seeing that the correct output from the server is given. This test file will test all the methods in the model as well as catch potential synchronization conditions. All tests test whether the correct message is sent to the server by the server response. The server responses are auxiliary and are actually not tested. What is test is whether the right inputs are sent to the server by the methods in the model Due to the nature of the tests, each test uses multiple users. Therefore, race conditions are tested allow with the methods and there is no real reason to test race conditions separately without resulting in redundant testing. The background thread has to be tested with the GUI since there is no clean way to decouple the two.


Field Summary
static java.lang.String convoID
           
 
Constructor Summary
ClientModelTest()
           
 
Method Summary
 void requestSameUsernameTest()
          Tests requesting a username that is rejected.
 void requestUsernameTest()
          Tests the request a username that is accepted test.
 void sendConvoInviteTest()
          Tests sending an invite to someone for an already existing conversation.
 void startNewConvTest()
          Tests starting a conversation.
 void usersOnlineTest()
          Tests seeing who's online in a conversation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

convoID

public static java.lang.String convoID
Constructor Detail

ClientModelTest

public ClientModelTest()
Method Detail

requestUsernameTest

public void requestUsernameTest()
Tests the request a username that is accepted test.


requestSameUsernameTest

public void requestSameUsernameTest()
Tests requesting a username that is rejected.


startNewConvTest

public void startNewConvTest()
Tests starting a conversation.


sendConvoInviteTest

public void sendConvoInviteTest()
Tests sending an invite to someone for an already existing conversation.


usersOnlineTest

public void usersOnlineTest()
Tests seeing who's online in a conversation.