@Test public void validate_oneGenerators_hasErrors() { SortedSet<SqlGenerator> generators = new TreeSet<SqlGenerator>(new SqlGeneratorComparator()); 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()); }
public ValidationErrors validate(SqlStatement statement, Database database) { if (sqlGenerators == null || !sqlGenerators.hasNext()) { return new ValidationErrors(); } return sqlGenerators.next().validate(statement, database, this); }
SqlGeneratorChain { public ValidationErrors validate(SqlStatement statement, Database database) { if (sqlGenerators == null || !sqlGenerators.hasNext()) { return new ValidationErrors(); } return sqlGenerators.next().validate(statement, database, this); } }
SqlGeneratorChain { public ValidationErrors validate(SqlStatement statement, Database database) { if (sqlGenerators == null || !sqlGenerators.hasNext()) { return new ValidationErrors(); } return sqlGenerators.next().validate(statement, database, this); } SqlGeneratorChain(SortedSet<SqlGenerator> sqlGenerators); }
SqlGeneratorChain { public ValidationErrors validate(SqlStatement statement, Database database) { if (sqlGenerators == null || !sqlGenerators.hasNext()) { return new ValidationErrors(); } return sqlGenerators.next().validate(statement, database, this); } SqlGeneratorChain(SortedSet<SqlGenerator> sqlGenerators); Sql[] generateSql(SqlStatement statement, Database database); Warnings warn(SqlStatement statement, Database database); ValidationErrors validate(SqlStatement statement, Database database); }
SqlGeneratorChain { public ValidationErrors validate(SqlStatement statement, Database database) { if (sqlGenerators == null || !sqlGenerators.hasNext()) { return new ValidationErrors(); } return sqlGenerators.next().validate(statement, database, this); } SqlGeneratorChain(SortedSet<SqlGenerator> sqlGenerators); Sql[] generateSql(SqlStatement statement, Database database); Warnings warn(SqlStatement statement, Database database); ValidationErrors validate(SqlStatement statement, Database database);  }