use of dk.ilios.spanner.BeforeExperiment in project realm-java by realm.
the class RealmBenchmarks method before.
@BeforeExperiment
public void before() {
Realm.init(InstrumentationRegistry.getTargetContext());
coldConfig = new RealmConfiguration.Builder().name("cold").build();
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(coldConfig);
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
readObject = realm.createObject(AllTypes.class);
readObject.setColumnString("Foo");
readObject.setColumnLong(42);
readObject.setColumnDouble(1.234D);
}
});
}
use of dk.ilios.spanner.BeforeExperiment in project realm-java by realm.
the class RealmObjectWriteBenchmarks method before.
@BeforeExperiment
public void before() {
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.beginTransaction();
writeObject = realm.createObject(AllTypes.class);
}
use of dk.ilios.spanner.BeforeExperiment in project realm-java by realm.
the class RealmQueryBenchmarks method before.
@BeforeExperiment
public void before() {
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.beginTransaction();
for (int i = 0; i < DATA_SIZE; i++) {
AllTypes obj = realm.createObject(AllTypes.class);
obj.setColumnLong(i);
obj.setColumnBoolean(i % 2 == 0);
obj.setColumnString("Foo " + i);
obj.setColumnDouble(i + 1.234D);
}
realm.commitTransaction();
}
use of dk.ilios.spanner.BeforeExperiment in project realm-java by realm.
the class RealmResultsBenchmarks method before.
@BeforeExperiment
public void before() {
Realm.init(InstrumentationRegistry.getTargetContext());
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.beginTransaction();
for (int i = 0; i < DATA_SIZE; i++) {
AllTypes obj = realm.createObject(AllTypes.class);
obj.setColumnLong(i);
obj.setColumnBoolean(i % 2 == 0);
obj.setColumnString("Foo " + i);
obj.setColumnDouble(i + 1.234D);
}
realm.commitTransaction();
results = realm.where(AllTypes.class).findAll();
}
use of dk.ilios.spanner.BeforeExperiment in project realm-java by realm.
the class RealmAllocBenchmarks method before.
@BeforeExperiment
public void before() {
Realm.init(InstrumentationRegistry.getTargetContext());
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.beginTransaction();
realm.createObject(AllTypes.class).getColumnRealmList().add(realm.createObject(Dog.class));
realm.commitTransaction();
}
Aggregations