Search in sources :

Example 1 with RiderStageConnectionRepository

use of ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository in project app by TourLive.

the class StageRepositoryInstrumentedTest method initTestData.

@Before
public void initTestData() {
    this.stageRepository = new StageRepository();
    this.riderStageConnectionRepository = new RiderStageConnectionRepository();
    realm = Realm.getInstance(RadioTourApplication.getInstance());
    initCallbacks();
    realm.executeTransaction(new Realm.Transaction() {

        @Override
        public void execute(Realm realm) {
            realm.where(Stage.class).findAll().deleteAllFromRealm();
            realm.where(RiderStageConnection.class).findAll().deleteAllFromRealm();
        }
    });
}
Also used : IRiderStageConnectionRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderStageConnectionRepository) RiderStageConnectionRepository(ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository) RiderStageConnection(ch.hsr.sa.radiotour.dataaccess.models.RiderStageConnection) Stage(ch.hsr.sa.radiotour.dataaccess.models.Stage) StageRepository(ch.hsr.sa.radiotour.dataaccess.repositories.StageRepository) IStageRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IStageRepository) Realm(io.realm.Realm) Before(org.junit.Before)

Example 2 with RiderStageConnectionRepository

use of ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository in project app by TourLive.

the class RiderRepositoryInstrumentedTest method initTestData.

@Before
public void initTestData() {
    this.riderRepository = new RiderRepository();
    this.riderStageConnectionRepository = new RiderStageConnectionRepository();
    realm = Realm.getInstance(RadioTourApplication.getInstance());
    initCallbacks();
    riders.clear();
    realm.executeTransaction(new Realm.Transaction() {

        @Override
        public void execute(Realm realm) {
            realm.where(Rider.class).findAll().deleteAllFromRealm();
            realm.where(RiderStageConnection.class).findAll().deleteAllFromRealm();
        }
    });
}
Also used : RiderRepository(ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository) IRiderRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderRepository) IRiderStageConnectionRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderStageConnectionRepository) RiderStageConnectionRepository(ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository) RiderStageConnection(ch.hsr.sa.radiotour.dataaccess.models.RiderStageConnection) Realm(io.realm.Realm) Rider(ch.hsr.sa.radiotour.dataaccess.models.Rider) Before(org.junit.Before)

Example 3 with RiderStageConnectionRepository

use of ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository in project app by TourLive.

the class RiderStageConnectionRepositoryInstrumentedTest method initTestData.

@Before
public void initTestData() {
    this.riderRepository = new RiderRepository();
    this.riderStageConnectionRepository = new RiderStageConnectionRepository();
    realm = Realm.getInstance(RadioTourApplication.getInstance());
    initCallbacks();
    realm.executeTransaction(new Realm.Transaction() {

        @Override
        public void execute(Realm realm) {
            realm.where(Rider.class).findAll().deleteAllFromRealm();
            realm.where(RiderStageConnection.class).findAll().deleteAllFromRealm();
        }
    });
}
Also used : RiderRepository(ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository) IRiderRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderRepository) IRiderStageConnectionRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderStageConnectionRepository) RiderStageConnectionRepository(ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository) RiderStageConnection(ch.hsr.sa.radiotour.dataaccess.models.RiderStageConnection) Realm(io.realm.Realm) Rider(ch.hsr.sa.radiotour.dataaccess.models.Rider) Before(org.junit.Before)

Aggregations

IRiderStageConnectionRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderStageConnectionRepository)3 RiderStageConnection (ch.hsr.sa.radiotour.dataaccess.models.RiderStageConnection)3 RiderStageConnectionRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository)3 Realm (io.realm.Realm)3 Before (org.junit.Before)3 IRiderRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderRepository)2 Rider (ch.hsr.sa.radiotour.dataaccess.models.Rider)2 RiderRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository)2 IStageRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IStageRepository)1 Stage (ch.hsr.sa.radiotour.dataaccess.models.Stage)1 StageRepository (ch.hsr.sa.radiotour.dataaccess.repositories.StageRepository)1