01: package liquibase.database;
02:
03: import junit.framework.TestCase;
04:
05: public class DerbyDatabaseTest extends TestCase {
06: public void testGetDefaultDriver() {
07: Database database = new DerbyDatabase();
08:
09: assertEquals("org.apache.derby.jdbc.EmbeddedDriver", database
10: .getDefaultDriver("jdbc:derby:liquibase;create=true"));
11:
12: assertNull(database
13: .getDefaultDriver("jdbc:oracle://localhost;databaseName=liquibase"));
14: }
15:
16: public void testGetDateLiteral() {
17: assertEquals("TIMESTAMP('2008-01-25 13:57:41')",
18: new DerbyDatabase()
19: .getDateLiteral("2008-01-25 13:57:41"));
20: assertEquals("TIMESTAMP('2008-01-25 13:57:41.300000')",
21: new DerbyDatabase()
22: .getDateLiteral("2008-01-25 13:57:41.3"));
23: assertEquals("TIMESTAMP('2008-01-25 13:57:41.340000')",
24: new DerbyDatabase()
25: .getDateLiteral("2008-01-25 13:57:41.34"));
26: assertEquals("TIMESTAMP('2008-01-25 13:57:41.347000')",
27: new DerbyDatabase()
28: .getDateLiteral("2008-01-25 13:57:41.347"));
29: }
30:
31: }
|