Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 2.33 KB

README.md

File metadata and controls

79 lines (56 loc) · 2.33 KB

Pop3 Chat Server

Build Status codebeat badge Codacy Badge BCH compliance

Written for the University of Nottingham unit, Software Quality Management.

Build

java -jar chatServer.jar

Test

telnet localhost 9000

The project uses:

Unit tests using JUnit

ITestMESG.java - example unit test

@Test
public void testMesgParameterEmptyString() {
  client.sendMessage("MESG ");
  
  assertEquals(
         "Test mesg parameters as empty string",
         "BAD You have not logged in yet",
         client.getLastServerResponse()
  );
}

GUI tests using FEST

@Test
public void showInvalidCommandFromClient() throws InterruptedException {
  clientGUI.textBox(textFieldUserInput).enterText("MESG  ");
  clientGUI.button(btnSend).click();

  // Wait until GUI has written to text box
  clientGUI.robot.waitForIdle();

  String response = getLastResponseWritten(clientGUI.textBox(textAreaOutputText).text());
  assertEquals("Check bad server response.", response, ">Invalid Command");
}

Pre-Flight Server with Travis CI.

.travis.yml:

language: java
jdk:
  - oraclejdk8
env:
  - DISPLAY=:99.0
before_install:
  - sh -e /etc/init.d/xvfb start