use of liquibase.exception.ValidationFailedException in project liquibase by liquibase.
the class H2IntegrationTest method runYamlChangelog.
@Test
public void runYamlChangelog() throws Exception {
if (getDatabase() == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
//run again to test changelog testing logic
liquibase = createLiquibase("changelogs/yaml/common.tests.changelog.yaml");
try {
liquibase.update(this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
}
use of liquibase.exception.ValidationFailedException in project liquibase by liquibase.
the class H2IntegrationTest method runJsonChangelog.
@Test
public void runJsonChangelog() throws Exception {
if (getDatabase() == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
//run again to test changelog testing logic
liquibase = createLiquibase("changelogs/json/common.tests.changelog.json");
try {
liquibase.update(this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
}
use of liquibase.exception.ValidationFailedException in project liquibase by liquibase.
the class OracleIntegrationTest method viewCreatedOnCorrectSchema.
@Test
public void viewCreatedOnCorrectSchema() throws Exception {
if (this.getDatabase() == null) {
return;
}
Liquibase liquibase = createLiquibase(this.viewOnSchemaChangeLog);
clearDatabase(liquibase);
try {
liquibase.update(this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
Statement queryIndex = ((JdbcConnection) this.getDatabase().getConnection()).getUnderlyingConnection().createStatement();
ResultSet indexOwner = queryIndex.executeQuery("SELECT owner FROM ALL_VIEWS WHERE view_name = 'V_BOOK2'");
assertTrue(indexOwner.next());
String owner = indexOwner.getString("owner");
assertEquals("LIQUIBASEB", owner);
// check that the automatically rollback now works too
try {
liquibase.rollback(new Date(0), this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
}
use of liquibase.exception.ValidationFailedException in project liquibase by liquibase.
the class OracleIntegrationTest method smartDataLoad.
@Test
public void smartDataLoad() throws Exception {
if (this.getDatabase() == null) {
return;
}
Liquibase liquibase = createLiquibase("changelogs/common/smartDataLoad.changelog.xml");
clearDatabase(liquibase);
try {
liquibase.update(this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
// check that the automatically rollback now works too
try {
liquibase.rollback(new Date(0), this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
}
use of liquibase.exception.ValidationFailedException in project liquibase by liquibase.
the class AbstractIntegrationTest method runChangeLogFile.
protected void runChangeLogFile(String changeLogFile) throws Exception {
Liquibase liquibase = createLiquibase(changeLogFile);
clearDatabase(liquibase);
//run again to test changelog testing logic
liquibase = createLiquibase(changeLogFile);
try {
liquibase.update(this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
}
Aggregations