Search in sources :

Example 1 with StageRepository

use of ch.hsr.sa.radiotour.dataaccess.repositories.StageRepository 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)

Aggregations

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