01: package liquibase.database;
02:
03: import static org.junit.Assert.*;
04: import org.junit.Test;
05:
06: /**
07: * Tests for {@link OracleDatabase}
08: */
09: public class OracleDatabaseTest extends AbstractDatabaseTest {
10:
11: public OracleDatabaseTest() throws Exception {
12: super (new OracleDatabase());
13: }
14:
15: protected String getProductNameString() {
16: return "Oracle";
17: }
18:
19: @Test
20: public void getBlobType() {
21: assertEquals("BLOB", getDatabase().getBlobType());
22: }
23:
24: @Test
25: public void supportsInitiallyDeferrableColumns() {
26: assertTrue(getDatabase().supportsInitiallyDeferrableColumns());
27: }
28:
29: @Test
30: public void getBooleanType() {
31: assertEquals("NUMBER(1)", getDatabase().getBooleanType());
32: }
33:
34: @Test
35: public void getCurrencyType() {
36: assertEquals("NUMBER(15, 2)", getDatabase().getCurrencyType());
37: }
38:
39: @Test
40: public void getUUIDType() {
41: assertEquals("RAW(16)", getDatabase().getUUIDType());
42: }
43:
44: @Test
45: public void getClobType() {
46: assertEquals("CLOB", getDatabase().getClobType());
47: }
48:
49: @Test
50: public void getDateType() {
51: assertEquals("DATE", getDatabase().getDateType());
52: }
53:
54: @Test
55: public void getDateTimeType() {
56: assertEquals("TIMESTAMP", getDatabase().getDateTimeType());
57: }
58:
59: @Test
60: public void getCurrentDateTimeFunction() {
61: assertEquals("SYSDATE", getDatabase()
62: .getCurrentDateTimeFunction());
63: }
64:
65: public void testGetDefaultDriver() {
66: Database database = new OracleDatabase();
67:
68: assertEquals("oracle.jdbc.OracleDriver", database
69: .getDefaultDriver("jdbc:oracle:thin:@localhost/XE"));
70:
71: assertNull(database
72: .getDefaultDriver("jdbc:db2://localhost;databaseName=liquibase"));
73: }
74:
75: }
|