OLE JUnit Tests
Tests in KOLE are organized as integration tests and simple unit tests.
Integration Tests - These are tests that require a database connection along with a webcontainer (tomcat/jetty). The location of the tests are under src/it for any module.
Unit Tests - These are tests that don't require a database connection. They are used for quickly testing the flow of the code, coverage using Mock objects. The location of the tests are under src/test for any module.
Tests are run against a TEST database/schema in order to keep production data and test data separate. This is also because the TEST instance is wiped clean before the test suite is run.
Integration Tests:
- Location: src/it
- Configuration files:
- src/it/resources/META-INF/kole-test-config.xml
- src/it/resources/org/kuali/ole/TestHarnessSpringBeans.xml
Steps to run tests locally:
Set up the TEST db instance: The following mvn command will create a TEST instance called OLECI that will have a special table called EN_UNITTEST_T that distinguishes a test db from a production db.
1. cd ${OLE_DEVELOPMENT_WORKSPACE_ROOT} 2. mvn clean install -DskipTests=true 3. cd ${OLE_DEVELOPMENT_WORKSPACE_ROOT}/ole-app/olefs 4. mvn initialize -Pdb-test -Djdbc.username=oleci -Djdbc.password=oleci -Djdbc.dba.username=root -Djdbc.dba.password=root
- Run the entire test suite or run the tests individually
Operated as a Community Resource by the Open Library Foundation