01: package liquibase.database;
02:
03: import static org.junit.Assert.*;
04: import org.junit.Test;
05:
06: public class H2DatabaseTest extends AbstractDatabaseTest {
07:
08: public H2DatabaseTest() throws Exception {
09: super (new H2Database());
10: }
11:
12: protected String getProductNameString() {
13: return "H2";
14: }
15:
16: @Test
17: public void getBlobType() {
18: assertEquals("LONGVARBINARY", getDatabase().getBlobType());
19: }
20:
21: @Test
22: public void supportsInitiallyDeferrableColumns() {
23: assertFalse(getDatabase().supportsInitiallyDeferrableColumns());
24: }
25:
26: @Test
27: public void getBooleanType() {
28: assertEquals("BOOLEAN", getDatabase().getBooleanType());
29: }
30:
31: @Test
32: public void getCurrencyType() {
33: assertEquals("DECIMAL", getDatabase().getCurrencyType());
34: }
35:
36: @Test
37: public void getUUIDType() {
38: assertEquals("VARCHAR(36)", getDatabase().getUUIDType());
39: }
40:
41: @Test
42: public void getClobType() {
43: assertEquals("LONGVARCHAR", getDatabase().getClobType());
44: }
45:
46: @Test
47: public void getDateType() {
48: assertEquals("DATE", getDatabase().getDateType());
49: }
50:
51: @Test
52: public void getDateTimeType() {
53: assertEquals("TIMESTAMP", getDatabase().getDateTimeType());
54: }
55:
56: @Test
57: public void getCurrentDateTimeFunction() {
58: assertEquals("NOW()", getDatabase()
59: .getCurrentDateTimeFunction());
60: }
61:
62: @Test
63: public void testGetDefaultDriver() {
64: Database database = getDatabase();
65:
66: assertEquals("org.h2.Driver", database
67: .getDefaultDriver("jdbc:h2:mem:liquibase"));
68:
69: assertNull(database
70: .getDefaultDriver("jdbc:db2://localhost;databaseName=liquibase"));
71: }
72: }
|