Package com.sun.jini.start

Examples of com.sun.jini.start.AggregatePolicyProvider.grant()


  } catch (NullPointerException e) {
  }
  policy.setPolicy(null, new DynamicPolicyProvider());
  policy.setPolicy(NullCasesTest.class.getClassLoader(), null);

  policy.grant(null, null, null);
  try {
      policy.grant(null, new Principal[]{ null }, null);
      throw new TestException("Successfully granted: "
                    + "null, new Principal[]{ null }, null");
  } catch (NullPointerException e) {
View Full Code Here


  policy.setPolicy(null, new DynamicPolicyProvider());
  policy.setPolicy(NullCasesTest.class.getClassLoader(), null);

  policy.grant(null, null, null);
  try {
      policy.grant(null, new Principal[]{ null }, null);
      throw new TestException("Successfully granted: "
                    + "null, new Principal[]{ null }, null");
  } catch (NullPointerException e) {
  }
  try {
View Full Code Here

      throw new TestException("Successfully granted: "
                    + "null, new Principal[]{ null }, null");
  } catch (NullPointerException e) {
  }
  try {
      policy.grant(null, null, new Permission[]{ null });
      throw new TestException("Successfully granted: "
                    + "null, null, new Permission[]{ null }");
  } catch (NullPointerException e) {
  }
  policy.getGrants(null, null);
View Full Code Here

  checkPolicy0Permissions(policy);
  if (policy.grantSupported()) {
      throw new TestException("1-st grant is supported.");
  }
  try {
      policy.grant(null, null,
       new Permission[]{ new RuntimePermission("foo") });
      throw new TestException("1-st grant does not throw exception.");
  } catch (UnsupportedOperationException e) {
  }
View Full Code Here

  thr.setContextClassLoader(ldr1);
  checkPolicy1Permissions(policy);
  if (!policy.grantSupported()) {
      throw new TestException("2-nd grant is not supported.");
  }
  policy.grant(null, null,
         new Permission[]{ new RuntimePermission("foo") });

  thr.setContextClassLoader(ldr2);
  checkPolicy1Permissions(policy);
  if (!policy.grantSupported()) {
View Full Code Here

  thr.setContextClassLoader(ldr2);
  checkPolicy1Permissions(policy);
  if (!policy.grantSupported()) {
      throw new TestException("3-rd grant is not supported.");
  }
  policy.grant(null, null,
         new Permission[]{ new RuntimePermission("foo") });

  policy.setPolicy(ldr2, new PolicyFileProvider(policy0File));
  checkPolicy0Permissions(policy);
  if (policy.grantSupported()) {
View Full Code Here

  checkPolicy0Permissions(policy);
  if (policy.grantSupported()) {
      throw new TestException("4-th grant is supported.");
  }
  try {
      policy.grant(null, null,
       new Permission[]{ new RuntimePermission("foo") });
      throw new TestException("2-nd grant does not throw exception.");
  } catch (UnsupportedOperationException e) {
  }
View Full Code Here

  thr.setContextClassLoader(ldr1);
  checkPolicy1Permissions(policy);
  if (!policy.grantSupported()) {
      throw new TestException("5-th grant is not supported.");
  }
  policy.grant(null, null,
         new Permission[]{ new RuntimePermission("foo") });

  policy.setPolicy(ldr2, null);
  thr.setContextClassLoader(ldr2);
  checkPolicy1Permissions(policy);
View Full Code Here

  thr.setContextClassLoader(ldr2);
  checkPolicy1Permissions(policy);
  if (!policy.grantSupported()) {
      throw new TestException("6-th grant is not supported.");
  }
  policy.grant(null, null,
         new Permission[]{ new RuntimePermission("foo") });
    }

    static void checkPolicy0Permissions(Policy policy) throws Exception {
  checkPermissions(policy, "file:/foo/bar",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.