use of ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRepository in project app by TourLive.
the class JudgmentRepositoryInstrumentedTest method initTestData.
@Before
public void initTestData() {
this.judgmentRepository = new JudgmentRepository();
this.rewardRepository = new RewardRepository();
realm = Realm.getInstance(RadioTourApplication.getInstance());
initCallbacks();
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
realm.where(Judgement.class).findAll().deleteAllFromRealm();
realm.where(Reward.class).findAll().deleteAllFromRealm();
}
});
}
use of ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRepository 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();
});
}
use of ch.hsr.sa.radiotour.dataaccess.repositories.JudgmentRepository in project app by TourLive.
the class RewardRepositoryInstrumentedTest method initTestData.
@Before
public void initTestData() {
this.judgmentRepository = new JudgmentRepository();
this.rewardRepository = new RewardRepository();
realm = Realm.getInstance(RadioTourApplication.getInstance());
initCallbacks();
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
realm.where(Judgement.class).findAll().deleteAllFromRealm();
realm.where(Reward.class).findAll().deleteAllFromRealm();
}
});
Judgement judgement = new Judgement();
judgement.setDistance(100);
judgement.setName("judgment");
judgement.setRewardId(93);
synchronized (this) {
judgmentRepository.addJudgment(judgement, onSaveJudgmentCallback);
judgement.setName("judgment2");
judgmentRepository.addJudgment(judgement, onSaveJudgmentCallback);
}
}
Aggregations