use of android.support.test.filters.SdkSuppress in project sqlbrite by square.
the class BriteDatabaseTest method executeUpdateDeleteWithArgsAndTrigger.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.HONEYCOMB)
@Test
public void executeUpdateDeleteWithArgsAndTrigger() {
SQLiteStatement statement = real.compileStatement("UPDATE " + TABLE_EMPLOYEE + " SET " + TestDb.EmployeeTable.NAME + " = ?");
statement.bindString(1, "Zach");
db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES).subscribe(o);
o.assertCursor().hasRow("alice", "Alice Allison").hasRow("bob", "Bob Bobberson").hasRow("eve", "Eve Evenson").isExhausted();
db.executeUpdateDelete(TABLE_EMPLOYEE, statement);
o.assertCursor().hasRow("alice", "Zach").hasRow("bob", "Zach").hasRow("eve", "Zach").isExhausted();
}
use of android.support.test.filters.SdkSuppress in project sqlbrite by square.
the class BriteDatabaseTest method executeUpdateDeleteAndDontTrigger.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.HONEYCOMB)
@Test
public void executeUpdateDeleteAndDontTrigger() {
SQLiteStatement statement = real.compileStatement("" + "UPDATE " + TABLE_EMPLOYEE + " SET " + TestDb.EmployeeTable.NAME + " = 'Zach'" + " WHERE " + TestDb.EmployeeTable.NAME + " = 'Rob'");
db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES).subscribe(o);
o.assertCursor().hasRow("alice", "Alice Allison").hasRow("bob", "Bob Bobberson").hasRow("eve", "Eve Evenson").isExhausted();
db.executeUpdateDelete(TABLE_EMPLOYEE, statement);
o.assertNoMoreEvents();
}
use of android.support.test.filters.SdkSuppress in project sqlbrite by square.
the class BriteDatabaseTest method nonExclusiveTransactionWorks.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.HONEYCOMB)
@Test
public void nonExclusiveTransactionWorks() throws InterruptedException {
final CountDownLatch transactionStarted = new CountDownLatch(1);
final CountDownLatch transactionProceed = new CountDownLatch(1);
final CountDownLatch transactionCompleted = new CountDownLatch(1);
new Thread() {
@Override
public void run() {
Transaction transaction = db.newNonExclusiveTransaction();
transactionStarted.countDown();
try {
db.insert(TABLE_EMPLOYEE, employee("hans", "Hans Hanson"));
transactionProceed.await(10, SECONDS);
} catch (InterruptedException e) {
throw new RuntimeException("Exception in transaction thread", e);
}
transaction.markSuccessful();
transaction.close();
transactionCompleted.countDown();
}
}.start();
assertThat(transactionStarted.await(10, SECONDS)).isTrue();
//Simple query
Employee employees = db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES + " LIMIT 1").lift(Query.mapToOne(Employee.MAPPER)).toBlocking().first();
assertThat(employees).isEqualTo(new Employee("alice", "Alice Allison"));
transactionProceed.countDown();
assertThat(transactionCompleted.await(10, SECONDS)).isTrue();
}
use of android.support.test.filters.SdkSuppress in project sqlbrite by square.
the class BriteDatabaseTest method executeUpdateDeleteWithArgsThrowsAndDoesNotTrigger.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.HONEYCOMB)
@Test
public void executeUpdateDeleteWithArgsThrowsAndDoesNotTrigger() {
SQLiteStatement statement = real.compileStatement("UPDATE " + TABLE_EMPLOYEE + " SET " + TestDb.EmployeeTable.USERNAME + " = ?");
statement.bindString(1, "alice");
db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES).skip(// Skip initial
1).subscribe(o);
try {
db.executeUpdateDelete(TABLE_EMPLOYEE, statement);
fail();
} catch (SQLException ignored) {
}
o.assertNoMoreEvents();
}
use of android.support.test.filters.SdkSuppress in project weex-example by KalicyZhou.
the class BenchmarkTest method testFlingFPS.
@Repeat(TIMES)
@Test
@SdkSuppress(minSdkVersion = 23)
public void testFlingFPS() {
UiObject2 uiObject2 = loadPageForFPS();
if (uiObject2 != null) {
uiObject2.fling(Direction.DOWN, FLING_SPEED);
uiObject2.fling(Direction.DOWN, FLING_SPEED);
uiObject2.fling(Direction.DOWN, FLING_SPEED);
uiObject2.fling(Direction.DOWN, FLING_SPEED);
processGfxInfo(flingFrameSeconds);
}
}
Aggregations