Progetto di Ingegneria del Software A.A. 2019-2020
Professor: Prof. Gianpaolo Cugola
Group: GC02
Students:
- Andrea Riva (immatriculation number: 887449)
- Alessandro Sanvito (immatriculation number: 891196)
- Kien Tuong Truong (immatriculation number: 887907)
Feature | Implemented |
---|---|
All the rules ("Regole complete") | ✔️ |
CLI | ✔️ |
GUI | ✔️ |
Socket | ✔️ |
Advanced functionality 1 (FA 1) | ✔️ Multiple matches ("Partite multiple") |
Advanced functionality 2 (FA 2) | ✔️ Advanced Gods ("Divinità avanzate"): Hera, Hestia, Hypnus, Triton, Zeus |
Extensive testing was performed on all parts of the software, both by writing unit tests and with manual QA. The unit tests cover 95% of the lines of the server components as a whole. The few non-covered lines mainly deal with runtime exceptions, such as the interruption of a thread caused by an exit request. The client has less unit tests since most of it deals with UI-specific functions that would have need to be mocked, thus resulting in testing the mocks more than the client itself. In any case, the classes dealing with the model representation are covered by unit tests.
The unit tests run automatically at each commit thanks to a Continuous Integration pipeline.
Refer to the deliverables/report/
folder for further details on the unit tests.
To run the tests and compile the software:
- Install Java SE 14
- Install Maven
- Clone this repo
- In the cloned repo folder, run:
mvn package
- The compiled artifact (
Santorini.jar
) will be inside thetarget
folder.
The following commands are meant to be run inside the deliverables/
folder.
- In a terminal window, run:
Santorini-Server.bat
You need to enable the support to UTF-8 characters in the terminal:
- Open the
Area geografica
control panel (Run >intl.cpl
) - In the
Opzioni di amministrazione
tab, chooseCambia impostazioni locali del sistema
and checkBeta: utilizzare Unicode UTF-8 per il supporto della lingua a livello mondiale
. - In a terminal window, run:
For the GUI:
Santorini-Client.bat
For the CLI:
Requirement: a terminal window of at least 105 columns by 30 rows.
Santorini-Client.bat cli
- In a terminal window, run:
./Santorini-Server.sh
- In a terminal window, run:
For the GUI:
./Santorini-Client.sh
For the CLI:
Requirement: a terminal window of at least 105 columns by 30 rows.
./Santorini-Client.sh cli
Name | Description | Allowed values |
---|---|---|
CLI_INPUT_FILE |
Uses the specified file as source for the input to the CLI | A relative or absolute file path. Default: empty (stdin is used for input) |
CLI_LOG_INPUTS_FOLDER |
The folder in which to log all the inputs from the CLI | A relative or absolute folder path, including the trailing / . Default: empty (do not log inputs) |
LANGUAGE |
Sets the desired language for the user interface | en , it . Default: the system default language |
LOG_LEVEL |
Sets the log messages verbosity | All the values specified in java.util.logging.Level. Default: INFO |
CONFIG_BASE_PATH |
The folder in which the program will look for properties file (See the Configuration section) | A relative or absolute folder path, including the trailing / . Default: empty (use default configuration values) |
Some configurations can be overridden by copying the config
folder of this repository on your system and by setting the CONFIG_BASE_PATH
environment variable to point to that folder.
The configurations inside the folder will override all the default values. Remember to remove the .example
extension from the file names.
Miscellaneous properties required by both Server and Client
Name | Description | Type | Default Value |
---|---|---|---|
projectName |
The name of the project. Used as a MOTD in the logs. | String | Santorini |
version |
The current version of the project. Used as a MOTD in the logs. | String | N/A |
authors |
The authors of the project | String | A. Riva, A. Sanvito & K. T. Truong |
keepAliveIntervalMs |
The time in millisecond that should pass between each keepAlive message sent on the connection | Integer | 15000 |
nicknameMaxLength |
The maximum length allowed for a player's nickname | Integer | 30 |
Server related properties
Name | Description | Type | Default Value |
---|---|---|---|
serverPort |
The port on which the server should listen for inbound connections | Integer | 7268 |
numberOfThreads |
The number of threads allowed to run at the same time to handle concurrent matches | Integer | 32 |
The software has been written using Java SE 14.
The IDE used for the development is IntelliJ Idea 2020.1.
To correctly see the colors in the CLI version of the client in the Run
window of IntelliJ, add this VM option
in the RunConfiguration of ClientApp:
-Djansi.passthrough=true
Please, be aware that some CLI features (such as the screen blanking or the positioning of some parts of the user interface) can't be rendered correctly in the Run
window of IntelliJ.
The Run
window of IntelliJ is meant just for debugging and testing purposes.
Run the compiled JAR in a terminal to benefit from the full experience.