Search in sources :

Example 1 with PreparedExecuteSQL

use of com.pushtorefresh.storio3.sqlite.operations.execute.PreparedExecuteSQL in project storio by pushtorefresh.

the class PreparedExecuteSQLTest method executeSQLFlowableExecutesOnSpecifiedScheduler.

@Test
public void executeSQLFlowableExecutesOnSpecifiedScheduler() {
    final Stub stub = Stub.newInstanceApplyNotEmptyAffectedTablesAndTags();
    final SchedulerChecker schedulerChecker = SchedulerChecker.create(stub.storIOSQLite);
    final PreparedExecuteSQL operation = stub.storIOSQLite.executeSQL().withQuery(stub.rawQuery).prepare();
    schedulerChecker.checkAsFlowable(operation);
}
Also used : SchedulerChecker(com.pushtorefresh.storio3.sqlite.operations.SchedulerChecker) Test(org.junit.Test)

Example 2 with PreparedExecuteSQL

use of com.pushtorefresh.storio3.sqlite.operations.execute.PreparedExecuteSQL in project storio by pushtorefresh.

the class PreparedExecuteSQLTest method executeSQLSingleExecutesOnSpecifiedScheduler.

@Test
public void executeSQLSingleExecutesOnSpecifiedScheduler() {
    final Stub stub = Stub.newInstanceApplyNotEmptyAffectedTablesAndTags();
    final SchedulerChecker schedulerChecker = SchedulerChecker.create(stub.storIOSQLite);
    final PreparedExecuteSQL operation = stub.storIOSQLite.executeSQL().withQuery(stub.rawQuery).prepare();
    schedulerChecker.checkAsSingle(operation);
}
Also used : SchedulerChecker(com.pushtorefresh.storio3.sqlite.operations.SchedulerChecker) Test(org.junit.Test)

Example 3 with PreparedExecuteSQL

use of com.pushtorefresh.storio3.sqlite.operations.execute.PreparedExecuteSQL in project storio by pushtorefresh.

the class PreparedExecuteSQLTest method executeSQLCompletableExecutesOnSpecifiedScheduler.

@Test
public void executeSQLCompletableExecutesOnSpecifiedScheduler() {
    final Stub stub = Stub.newInstanceApplyNotEmptyAffectedTablesAndTags();
    final SchedulerChecker schedulerChecker = SchedulerChecker.create(stub.storIOSQLite);
    final PreparedExecuteSQL operation = stub.storIOSQLite.executeSQL().withQuery(stub.rawQuery).prepare();
    schedulerChecker.checkAsCompletable(operation);
}
Also used : SchedulerChecker(com.pushtorefresh.storio3.sqlite.operations.SchedulerChecker) Test(org.junit.Test)

Example 4 with PreparedExecuteSQL

use of com.pushtorefresh.storio3.sqlite.operations.execute.PreparedExecuteSQL in project storio by pushtorefresh.

the class ExecSQLTest method shouldReturnQueryInGetData.

@Test
public void shouldReturnQueryInGetData() {
    final RawQuery query = RawQuery.builder().query(// we don't want to really delete table
    "DROP TABLE IF EXISTS no_such_table").build();
    final PreparedExecuteSQL operation = storIOSQLite.executeSQL().withQuery(query).prepare();
    assertThat(operation.getData()).isEqualTo(query);
}
Also used : RawQuery(com.pushtorefresh.storio3.sqlite.queries.RawQuery) PreparedExecuteSQL(com.pushtorefresh.storio3.sqlite.operations.execute.PreparedExecuteSQL) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 SchedulerChecker (com.pushtorefresh.storio3.sqlite.operations.SchedulerChecker)3 PreparedExecuteSQL (com.pushtorefresh.storio3.sqlite.operations.execute.PreparedExecuteSQL)1 RawQuery (com.pushtorefresh.storio3.sqlite.queries.RawQuery)1