Search in sources :

Example 6 with Stage

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());
}
Also used : Stage(ch.hsr.sa.radiotour.dataaccess.models.Stage) Date(java.util.Date) Test(org.junit.Test)

Aggregations

Stage (ch.hsr.sa.radiotour.dataaccess.models.Stage)6 Date (java.util.Date)3 Realm (io.realm.Realm)2 Test (org.junit.Test)2 ProgressDialog (android.app.ProgressDialog)1 View (android.view.View)1 TextView (android.widget.TextView)1 RiderStageConnection (ch.hsr.sa.radiotour.dataaccess.models.RiderStageConnection)1 RealmList (io.realm.RealmList)1 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1 JSONArray (org.json.JSONArray)1 JSONException (org.json.JSONException)1 JSONObject (org.json.JSONObject)1