View Javadoc

1   package liquibase.statement.core;
2   
3   import liquibase.database.Database;
4   import liquibase.sqlgenerator.SqlGeneratorFactory;
5   import liquibase.statement.SqlStatement;
6   import liquibase.test.TestContext;
7   import static org.junit.Assert.*;
8   import org.junit.Test;
9   
10  public abstract class AbstractSqStatementTest<SqlStatementUnderTest extends SqlStatement> {
11  
12      protected abstract SqlStatementUnderTest createStatementUnderTest();
13  
14      @Test
15      public void hasAtLeastOneGenerator() {
16          for (Database database : TestContext.getInstance().getAllDatabases()) {
17              if (SqlGeneratorFactory.getInstance().supports(createStatementUnderTest(), database)) {
18                  return;
19              };
20          }
21          fail("did not find a generator");
22      }
23  
24  }