You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/06/17 16:17:47 UTC

[groovy] branch danielsun/tweak-build updated: Disable `SecurityTest.testChecksCreateClassLoaderPermissionForClassLoaderProtectedMethodAccess` for JDK16+

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/tweak-build
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/danielsun/tweak-build by this push:
     new 621bddc  Disable `SecurityTest.testChecksCreateClassLoaderPermissionForClassLoaderProtectedMethodAccess` for JDK16+
621bddc is described below

commit 621bddcff4b2a4ea82aac23449b7209606e3f10b
Author: Daniel Sun <su...@apache.org>
AuthorDate: Thu Jun 17 22:27:01 2021 +0800

    Disable `SecurityTest.testChecksCreateClassLoaderPermissionForClassLoaderProtectedMethodAccess` for JDK16+
---
 src/test/org/codehaus/groovy/reflection/SecurityTest.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/test/org/codehaus/groovy/reflection/SecurityTest.java b/src/test/org/codehaus/groovy/reflection/SecurityTest.java
index d466847..cf4da0c 100644
--- a/src/test/org/codehaus/groovy/reflection/SecurityTest.java
+++ b/src/test/org/codehaus/groovy/reflection/SecurityTest.java
@@ -32,6 +32,7 @@ import java.security.Permissions;
 import java.security.ProtectionDomain;
 
 import static groovy.test.GroovyAssert.isAtLeastJdk;
+import static org.junit.Assume.assumeTrue;
 
 public class SecurityTest extends GroovyTestCase {
 
@@ -241,6 +242,9 @@ public class SecurityTest extends GroovyTestCase {
 
 
     public void testChecksCreateClassLoaderPermissionForClassLoaderProtectedMethodAccess() throws Exception {
+        // Illegal access to java.lang.ClassLoader.defineClass(java.lang.String,java.nio.ByteBuffer,java.security.ProtectionDomain)
+        assumeTrue(!isAtLeastJdk("16.0"));
+
         cachedMethodUnderTest = createCachedMethod(ClassLoader.class, "defineClass", new Class[]{String.class, ByteBuffer.class, ProtectionDomain.class});
         forbidden = new Permissions();
         forbidden.add(new RuntimePermission("createClassLoader"));