From 57559cd421637eb5ec2152698499aa508154d724 Mon Sep 17 00:00:00 2001 From: ycp2 Date: Fri, 8 Dec 2023 17:55:40 -0600 Subject: [PATCH] Fixed OD victim tests --- src/test/java/hudson/remoting/DefaultClassFilterTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/hudson/remoting/DefaultClassFilterTest.java b/src/test/java/hudson/remoting/DefaultClassFilterTest.java index 53b0bb431..ce6107a3d 100644 --- a/src/test/java/hudson/remoting/DefaultClassFilterTest.java +++ b/src/test/java/hudson/remoting/DefaultClassFilterTest.java @@ -99,6 +99,14 @@ public void testDefaultsOverrideExists() throws Exception { */ @Test(expected=Error.class) public void testDefaultsAreUsedIfOverridesAreGarbage() throws Exception { + /* initialize ClassFilter class to avoid `java.lang.NoClassDefFoundError` */ + try { + ClassFilter.createDefaultInstance(); + clearProperty(); + } catch (Throwable t) { + System.err.println("First initialization: " + t.getMessage()); + } + List badClasses = List.of("Z{100,0}" /* min > max for repetition */); File f = folder.newFile("overrides.txt"); try (FileOutputStream fos = new FileOutputStream(f)) {