This is the repository for the summative assessment for module BS2202.
For the JavaDoc and further documentation please seek the 'docs' folder in the root directory for the generated JavaDocs.
Once the repo has been cloned or forked, mvn clean install will need to be ran to install all the required dependencies.
If the maven clean install has completed successfully the program can now be ran.
Refer the sql scripts 'DatabaseCreation.sql' and 'TestDatabaseCreation.sql' in order to create the database and tables for the production environment (non-testing) and the testing environment (the database that will be used for tests).
Then the 'Groceries.sql' and 'Nutrients.sql' scripts can be run on the summative database to add entity values that will be used when the application is run.
Note that if Users.sql is used, then the password of the user inserted into the database is 'password' and is an admin account.To run the code locate the HelloApplication class inside src/main/java/com/example/summativeui If running in Intellij there should be a green play button next to the class name, right click this and it will show a pop-up. Click modify run configuration. The run configuration should look like this - Click the once the given run config has been selected, click the green play button and the app should run.
If the javafx imports are giving the error 'not resolved' make sure to reload the project by right clicking the pom.xml file, navigaing to maven and clicking 'Reload Project'.When running a test make sure to add the following CLI argument
-ea --add-opens javafx.graphics/com.sun.javafx.application=ALL-UNNAMED
This solves a permission error caused by javafx.
Make sure to also include the ENVIRONMENT env variable which specifies the given environment the code will be run in. The available options are 'test' and 'production'
Unable to locate any tests error
this is caused by the testfx maven dependency not being loaded properly. To solve this simply remove the testfx.junit5 dependency and reload it. Use version org.testfx:testfx-junit5:4.0.15-alpha
Please see the recorded videos in the test/evidence folder for the recorded evidence of the tests passing.