Author: gtrasuk
Date: Wed Nov 25 19:15:27 2015
New Revision: 1716512
URL: http://svn.apache.org/viewvc?rev=1716512&view=rev
Log:
Add java.lang.reflect.ReflectPermission to the test harness's policy, allowing
creation of service proxies. This enables the test harness to run under later
versions of JDK7 and JDK8.
It's a common pattern to use dynamically-created proxies to services. If the
service interface is not public (as is the case with the underlying proxy to
things like Reggie, Fiddler, etc, creating smart proxies that implement the
public interface, which delegates to a "dumb" remote proxy that implements a
package-private interface), then the proxy needs to be created in the same
package as the interface. Older versions of the JDK did this quietly, but
later versions require the executing code to have a
java.lang.reflect.ReflectPermission("newProxyInPackage.xyz") that corresponds
to the interface's package.
This patch adds those ReflectPermissions to the QA harness's policy, allowing
the harness to run on later versions of the JDK, both JDK7 and JDK8. Running
on an older version of JDK should still be OK, as the permission is ignored if
it isn't needed.
Modified:
river/jtsk/branches/2.2/qa/harness/policy/defaulttest.policy
Modified: river/jtsk/branches/2.2/qa/harness/policy/defaulttest.policy
URL:
http://svn.apache.org/viewvc/river/jtsk/branches/2.2/qa/harness/policy/defaulttest.policy?rev=1716512&r1=1716511&r2=1716512&view=diff
==============================================================================
--- river/jtsk/branches/2.2/qa/harness/policy/defaulttest.policy (original)
+++ river/jtsk/branches/2.2/qa/harness/policy/defaulttest.policy Wed Nov 25
19:15:27 2015
@@ -78,6 +78,23 @@ grant {
permission java.util.PropertyPermission
"*", "read";
+
+ // JDK8 seems to have made these necessary too...
+ permission java.lang.reflect.ReflectPermission
+ "newProxyInPackage.com.sun.jini.norm";
+
+ permission java.lang.reflect.ReflectPermission
+ "newProxyInPackage.com.sun.jini.fiddler";
+
+ permission java.lang.reflect.ReflectPermission
+ "newProxyInPackage.com.sun.jini.reggie";
+
+ permission java.lang.reflect.ReflectPermission
+ "newProxyInPackage.com.sun.jini.outrigger";
+
+ permission java.lang.reflect.ReflectPermission
+ "newProxyInPackage.com.sun.jini.mercury";
+
};
// needed by some io tests