use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class AddColumnGeneratorDefaultClauseBeforeNotNullTest method validate_noAutoIncrementWithDerby.
@Test
public void validate_noAutoIncrementWithDerby() {
ValidationErrors validationErrors = generatorUnderTest.validate(new AddColumnStatement(null, null, "table_name", "column_name", "int", null, new AutoIncrementConstraint("column_name")), new DerbyDatabase(), new MockSqlGeneratorChain());
assertTrue(validationErrors.getErrorMessages().contains("Cannot add an identity column to derby"));
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class SqlGeneratorChainTest method validate_nullGenerators.
@Test
public void validate_nullGenerators() {
SqlGeneratorChain chain = new SqlGeneratorChain(null);
ValidationErrors validationErrors = chain.validate(new MockSqlStatement(), new MockDatabase());
assertFalse(validationErrors.hasErrors());
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class SqlGeneratorChainTest method validate_twoGenerators_secondHasErrors.
@Test
public void validate_twoGenerators_secondHasErrors() {
SortedSet<SqlGenerator> generators = new TreeSet<SqlGenerator>(new SqlGeneratorComparator());
generators.add(new MockSqlGenerator(2, "B1", "B2"));
generators.add(new MockSqlGenerator(1, "A1", "A2").addValidationError("E1"));
SqlGeneratorChain chain = new SqlGeneratorChain(generators);
ValidationErrors validationErrors = chain.validate(new MockSqlStatement(), new MockDatabase());
assertTrue(validationErrors.hasErrors());
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class SqlGeneratorChainTest method validate_oneGenerators_noErrors.
@Test
public void validate_oneGenerators_noErrors() {
SortedSet<SqlGenerator> generators = new TreeSet<SqlGenerator>(new SqlGeneratorComparator());
generators.add(new MockSqlGenerator(1, "A1", "A2"));
SqlGeneratorChain chain = new SqlGeneratorChain(generators);
ValidationErrors validationErrors = chain.validate(new MockSqlStatement(), new MockDatabase());
assertFalse(validationErrors.hasErrors());
}
Aggregations