Search in sources :

Example 1 with RaceGroupRepository

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

Aggregations

IRaceGroupRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRaceGroupRepository)1 IRiderRepository (ch.hsr.sa.radiotour.dataaccess.interfaces.IRiderRepository)1 RaceGroup (ch.hsr.sa.radiotour.dataaccess.models.RaceGroup)1 Rider (ch.hsr.sa.radiotour.dataaccess.models.Rider)1 RaceGroupRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RaceGroupRepository)1 RiderRepository (ch.hsr.sa.radiotour.dataaccess.repositories.RiderRepository)1 Realm (io.realm.Realm)1 Before (org.junit.Before)1