-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
HsqlIntegrationTest.java
36 lines (29 loc) · 1.2 KB
/
HsqlIntegrationTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package liquibase.dbtest.hsqldb;
import liquibase.database.DatabaseFactory;
import liquibase.database.jvm.JdbcConnection;
import liquibase.dbtest.AbstractIntegrationTest;
import liquibase.util.SystemUtil;
import org.junit.Assume;
import java.sql.SQLSyntaxErrorException;
public class HsqlIntegrationTest extends AbstractIntegrationTest {
public static final String OBJECT_ALREADY_EXISTS = "42504";
public HsqlIntegrationTest() throws Exception {
super("hsqldb", DatabaseFactory.getInstance().getDatabase(SystemUtil.isAtLeastJava11() ? "hsqldb": "none"));
}
@Override
public void setUp() throws Exception {
Assume.assumeTrue(SystemUtil.isAtLeastJava11()) ; // Since HSQLDB 2.7.1 it requires java 11
super.setUp();
try {
// Create schemas for tests testRerunDiffChangeLogAltSchema
((JdbcConnection) getDatabase().getConnection()).getUnderlyingConnection().createStatement().executeUpdate(
"CREATE SCHEMA LBCAT2"
);
} catch (SQLSyntaxErrorException e) {
if (e.getSQLState().equals(OBJECT_ALREADY_EXISTS)) {
// do nothing
}
}
getDatabase().commit();
}
}