Steps to initialise for running tests: This requires a postgres database because the h2 database causes tests to fail. Environment variables required for tests: BW_DB_ID the postgres db id... BW_DB_PW ...and password BW_DB_NAME name of test database BW_QS path to quickstart e.g. /home/jim/quickstart-dev/ 1. Shut down target server 2. Set up server for tests (save + switch standalone.xml, config) 3. clean logs 4. restore data 5. restart server 6. run test scripts To rerun we omit step 2 To restore we need to stop server, restore standalone.xml and config Setup server for tests 1. Save standalone to xml to file which has name incorporating time 2. Copy in version from quickstart which references postgres db 3. Rename config to folder with date/time in name 4. Copy in config from quickstart Clean logs: 1. empty server log directory Restore data 1. run psql with id and pw and delete test database 2. Delete test database 3. Restore from test db in quickstart 4. Copy in save elastic search data Creating save database 1. delete and recreate calendar db 2. Start system 3. Do schema 4. Do initdata restore 5. Reindex 6. Shut down system 7. Dump the db and copy the ES data