In order to build and run these executables, you need to install JDK 1.8 (available here)
Maven command to build the Server JAR:
mvn package -P server
Maven command to build the Client (CLI) JAR:
mvn package -P client-cli
Maven command to build the Client (GUI) JAR:
mvn package -P client-gui
JAR Executable files are placed in /deliveries/executables folder.
To run the Server Executable, run this command from terminal / cmd:
java -jar server.jar
To run the CLI Client Executable, run this command from terminal / cmd:
java -jar cli.jar
If you're on Windows, you should first run this command to allow the game to use ANSI codes to show its beautiful (and colorful) CLI interface:
REG ADD HKCU\CONSOLE /f /v VirtualTerminalLevel /t REG_DWORD /d 1
To run the GUI Client Executable, you have 2 options: the classic command from terminal / cmd:
java -jar gui.jar
Or, if you are on Windows or macOS, you can simply double click the JAR file.
Dependency | Usage |
---|---|
maven |
Package manager used for building and managing the project, with a particular focus on lifecycle handling (running tests, building executables). |
junit |
Tool used to unit test Java classes. In particular, it was used in this project to test Model and Controller components (MVC). |
gson |
Used to serialize the game Board as a JSON String in order to avoid the necessity to send complex object through the Socket's stream. |
mockito |
Used as a support to JUnit tests and to improve the code coverage of the tests themselves. It adds the capability to test that a specific method with certain parameter has been called under certain conditions. |
Tests coverage report is available here
mvn test
Note that, to test Server-side concurrency, an intensive stress test has been launched. However, it is marked as @Disabled in production (it won't run with mvn test
) to make the test phase faster (that test lasts ~20 seconds).
JavaDoc can be found here
- Complete rule set of the game;
- CLI;
- GUI;
- Socket communication between server and client.
- Multiple matches at the same time;
- 5 Advanced Gods implemented.