Search in sources :

Example 6 with BeforeExperiment

use of dk.ilios.spanner.BeforeExperiment in project realm-java by realm.

the class RealmObjectReadBenchmarks method before.

@BeforeExperiment
public void before() {
    Realm.init(InstrumentationRegistry.getTargetContext());
    RealmConfiguration config = new RealmConfiguration.Builder().build();
    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);
        }
    });
}
Also used : RealmConfiguration(io.realm.RealmConfiguration) Realm(io.realm.Realm) BeforeExperiment(dk.ilios.spanner.BeforeExperiment)

Aggregations

BeforeExperiment (dk.ilios.spanner.BeforeExperiment)6 RealmConfiguration (io.realm.RealmConfiguration)6 AllTypes (io.realm.entities.AllTypes)3 Realm (io.realm.Realm)2 Dog (io.realm.entities.Dog)1