Skip to content

Testing Documentation

matteo-barbieri edited this page Oct 10, 2020 · 3 revisions

Testing Summary

  1. Travis CI automatically runs the gradle build upon every commit to the github repository.
  2. Gradle build runs the test suite which contains TestArtseePersistence.java

Persistence Tests

  1. Clear database
  2. Test Address object persistence with test data
  3. Clear database
  4. Test Administrator object persistence with test data
  5. Clear database
  6. Test Artist object persistence with test data
  7. Clear database
  8. Test Customer object persistence with test data
  9. Clear database
  10. Test Artwork object persistence with test data
  11. Clear database
  12. Test Review object persistence with test data
  13. Clear database
  14. Test ArtworkOrder object persistence with test data
  15. Clear database

Example persistence test - Address Object

  1. Create Address object with listed test data
  • addressID = 1
  • addressLine1 = 123 Test st.
  • addressLine2 = Apt 102
  • city = testCity
  • province = testProvince
  • postalCode = A1B2C3
  • country = Canada
  1. Save created Address object to Database.
  2. Retrieve Address object from Database.
  3. Check that the retrieved object exists (assertNotNull).
  4. Check that all attributes of retrieved object equals the attributes of the object that were set in step 1 (AssertEquals).
  5. If steps 4 & 5 are true, Test Passes
  6. Clear the entire database

ALL TESTS FOR ALL OBJECT TYPES PASSED

Required Configurations

Need to set the environment for the following 3 files:

  • project-group-15/Artsee-Backend/src/main/java/com/artsee/backend/ArtseeApplication.java
  • project-group-15/Artsee-Backend/src/test/java/com/artsee/backend/ArtseeApplicationTests.java
  • project-group-15/Artsee-Backend/src/test/java/com/artsee/backend/dao/TestArtseePersistance.java

Variable: SPRING_DATASOURCE_URL
Value: Your Heroku Database URL in the following format: jdbc:postgresql://:/<DATABASE_NAME>?user=&password=&sslmode=require

Heroku Link

Artsee-Backend Heroku App Address