From 6e2e37fc711e2c3b7d4fd16e9acd462c343772b4 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Sun, 4 Feb 2024 00:20:47 -0500 Subject: [PATCH] After all tests are run, an exception is thrown is *any* fail to run. --- .../util/convert/ConverterEverythingTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java b/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java index 46b2a113..a063b594 100644 --- a/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java +++ b/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java @@ -195,7 +195,7 @@ class ConverterEverythingTest { mapOf("value", "127"), Byte.MAX_VALUE }, { mapOf("value", 127L), Byte.MAX_VALUE }, - { mapOf("_v", "-129"), new IllegalArgumentException("-29 not parseable as a byte value or outside -128 to 127") }, + { mapOf("_v", "-129"), new IllegalArgumentException("-129 not parseable as a byte value or outside -128 to 127") }, { mapOf("_v", -129), (byte)127 }, { mapOf("value", "-129"), new IllegalArgumentException("-129 not parseable as a byte value or outside -128 to 127") }, { mapOf("value", -129L), (byte) 127 }, @@ -208,7 +208,7 @@ class ConverterEverythingTest TEST_FACTORY.put(pair(String.class, Byte.class), new Object[][] { { "-1", (byte) -1 }, { "-1.1", (byte) -1 }, - { "-1.9", (byte) -2 }, + { "-1.9", (byte) -1 }, { "0", (byte) 0 }, { "1", (byte) 1 }, { "1.1", (byte) 1 }, @@ -230,6 +230,7 @@ public void before() { @Test void testEverything() { + boolean failed = false; Map, Set>> map = converter.allSupportedConversions(); for (Map.Entry, Set>> entry : map.entrySet()) { @@ -274,9 +275,14 @@ void testEverything() { System.err.println(); e.printStackTrace(); System.err.println(); + failed = true; } } } } + + if (failed) { + throw new RuntimeException("One or more tests failed."); + } } }