Examples of ExportPermission


Examples of net.jini.export.ExportPermission

    private static boolean checkNonPublicInterface(Class intf) {
  if (!Modifier.isPublic(intf.getModifiers())) {
      SecurityManager sm = System.getSecurityManager();
      if (sm != null) {
    String pString = "exportRemoteInterface." + intf.getName();
    sm.checkPermission(new ExportPermission(pString));
      }
      return true;
  }
  return false;
    }
View Full Code Here

Examples of net.jini.export.ExportPermission

     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        for (int i = 0; i < targetNames.length; i++) {
            logger.log(Level.FINE, "\n\t+++++ Test Case #" + (i + (int)1));
            if (!checker(new ExportPermission(targetNames[i]), "")) {
                throw new TestException(
                        "" + " test failed");
            }
        }
        return;
View Full Code Here

Examples of net.jini.export.ExportPermission

     * @return true if the result of comparison of hash codes for
     *         {@link net.jini.export.ExportPermission} objects is equal to
     *         the expected result or false otherwise
     */
    public boolean checker(TestCase tc) {
        ExportPermission p1 = tc.getPermission1();
        ExportPermission p2 = tc.getPermission2();
        boolean expected = tc.getExpected();
       
        logger.log(Level.FINE, "\t+++ " + p1 + ".hashCode()");
        int p1_hashCode = p1.hashCode();
        logger.log(Level.FINE, "\t+++ " + p2 + ".hashCode()");
        int p2_hashCode = p2.hashCode();
        logger.log(Level.FINE, "1-st ExportPermission object: " + p1);
        logger.log(Level.FINE, "2-nd ExportPermission object: " + p2);
        logger.log(Level.FINE, "hash code for the 1-st object: " + p1_hashCode);
        logger.log(Level.FINE, "hash code for the 2-nd object: " + p2_hashCode);
        if (expected == true) {
View Full Code Here

Examples of net.jini.export.ExportPermission

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        for (int i = 0; i < targetNames.length; i++) {
            perms[i] = new ExportPermission(targetNames[i]);
        }
       
        if (!checker(perms)) {
            throw new TestException(
                    "" + " test failed");
View Full Code Here

Examples of net.jini.export.ExportPermission

            permColl.add(obj[i]);
        }
        logger.log(Level.FINE, "permColl:\n" + permColl.toString());
        Enumeration elements = permColl.elements();
        for (; elements.hasMoreElements() ;) {
            ExportPermission perm = (ExportPermission) elements.nextElement();
            for (int i = 0; i < obj.length; i++) {
                if (obj[i] == null) {
                    continue;
                }
                if (obj[i].equals(perm)) {
View Full Code Here

Examples of net.jini.export.ExportPermission

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        for (int i = 0; i < targetNames.length; i++) {
            if (!checker(new ExportPermission(targetNames[i]), targetNames[i])) {
                throw new TestException(
                        "" + " test failed");
            }
        }
        return;
View Full Code Here

Examples of net.jini.export.ExportPermission

     * @return true if the result of
     *         {@link java.security.BasicPermission#implies(Permission)} is
     *         equal to the expected result or false otherwise
     */
    public boolean checker(TestCase tc) {
        ExportPermission p1 = tc.getPermission1();
        ExportPermission p2 = tc.getPermission2();
        boolean expected = tc.getExpected();
  
        logger.log(Level.FINE, "1-st ExportPermission object: " + p1);
        logger.log(Level.FINE, "2-nd ExportPermission object: " + p2);
        logger.log(Level.FINE, "\t+++ " + p1 + ".implies(" + p2 + ")");
View Full Code Here

Examples of net.jini.export.ExportPermission

     * @return true if the result of
     *         {@link java.security.BasicPermission#equals(Object)} is equal to
     *         the expected result or false otherwise
     */
    public boolean checker(TestCase tc) {
        ExportPermission p1 = tc.getPermission1();
        ExportPermission p2 = tc.getPermission2();
        boolean expected = tc.getExpected();
  
        logger.log(Level.FINE, "1-st ExportPermission object: " + p1);
        logger.log(Level.FINE, "2-nd ExportPermission object: " + p2);
        logger.log(Level.FINE, "\t+++ " + p1 + ".equals(" + p2 + ")");
View Full Code Here

Examples of net.jini.export.ExportPermission

            /* Checking ExportPermission(String) constructor */
            logger.log(Level.FINE,
                    "\n\t+++++ invoking ExportPermission(" + targetNames[i]
                    + ")");
            if (!checker(new ExportPermission(targetNames[i]),
                    targetNames[i])) {
                throw new TestException(
                        "" + " test failed");
            }

            /* Checking ExportPermission(String,String) constructor */
            logger.log(Level.FINE,
                    "\n\t+++++ new ExportPermission(" + targetNames[i]
                    + ", null)");
            if (!checker(new ExportPermission(targetNames[i], null),
                    targetNames[i])) {
                throw new TestException(
                        "" + " test failed");
            }
        }
View Full Code Here

Examples of net.jini.export.ExportPermission

    private static boolean checkNonPublicInterface(Class intf) {
  if (!Modifier.isPublic(intf.getModifiers())) {
      SecurityManager sm = System.getSecurityManager();
      if (sm != null) {
    String pString = "exportRemoteInterface." + intf.getName();
    sm.checkPermission(new ExportPermission(pString));
      }
      return true;
  }
  return false;
    }
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.