Rethrow unhandled exceptions in tests as runtime exception.

This commit is contained in:
Johannes Mockenhaupt 2019-11-14 18:04:36 +01:00
parent b9d600edf4
commit 94f10a44a5
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 8 additions and 8 deletions

View file

@ -30,7 +30,7 @@ public class QuickWizardTest {
try {
array = new JSONArray("[" + data1 + "," + data2 + "]");
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
}

View file

@ -124,7 +124,7 @@ public class TriggerBgTest {
try {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":214,\"mills\":" + (now - 1) + ",\"direction\":\"Flat\"}"))));
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}

View file

@ -152,7 +152,7 @@ public class TriggerDeltaTest {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":226,\"mills\":1514765100000,\"direction\":\"Flat\"}"))));
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":228,\"mills\":1514764800000,\"direction\":\"Flat\"}"))));
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}

View file

@ -153,7 +153,7 @@ public class GlucoseStatusTest {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":226,\"mills\":1514765100000,\"direction\":\"Flat\"}"))));
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":228,\"mills\":1514764800000,\"direction\":\"Flat\"}"))));
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}
@ -165,7 +165,7 @@ public class GlucoseStatusTest {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":216,\"mills\":1514766800000,\"direction\":\"Flat\"}")))); // +2
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":216,\"mills\":1514766600000,\"direction\":\"Flat\"}"))));
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}
@ -180,7 +180,7 @@ public class GlucoseStatusTest {
try {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":228,\"mills\":1514764800000,\"direction\":\"Flat\"}"))));
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}
@ -190,7 +190,7 @@ public class GlucoseStatusTest {
try {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":214,\"mills\":1514766900000,\"direction\":\"Flat\"}"))));
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}
@ -211,7 +211,7 @@ public class GlucoseStatusTest {
list.add(new BgReading(new NSSgv(new JSONObject("{\"mgdl\":" + (latest_reading + (i*2)) + ",\"mills\":" + (end_time - (1000 * 60 * i)) + ",\"direction\":\"Flat\"}"))));
}
} catch (JSONException e) {
log.error("Unhandled exception", e);
throw new RuntimeException(e);
}
return list;
}