Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address java.lang.NoClassDefFoundError in DefaultClassFilterTest Through Fixed Order-Dependent Test Execution #706

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/test/java/hudson/remoting/DefaultClassFilterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> badClasses = List.of("Z{100,0}" /* min > max for repetition */);
File f = folder.newFile("overrides.txt");
try (FileOutputStream fos = new FileOutputStream(f)) {
Expand Down
Loading