Search in sources :

Example 1 with SelectFromDatabaseChangeLogLockStatement

use of liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement in project liquibase by liquibase.

the class SelectFromDatabaseChangeLogLockExecutorTest method generateSql_multicolumn.

@Test
public void generateSql_multicolumn() throws Exception {
    this.statementUnderTest = new SelectFromDatabaseChangeLogLockStatement("LOCKED", "LOCKEDBY");
    assertCorrect("select [locked],[lockedby] from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseDatabase.class);
    assertCorrect("select [locked],[lockedby] from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseASADatabase.class);
    assertCorrect("select [locked],[lockedby] from [databasechangeloglock] where [id]=1 for update", OracleDatabase.class);
    assertCorrectOnRest("select [locked],[lockedby] from [databasechangeloglock] where [id]=1");
}
Also used : SelectFromDatabaseChangeLogLockStatement(liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement) Test(org.junit.Test)

Example 2 with SelectFromDatabaseChangeLogLockStatement

use of liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement in project liquibase by liquibase.

the class SelectFromDatabaseChangeLogLockExecutorTest method generateSql.

@Test
public void generateSql() throws Exception {
    this.statementUnderTest = new SelectFromDatabaseChangeLogLockStatement("LOCKED");
    assertCorrect("select [locked] from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseDatabase.class);
    assertCorrect("select [locked] from [databasechangeloglock] where [id]=1", SybaseASADatabase.class);
    assertCorrect("select [locked] from [databasechangeloglock] where [id]=1 for update", OracleDatabase.class);
    assertCorrectOnRest("select [locked] from [databasechangeloglock] where [id]=1");
}
Also used : SelectFromDatabaseChangeLogLockStatement(liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement) Test(org.junit.Test)

Example 3 with SelectFromDatabaseChangeLogLockStatement

use of liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement in project liquibase by liquibase.

the class SelectFromDatabaseChangeLogLockExecutorTest method generateSql_count.

@Test
public void generateSql_count() throws Exception {
    this.statementUnderTest = new SelectFromDatabaseChangeLogLockStatement(new ColumnConfig().setName("COUNT(*)", true));
    assertCorrect("select count(*) from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseDatabase.class);
    assertCorrect("select count(*) from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseASADatabase.class);
    assertCorrect("select count(*) from [databasechangeloglock] where [id]=1 for update", OracleDatabase.class);
    assertCorrectOnRest("select count(*) from [databasechangeloglock] where [id]=1");
}
Also used : ColumnConfig(liquibase.change.ColumnConfig) SelectFromDatabaseChangeLogLockStatement(liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement) Test(org.junit.Test)

Aggregations

SelectFromDatabaseChangeLogLockStatement (liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement)3 Test (org.junit.Test)3 ColumnConfig (liquibase.change.ColumnConfig)1