From 0db2d3f09792d824e6cb99c61a50439bac02b4f5 Mon Sep 17 00:00:00 2001 From: Erich Duda Date: Mon, 1 Feb 2016 10:27:37 +0100 Subject: [PATCH] ARTEMIS-377 - [Artemis Testsuite] NettySecurityClientTest#testProducerConsumerClientWithSecurityManager fails --- .../tests/integration/security/NettySecurityClientTest.java | 3 ++- .../src/test/resources/restricted-security-client.policy | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java index c1a90125de..ad71d26c06 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.integration.security; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; +import java.net.URLDecoder; import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; @@ -60,7 +61,7 @@ public class NettySecurityClientTest extends ActiveMQTestBase { String[] vmargs = new String[0]; if (withSecurityManager) { URL securityPolicyURL = Thread.currentThread().getContextClassLoader().getResource("restricted-security-client.policy"); - vmargs = new String[]{"-Djava.security.manager", "-Djava.security.policy=" + securityPolicyURL.getPath()}; + vmargs = new String[]{"-Djava.security.manager", "-Djava.security.policy=" + URLDecoder.decode(securityPolicyURL.getPath(), "UTF-8")}; } // spawn a JVM that creates a client with a security manager which sends and receives a diff --git a/tests/integration-tests/src/test/resources/restricted-security-client.policy b/tests/integration-tests/src/test/resources/restricted-security-client.policy index 40a2559fca..c374debff4 100644 --- a/tests/integration-tests/src/test/resources/restricted-security-client.policy +++ b/tests/integration-tests/src/test/resources/restricted-security-client.policy @@ -57,4 +57,5 @@ grant { permission java.util.PropertyPermission "sun.nio.ch.bugLevel", "read"; permission java.lang.RuntimePermission "setContextClassLoader"; permission java.lang.RuntimePermission "accessDeclaredMembers"; + permission java.lang.RuntimePermission "accessClassInPackage.sun.misc"; };