use of liquibase.database.Database in project liquibase by liquibase.
the class MariaDBDatabaseTest method escapeTableName_withSchema.
@Override
@Test
public void escapeTableName_withSchema() {
Database database = getDatabase();
assertEquals("catalogName.tableName", database.escapeTableName("catalogName", "schemaName", "tableName"));
}
use of liquibase.database.Database in project liquibase by liquibase.
the class PostgresDatabaseTest method escapeTableName_withSchema.
@Override
@Test
public void escapeTableName_withSchema() {
Database database = getDatabase();
assertEquals("\"schemaName\".\"tableName\"", database.escapeTableName("catalogName", "schemaName", "tableName"));
}
use of liquibase.database.Database in project liquibase by liquibase.
the class ValidatingVisitorTest method visit_torunOnly.
@Test
public void visit_torunOnly() throws Exception {
changeSet1.addChange(new CreateTableChange() {
@Override
public ValidationErrors validate(Database database) {
ValidationErrors changeValidationErrors = new ValidationErrors();
changeValidationErrors.addError("Test message");
return changeValidationErrors;
}
});
List<RanChangeSet> ran = new ArrayList<RanChangeSet>();
ran.add(new RanChangeSet(changeSet1));
ValidatingVisitor handler = new ValidatingVisitor(ran);
handler.visit(changeSet1, new DatabaseChangeLog(), null, null);
assertEquals(0, handler.getSetupExceptions().size());
assertTrue(handler.validationPassed());
}
use of liquibase.database.Database in project liquibase by liquibase.
the class DB2DatabaseTest method testGetDefaultDriver.
public void testGetDefaultDriver() {
Database database = new DB2Database();
assertEquals("com.ibm.db2.jcc.DB2Driver", database.getDefaultDriver("jdbc:db2://localhost:50000/liquibas"));
assertNull(database.getDefaultDriver("jdbc:oracle://localhost;databaseName=liquibase"));
}
use of liquibase.database.Database in project liquibase by liquibase.
the class OracleDatabaseTest method saveNlsEnvironment.
@Test
public void saveNlsEnvironment() throws Exception {
Database database = getDatabase();
ResourceAccessor junitResourceAccessor = new JUnitResourceAccessor();
OfflineConnection offlineConnection = new OfflineConnection("offline:oracle", junitResourceAccessor);
database.setConnection(offlineConnection);
}
Aggregations