Important
You may want to read this if you're an examiner.
Note
Assume common UNIX-like CLI tool behaviour
These commands assume a Windows or Linux environment, with Docker, JDK 11 and Maven installed.
-
Package the app:
mvn -DskipTests package -
Start the database Docker container using a config which allows the app to be run outside it's Docker container:
docker compose -f docker-compose.yml -f docker-compose.dev.linux.yml up dbOr if you want to run on a Windows environment:
docker compose -f docker-compose.yml -f docker-compose.windows.linux.yml up db -
Open an interactive REPL prompt:
MYSQL_ROOT_PASSWORD=root java -jar target/pop.jar(ensuring zero arguments) -
Ask for help with the commands:
help -
Run your query and see the output! You will be able to fulfil any requirement (and more!) using the commands in the prompt.
You can also directly evaluate commands from the shell by passing them to the package as command line arguments:
~ $ MYSQL_ROOT_PASSWORD=root java -jar target/pop.jar total --in world
Successfully connected to MySQL database: world
Population of World: 6078749450
Any command that takes a specific place as an argument may have either a name or a primary key supplied (Numeric ID for cities, or country code for countries). If a name is supplied, the place with the highest population will be used in the event of multiple matches.
Places with spaces in their name may be referenced with underscores, so to select the region "Southern Europe", you can use southern_europe. You can also just type "europe" and it will select the place with the higher population.
All commands are case insensitive, including arguments.
Refer to the requirements screenshots for usage examples.
32 requirements of 32 have been implemented, which is 100%.
Note
Very long results have been reduced to the beginning and ending dozen or so.
Note
The command has been included for you to reproduce each screenshot. Bear in mind they were all ran in the package's interactive REPL mode.
Each square is a file, color-coded to how much of it is being tested.
- The
.envfile stores some repeated variables for the build process for the docker containers - The
./build.shfile simply builds the Maven project, then builds the docker containers- You can run the file from your command line by typing
./build.sh
- You can run the file from your command line by typing
- The
./start.shfile starts the entire project, it works similarly to above, and will build the project if it needs to, but if you edit it, you will need to rerun./build.sh - To completely reset all the docker containers, run:
docker compose rm, and select "Yes" - Changing
MYSQL_ROOT_PASSWORDrequiresdocker compose rmto be run








































