Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.68 KB

DeveloperGuide.md

File metadata and controls

53 lines (37 loc) · 1.68 KB

Developer Guide

Setting up

Prerequisites

  • JDK 8 or later
  • Eclipse IDE

Importing the project into Eclipse

  1. Fork this repo, and clone the fork to your computer
  2. Open Eclipse
  3. Click File > Import
  4. Click General > Existing Projects into Workspace > Next
  5. Click Browse, then locate the project's directory
  6. Click Finish

Design

Testing

System tests

Windows

  1. Open a DOS window in the test folder
  2. Run the runtests.bat script
  3. If the script reports that there is no difference between actual.txt and expected.txt, the test has passed.

Mac/Unix/Linux

  1. Open a terminal window in the test folder
  2. Run the runtests.sh script
  3. If the script reports that there is no difference between actual.txt and expected.txt, the test has passed.

JUnit tests

  • In Eclipse, right-click on the test/java folder and choose Run as > JUnit Test

Troubleshooting test failures

  • Problem: How do I examine the exact differences between actual.txt and expected.txt?
    Solution: You can use a diff/merge tool with a GUI e.g. WinMerge (on Windows)
  • Problem: The two files look exactly the same, but the test script reports they are different.
    Solution: This can happen because the line endings used by Windows is different from Unix-based OSes. Convert the actual.txt to the format used by your OS using some utility.
  • Problem: Test fails during the very first time.
    Solution: The output of the very first test run could be slightly different because the program creates a new storage file. Tests should pass from the 2nd run onwards.