From ed0604a08e0270234a4f760c713bbf99a8eead20 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 9 Oct 2024 12:18:47 -0700 Subject: [PATCH] Skip test incompatible with Java 21 --- .../jclouds/reflect/Reflection2CoreJavaClassesTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/jclouds/reflect/Reflection2CoreJavaClassesTest.java b/core/src/test/java/org/jclouds/reflect/Reflection2CoreJavaClassesTest.java index b16b77dfe4..944a163298 100644 --- a/core/src/test/java/org/jclouds/reflect/Reflection2CoreJavaClassesTest.java +++ b/core/src/test/java/org/jclouds/reflect/Reflection2CoreJavaClassesTest.java @@ -25,6 +25,7 @@ import java.lang.reflect.Method; import java.lang.reflect.ReflectPermission; import org.easymock.IAnswer; +import org.testng.SkipException; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -70,7 +71,12 @@ public class Reflection2CoreJavaClassesTest { } }); replay(mockSecurityManager); - System.setSecurityManager(mockSecurityManager); + try { + System.setSecurityManager(mockSecurityManager); + } catch (UnsupportedOperationException uoe) { + throw new SkipException("Not compatible with Java 21", uoe); + } + securityManagerOverridden = true; methods(Enum.class); }