Prerequisites
- JDK 8 or later
- Eclipse IDE
Importing the project into Eclipse
- Fork this repo, and clone the fork to your computer
- Open Eclipse
- Click
File>Import - Click
General>Existing Projects into Workspace>Next - Click
Browse, then locate the project's directory - Click
Finish
Windows
- Open a DOS window in the
testfolder - Run the
runtests.batscript - If the script reports that there is no difference between
actual.txtandexpected.txt, the test has passed.
Mac/Unix/Linux
- Open a terminal window in the
testfolder - Run the
runtests.shscript - If the script reports that there is no difference between
actual.txtandexpected.txt, the test has passed.
- In Eclipse, right-click on the
test/javafolder and chooseRun as>JUnit Test
- Problem: How do I examine the exact differences between
actual.txtandexpected.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.
