use of ch.hsr.sa.radiotour.dataaccess.repositories.RewardRepository 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.RewardRepository 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(realm -> {
realm.where(Judgement.class).findAll().deleteAllFromRealm();
realm.where(Reward.class).findAll().deleteAllFromRealm();
});
Judgement judgement = new Judgement();
judgement.setId(new Random().nextLong());
judgement.setDistance(100);
judgement.setName("judgment");
judgement.setRewardId(93);
Judgement judgementTwo = new Judgement();
judgementTwo.setId(new Random().nextLong());
judgementTwo.setDistance(100);
judgementTwo.setName("judgmentTwo");
judgementTwo.setRewardId(93);
synchronized (this) {
judgmentRepository.addJudgment(judgement, onSaveJudgmentCallback);
judgmentRepository.addJudgment(judgementTwo, onSaveJudgmentCallback);
}
}
Aggregations