01: package liquibase.database;
02:
03: import static org.junit.Assert.*;
04: import org.junit.Test;
05:
06: /**
07: * Tests for {@link MySQLDatabase}
08: */
09: public class MySQLDatabaseTest extends AbstractDatabaseTest {
10:
11: public MySQLDatabaseTest() throws Exception {
12: super (new MySQLDatabase());
13: }
14:
15: protected String getProductNameString() {
16: return "MySQL";
17: }
18:
19: @Test
20: public void getBlobType() {
21: assertEquals("BLOB", getDatabase().getBlobType());
22: }
23:
24: @Test
25: public void supportsInitiallyDeferrableColumns() {
26: assertFalse(getDatabase().supportsInitiallyDeferrableColumns());
27: }
28:
29: @Test
30: public void getBooleanType() {
31: assertEquals("TINYINT(1)", getDatabase().getBooleanType());
32: }
33:
34: @Test
35: public void getCurrencyType() {
36: assertEquals("DECIMAL", getDatabase().getCurrencyType());
37: }
38:
39: @Test
40: public void getUUIDType() {
41: assertEquals("CHAR(36)", getDatabase().getUUIDType());
42: }
43:
44: @Test
45: public void getClobType() {
46: assertEquals("TEXT", 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("DATETIME", getDatabase().getDateTimeType());
57: }
58:
59: @Test
60: public void getCurrentDateTimeFunction() {
61: assertEquals("NOW()", getDatabase()
62: .getCurrentDateTimeFunction());
63: }
64:
65: public void testGetDefaultDriver() {
66: Database database = new MySQLDatabase();
67:
68: assertEquals("com.mysql.jdbc.Driver", database
69: .getDefaultDriver("jdbc:mysql://localhost/liquibase"));
70:
71: assertNull(database
72: .getDefaultDriver("jdbc:db2://localhost;databaseName=liquibase"));
73: }
74:
75: }
|