use of io.realm.entities.IOSAllTypes in project realm-java by realm.
the class IOSRealmTests method iOSEncryptedRealm.
@Test
public void iOSEncryptedRealm() throws IOException {
for (String iosVersion : IOS_VERSIONS) {
configFactory.copyRealmFromAssets(context, "ios/" + iosVersion + "-alltypes-default-encrypted.realm", REALM_NAME);
RealmConfiguration realmConfig = configFactory.createConfigurationBuilder().name(REALM_NAME).encryptionKey(getIOSKey()).schema(IOSAllTypes.class, IOSChild.class).build();
realm = Realm.getInstance(realmConfig);
IOSAllTypes obj = realm.where(IOSAllTypes.class).findFirst();
assertFalse(obj.isBoolCol());
assertEquals(0, obj.getShortCol());
assertEquals(0, obj.getIntCol());
assertEquals(0L, obj.getLongCol());
assertEquals(0.0F, obj.getFloatCol(), 0F);
assertEquals(0.0D, obj.getDoubleCol(), 0D);
assertArrayEquals(new byte[0], obj.getByteCol());
assertEquals("", obj.getStringCol());
assertEquals(new Date(0), obj.getDateCol());
assertNull(obj.getChild());
assertEquals(0, obj.getChildren().size());
}
}
Aggregations