Sales sample project integration tests not working out of the box


Tried the Sales sample project integration tests.

Replaced connection URL like below to avoid starting a host.

        //dbUrl = "jdbc:hsqldb:hsql://localhost:9002/sales_test";
        dbUrl = "jdbc:hsqldb:file:sales_test";

Launched CustomerLoadTest.

Committed Customer instances ok :

15:25:21.648 DEBUG - No implementation is specified for _MAIN_ store, using RdbmsStore
15:25:21.698 DEBUG - commit: commitInstances=[ [new]], removeInstances=[]
15:25:22.148 INFO  hsqldb.db.HSQLDB5E0F4141A2.ENGINE - checkpointClose start
15:25:22.168 INFO  hsqldb.db.HSQLDB5E0F4141A2.ENGINE - checkpointClose end

But then had this issue.

15:25:22.414 INFO - Loading DB-stored app properties cache
java.lang.RuntimeException: Error loading DB-stored app properties cache
Caused by: java.sql.SQLException: user lacks privilege or object not found: SYS_CONFIG Query: select NAME, VALUE from SYS_CONFIG Parameters: []

What is wrong ?


Hi Mike,
First of all, the sample tests do work out of the box. Have you tried what is recommended in README?
A quote:
- Execute startTestDb and createTestDb Gradle tasks in the command line or via the Studio Search dialog.
- To run the tests from the command line, use the test Gradle task.
- To run from an IDE, first execute Build > Assemble project, then Build > Create or update IDE project files. After that you can run tests from the IDE.
It works for me.
One addition though: when running Gradle tasks from the command line, use Gradle wrapper to ensure you use correct version of Gradle (for platform 6.6 it is Gradle 3.4). You can generate wrapper in Studio Build menu. So the commands should look as follows:

gradlew startTestDb createTestDb 
gradlew test 

If you want to run tests on different database, you have to initialize it, otherwise its schema is empty and you get this error “user lacks privilege or object not found: SYS_CONFIG”. Modify database URLs in build.gradle and run gradlew createTestDb prior to running tests.

It works great. Thanks Konstantin.