Java 类java.rmi.activation.ActivationGroupDesc.CommandEnvironment 实例源码

项目:jdk8u-jdk    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:openjdk-jdk10    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:openjdk9    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:jdk8u_jdk    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:lookaside_java-1.8.0-openjdk    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:infobip-open-jdk-8    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:jdk8u-dev-jdk    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:jdk7-jdk    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:openjdk-source-code-learn    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:OLD-OpenJDK8    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:JAVA_UNIT    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:openjdk-jdk7u-jdk    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:openjdk-icedtea7    文件:NullOptions.java   
public static void main(String[] args) throws Exception {

        CommandEnvironment env1 =
            new CommandEnvironment(null, null);
        CommandEnvironment env2 =
            new CommandEnvironment(null, new String[0]);

        if (env1.equals(env2)) {
            System.err.println("TEST PASSED: environments are equal");
        } else {
            System.err.println("TEST FAILED: environments not equal!");
            throw new RuntimeException("TEST FAILED");
        }
    }
项目:openjdk-jdk10    文件:DownloadActivationGroup.java   
public static void main(String[] args) {

        RMID rmid = null;

        System.out.println("\nRegression test for bug 4510355\n");

        try {
            TestLibrary.suggestSecurityManager("java.lang.SecurityManager");

            /*
             * Install group class file in codebase.
             */
            System.err.println("install class file in codebase");
            URL groupURL = TestLibrary.installClassInCodebase(
                                  "MyActivationGroupImpl", "group");
            System.err.println("class file installed");

            /*
             * Start rmid.
             */
            RMID.removeLog();
            rmid = RMID.createRMIDOnEphemeralPort();
            String execPolicyOption = "-Dsun.rmi.activation.execPolicy=none";
            rmid.addOptions(new String[] { execPolicyOption });
            rmid.start();

            /*
             * Create and register descriptors for custom group and an
             * activatable object in that group.
             */
            System.err.println("register group");

            Properties p = new Properties();
            p.put("java.security.policy", TestParams.defaultGroupPolicy);
            CommandEnvironment cmd = new ActivationGroupDesc.CommandEnvironment(
                    null,
                    new String[] {
                        "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED",
                        "--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED",
                        "--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED",
                        "--add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" });

            ActivationGroupDesc groupDesc =
                new ActivationGroupDesc("MyActivationGroupImpl",
                                        groupURL.toExternalForm(),
                                        null, p, cmd);
            ActivationGroupID groupID =
                ActivationGroup.getSystem().registerGroup(groupDesc);


            System.err.println("register activatable object");
            ActivationDesc desc =
                new ActivationDesc(groupID, "DownloadActivationGroup",
                                   null, null);
            Ping obj = (Ping) Activatable.register(desc);

            /*
             * Start group (by calling ping).
             */
            System.err.println(
                "ping object (forces download of group's class)");
            obj.ping();
            System.err.println(
                "TEST PASSED: group's class downloaded successfully");
            System.err.println("shutdown object");
            obj.shutdown();
            System.err.println("TEST PASSED");

        } catch (Exception e) {
            TestLibrary.bomb(e);
        } finally {
            rmid.cleanup();
        }
    }
项目:openjdk9    文件:DownloadActivationGroup.java   
public static void main(String[] args) {

        RMID rmid = null;

        System.out.println("\nRegression test for bug 4510355\n");

        try {
            TestLibrary.suggestSecurityManager("java.lang.SecurityManager");

            /*
             * Install group class file in codebase.
             */
            System.err.println("install class file in codebase");
            URL groupURL = TestLibrary.installClassInCodebase(
                                  "MyActivationGroupImpl", "group");
            System.err.println("class file installed");

            /*
             * Start rmid.
             */
            RMID.removeLog();
            rmid = RMID.createRMID();
            String execPolicyOption = "-Dsun.rmi.activation.execPolicy=none";
            rmid.addOptions(new String[] { execPolicyOption });
            rmid.start();

            /*
             * Create and register descriptors for custom group and an
             * activatable object in that group.
             */
            System.err.println("register group");

            Properties p = new Properties();
            p.put("java.security.policy", TestParams.defaultGroupPolicy);
            CommandEnvironment cmd = new ActivationGroupDesc.CommandEnvironment(
                    null,
                    new String[] {
                        "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED",
                        "-XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED",
                        "-XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED",
                        "-XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" });

            ActivationGroupDesc groupDesc =
                new ActivationGroupDesc("MyActivationGroupImpl",
                                        groupURL.toExternalForm(),
                                        null, p, cmd);
            ActivationGroupID groupID =
                ActivationGroup.getSystem().registerGroup(groupDesc);


            System.err.println("register activatable object");
            ActivationDesc desc =
                new ActivationDesc(groupID, "DownloadActivationGroup",
                                   null, null);
            Ping obj = (Ping) Activatable.register(desc);

            /*
             * Start group (by calling ping).
             */
            System.err.println(
                "ping object (forces download of group's class)");
            obj.ping();
            System.err.println(
                "TEST PASSED: group's class downloaded successfully");
            System.err.println("shutdown object");
            obj.shutdown();
            System.err.println("TEST PASSED");

        } catch (Exception e) {
            TestLibrary.bomb(e);
        } finally {
            rmid.cleanup();
        }
    }