Search in sources :

Example 1 with RiderRepository

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

the class RaceGroupRepositoryInstrumentedTest method initTestData.

@Before
public void initTestData() {
    this.riderRepository = new RiderRepository();
    this.raceGroupRepository = new RaceGroupRepository();
    realm = Realm.getInstance(RadioTourApplication.getInstance());
    initCallbacks();
    raceGroups.clear();
    realm.executeTransaction(new Realm.Transaction() {

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

Example 2 with RiderRepository

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

the class JudgmentRiderConnectionInstrumentedTest method initTestData.

@Before
public void initTestData() {
    this.judgmentRiderConnectionRepository = new JudgmentRiderConnectionRepository();
    this.riderRepository = new RiderRepository();
    this.judgmentRepository = new JudgmentRepository();
    realm = Realm.getInstance(RadioTourApplication.getInstance());
    initCallbacks();
    realm.executeTransaction((Realm db) -> {
        db.where(JudgmentRiderConnection.class).findAll().deleteAllFromRealm();
        db.where(Rider.class).findAll().deleteAllFromRealm();
        db.where(Judgement.class).findAll().deleteAllFromRealm();
    });
}
Also used : RiderRepository(ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository) IRiderRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderRepository) JudgmentRiderConnectionRepository(ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRiderConnectionRepository) IJudgmentRiderConnectionRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IJudgmentRiderConnectionRepository) IJudgmentRepository(ch.hsr.sa.radiotour.dataaccess.interfaces.IJudgmentRepository) JudgmentRepository(ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRepository) Realm(io.realm.Realm) Before(org.junit.Before)

Example 3 with RiderRepository

use of ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository 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 4 with RiderRepository

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

IRiderRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderRepository)4 RiderRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository)4 Realm (io.realm.Realm)4 Before (org.junit.Before)4 Rider (ch.hsr.sa.radiotour.dataaccess.models.Rider)3 IRiderStageConnectionRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderStageConnectionRepository)2 RiderStageConnection (ch.hsr.sa.radiotour.dataaccess.models.RiderStageConnection)2 RiderStageConnectionRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RiderStageConnectionRepository)2 IJudgmentRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IJudgmentRepository)1 IJudgmentRiderConnectionRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IJudgmentRiderConnectionRepository)1 IRaceGroupRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRaceGroupRepository)1 RaceGroup (ch.hsr.sa.radiotour.dataaccess.models.RaceGroup)1 JudgmentRepository (ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRepository)1 JudgmentRiderConnectionRepository (ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRiderConnectionRepository)1 RaceGroupRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RaceGroupRepository)1