Java
Resources
Gradle Changes
In the build.gradle
file, the JUnit 5 parameters library was added:
dependencies {
// Use JUnit Jupiter API for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2', 'org.hamcrest:hamcrest:2.2', 'org.junit.jupiter:junit-jupiter-params'
// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
// This dependency is used by the application.
implementation 'com.google.guava:guava:29.0-jre'
}
Also, we added a quick section at the bottom to allow Gradle tasks to read input from System.in
:
// Allow run to read from System.in
run{
standardInput = System.in
}
Outline
Here is a basic outline of the steps to follow to complete this example.
- Clone Starter Code from GitHub
git clone <url> java
- Install SDKMAN
curl -s "https://get.sdkman.io" | bash
-
Close and Reopen Terminal to load SDK Man
-
Install Gradle
sdk install gradle 7.6
- Compile, Run & Test Existing Project
cd java
gradle run
gradle test
gradle check
gradle javadoc
-
Confirm that project runs, no style errors, and Javadoc generates properly.
-
Create New Unit Tests and Update Code as Needed. Continuously commit to Git as changes are made!
-
Add Documentation Comments. Continuously commit to Git as changes are made!
-
Add
README.md
and discuss unit tests you feel should be added to adequately test theGuessingGame
class. -
Create a UML Class Diagram for the source code and include it in the project.
-
Confirm that project runs, no style errors related to comments, and Javadoc generates properly.
-
When complete, use Git to commit and push updated code.
git add .
git commit -m "Example Complete"
git push
- On GitHub, create a release tag and submit URL to Canvas for grading.