Skip to content

harrymt/HarrysChatServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages