Sales sample project integration tests not working out of the box

Hi

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 com.haulmont.cuba.core.app.StoreFactory - No implementation is specified for _MAIN_ store, using RdbmsStore
15:25:21.698 DEBUG com.haulmont.cuba.core.app.RdbmsStore - commit: commitInstances=[com.company.sales.entity.Customer-0708cb71-4773-c66b-1d49-dff24ac73f80 [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  com.haulmont.cuba.core.app.ConfigStorage - 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 ?

Mike

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.