01: package liquibase.database;
02:
03: import junit.framework.TestCase;
04:
05: public class HsqlDatabaseTest extends TestCase {
06: public void testGetDefaultDriver() {
07: Database database = new HsqlDatabase();
08:
09: assertEquals("org.hsqldb.jdbcDriver", database
10: .getDefaultDriver("jdbc:hsqldb:mem:liquibase"));
11:
12: assertNull(database
13: .getDefaultDriver("jdbc:oracle://localhost;databaseName=liquibase"));
14: }
15:
16: public void testGetConcatSql() {
17: Database database = new HsqlDatabase();
18: String expectedResult = "CONCAT(str1, CONCAT(str2, CONCAT(str3, str4)))";
19: String value = "v";
20: String[] values = new String[] { "str1", "str2", "str3", "str4" };
21:
22: assertEquals(database.getConcatSql(value), value);
23: assertEquals(database.getConcatSql(values), expectedResult);
24: assertNull(database.getConcatSql((String[]) null));
25: }
26:
27: }
|