use of ch.hsr.sa.radiotour.dataaccess.models.Stage in project app by TourLive.
the class StageRepositoryInstrumentedTest method clearAllStages.
@Test
public void clearAllStages() {
Stage stage = new Stage();
stage.setStageId(1);
stage.setDistance(100);
stage.setStartTime(new Date());
stage.setEndTime(new Date());
stage.setFrom("bern");
stage.setTo("zuerich");
stage.setName("Ettape 1");
stage.setType(StageType.FLATSTAGE);
synchronized (this) {
stageRepository.addStage(stage, onSaveStageCallback);
stage.setDistance(200);
stageRepository.addStage(stage, onSaveStageCallback);
}
synchronized (this) {
stageRepository.clearAllStages();
}
Assert.assertEquals(0, realm.where(Stage.class).findAll().size());
}
Aggregations