https://prime-rest-java.herokuapp.com/
./gradlew clean test jacocoTestReport
Code coverage will be available at build/reports/jacoco/test/html/index.html
.
Now we have 99%
code coverage.
./gradlew clean integrationTest
./gradlew build
Build is available at build/libs/prime-rest-0.0.1-SNAPSHOT.jar
java -jar build/libs/prime-rest-0.0.1-SNAPSHOT.jar
- Dev
wercker dev --publish 8080
Above command will run the application in a docker container setup by wercker
- Build
wercker build
- PathExtension - *.xml and *.json
- Url parameter - mediaType=xml and mediaType=json
- Accept header
- application/xml
- application/json
- Prime numbers are can be cached at http level
- Cache-Control max-age set to high value (1 year)
- ETag filter enabled to check if document in modified
- Memoization technique applied for performance optimization
- Known primes are collected in memory to avoid recalculation of primality
- Even numbers are skipped from primality check, as 2 is the only even prime number
- At the moment this can only give list of prime numbers till 2147483647, which is max limit of int type