use of androidx.test.annotation.UiThreadTest in project realm-java by realm.
the class OrderedRealmCollectionIteratorTests method useCase_simpleIterator_modifyQueryResult_innerTransaction_looperThread.
@Test
@UiThreadTest
public void useCase_simpleIterator_modifyQueryResult_innerTransaction_looperThread() {
if (skipTest(CollectionClass.MANAGED_REALMLIST, CollectionClass.UNMANAGED_REALMLIST, CollectionClass.REALMRESULTS)) {
return;
}
assertEquals(TEST_SIZE, collection.size());
for (int i = 0; i < collection.size(); i++) {
realm.beginTransaction();
AllJavaTypes obj = collection.get(i);
obj.setFieldLong(obj.getFieldLong() + TEST_SIZE);
realm.commitTransaction();
}
// Verifies that all elements were modified.
assertEquals(0, realm.where(AllJavaTypes.class).lessThan(AllJavaTypes.FIELD_LONG, TEST_SIZE).count());
}
use of androidx.test.annotation.UiThreadTest in project realm-java by realm.
the class OrderedRealmCollectionIteratorTests method useCase_forEachIterator_modifyQueryResult_innerTransaction_looperThread.
@Test
@UiThreadTest
public void useCase_forEachIterator_modifyQueryResult_innerTransaction_looperThread() {
if (skipTest(CollectionClass.MANAGED_REALMLIST, CollectionClass.UNMANAGED_REALMLIST)) {
return;
}
assertEquals(TEST_SIZE, collection.size());
for (AllJavaTypes obj : collection) {
realm.beginTransaction();
obj.setFieldLong(obj.getFieldLong() + TEST_SIZE);
realm.commitTransaction();
}
// Verifies that all elements were modified.
assertEquals(0, realm.where(AllJavaTypes.class).lessThan(AllJavaTypes.FIELD_LONG, TEST_SIZE).count());
}
use of androidx.test.annotation.UiThreadTest in project realm-java by realm.
the class OrderedRealmCollectionIteratorTests method useCase_forEachIterator_modifyQueryResult_outerTransaction_looperThread.
@Test
@UiThreadTest
public void useCase_forEachIterator_modifyQueryResult_outerTransaction_looperThread() {
if (skipTest(CollectionClass.MANAGED_REALMLIST, CollectionClass.UNMANAGED_REALMLIST)) {
return;
}
assertEquals(TEST_SIZE, collection.size());
realm.beginTransaction();
for (AllJavaTypes obj : collection) {
obj.setFieldLong(obj.getFieldLong() + TEST_SIZE);
}
realm.commitTransaction();
// Verifies that all elements were modified.
assertEquals(0, realm.where(AllJavaTypes.class).lessThan(AllJavaTypes.FIELD_LONG, TEST_SIZE).count());
}
use of androidx.test.annotation.UiThreadTest in project iterable-android-sdk by Iterable.
the class IterableInAppTest method testGetLocationRandom.
@Test
@UiThreadTest
public void testGetLocationRandom() {
Rect padding = new Rect(0, 20, 0, 30);
int verticalLocation = notification.getVerticalLocation(padding);
assertEquals(Gravity.CENTER_VERTICAL, verticalLocation);
}
use of androidx.test.annotation.UiThreadTest in project iterable-android-sdk by Iterable.
the class IterableInAppTest method testGetLocationTop.
@Test
@UiThreadTest
public void testGetLocationTop() {
Rect padding = new Rect(0, 0, 0, -1);
int verticalLocation = notification.getVerticalLocation(padding);
assertEquals(Gravity.TOP, verticalLocation);
}
Aggregations