Skip to content

Commit

Permalink
After all tests are run, an exception is thrown is *any* fail to run.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdereg committed Feb 4, 2024
1 parent 17a22e9 commit 6e2e37f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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 },
Expand All @@ -230,6 +230,7 @@ public void before() {

@Test
void testEverything() {
boolean failed = false;
Map<Class<?>, Set<Class<?>>> map = converter.allSupportedConversions();

for (Map.Entry<Class<?>, Set<Class<?>>> entry : map.entrySet()) {
Expand Down Expand Up @@ -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.");
}
}
}

0 comments on commit 6e2e37f

Please sign in to comment.