From a920edd998df600cfeff615ea5ce067ca8f4bb46 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch <Alexander@Kriegisch.name> Date: Thu, 30 Mar 2023 12:03:59 +0200 Subject: Improve SystemPropertiesTest - Fix quotation error in console output - Throw RuntimeException instead of Error. Maybe this helps to avoid the prominent error message listing in the GitHub build log, which always looks like something bad happened, even though it is simply an expected error. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name> --- tests/harness/SystemPropertiesTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/harness/SystemPropertiesTest.java b/tests/harness/SystemPropertiesTest.java index d02985f88..06a95699b 100644 --- a/tests/harness/SystemPropertiesTest.java +++ b/tests/harness/SystemPropertiesTest.java @@ -1,15 +1,13 @@ public class SystemPropertiesTest { - public static void main(String[] args) { + public static void main(String[] args) { boolean pass = Boolean.getBoolean("PASS"); if (!pass) { - throw new Error("failed to get Boolean \\\"PASS\\\""); + throw new RuntimeException("failed to get Boolean \"PASS\""); } String value = System.getProperty("name", null); if (!"value".equals(value)) { - throw new Error("failed to get name=\"value\": " + value); + throw new RuntimeException("failed to get name=\"value\": " + value); } } } - - -- cgit v1.2.3