Package org.apache.harmony.rmi.common

Examples of org.apache.harmony.rmi.common.SubProcess


     */
    public static SubProcess invokeSimilar(String[] options, String className,
            String[] params, boolean useEndorsedDirs, boolean useBootClassPath)
            throws IOException {
        // @ToDo: Rewrite with ProcessBuilder for Java 5.0.
        return new SubProcess(createArgsArray(options, className, params,
                useEndorsedDirs, useBootClassPath));
    }
View Full Code Here


     *
     * @throws  Exception
     *          If some error occurs.
     */
    public void testSingleVM(int config, boolean endorsed) throws Exception {
        SubProcess server = null;

        try {
            System.out.println("Starting test server");
            server = startProcess("org.apache.harmony.rmi.ConnectionTest",
                            CHILD_ID, config, endorsed);
            server.pipeError();
            server.closeOutput();
            System.out.println("Expecting READY from server");
            server.expect();
            server.pipeInput();
        } finally {
            if (server != null) {
                System.out.println("Destroying server");
                server.destroy();
            }
        }
    }
View Full Code Here

     *          If some error occurs.
     */
    private void test0(int configServer, boolean endorsedServer,
            int configClient, boolean endorsedClient, int configRegistry,
            boolean endorsedRegistry) throws Exception {
        SubProcess registry = null;
        SubProcess server = null;
        SubProcess client = null;

        try {
            System.out.println("test0: creating registry");
            registry = startProcess("org.apache.harmony.rmi.DGCTest",
                    REGISTRY_ID, configRegistry, endorsedRegistry);
            registry.pipeError();
            System.out.println("test0: Expecting READY from registry");
            registry.expect();
            registry.pipeInput();

            System.out.println("test0: starting server");
            server = startProcess("org.apache.harmony.rmi.DGCTest",
                    SERVER_ID_0, configServer, endorsedServer);
            server.pipeError();
            server.closeOutput();
            System.out.println("test0: Expecting READY from server");
            server.expect();

            System.out.println("test0: starting client");
            client = startProcess("org.apache.harmony.rmi.DGCTest",
                    CLIENT_ID_0, configClient, endorsedClient);
            client.pipeInput();
            client.pipeError();
            client.closeOutput();

            System.out.println("test0: Expecting STARTED from server");
            server.expect("TestObject.test1() started");
            server.pipeInput();

            System.out.println("test0: destroying registry");
            registry.destroy();

            System.out.println("test0: destroying client");
            client.destroy();

            System.out.println("test0: waiting for server to return");
            assertEquals("Test server return", 0, server.waitFor());
        } finally {
            if (registry != null) {
                registry.destroy();
            }
            if (client != null) {
                client.destroy();
            }
            if (server != null) {
                server.destroy();
            }
        }
View Full Code Here

     *
     * @throws  Exception
     *          If some error occurs.
     */
    private void test3(int config, boolean endorsed) throws Exception {
        SubProcess server = null;

        try {
            System.out.println("test3: starting server");
            server = startProcess("org.apache.harmony.rmi.DGCTest",
                    SERVER_ID_3, config, endorsed);
            server.pipeInput();
            server.pipeError();
            server.closeOutput();
            assertEquals("Test server return", 0, server.waitFor());
        } finally {
            if (server != null) {
                server.destroy();
            }
        }
    }
View Full Code Here

     *          If some error occurs.
     */
    private void test0(int configServer, boolean endorsedServer,
            int configClient, boolean endorsedClient, int configRegistry,
            boolean endorsedRegistry) throws Exception {
        SubProcess registry = null;
        SubProcess server = null;
        SubProcess client = null;

        try {
            System.out.println("test0: creating registry");
            registry = startProcess("org.apache.harmony.rmi.DGCTest",
                    REGISTRY_ID, configRegistry, endorsedRegistry);
            registry.pipeError();
            System.out.println("test0: Expecting READY from registry");
            registry.expect();
            registry.pipeInput();

            System.out.println("test0: starting server");
            server = startProcess("org.apache.harmony.rmi.DGCTest",
                    SERVER_ID_0, configServer, endorsedServer);
            server.pipeError();
            server.closeOutput();
            System.out.println("test0: Expecting READY from server");
            server.expect();

            System.out.println("test0: starting client");
            client = startProcess("org.apache.harmony.rmi.DGCTest",
                    CLIENT_ID_0, configClient, endorsedClient);
            client.pipeInput();
            client.pipeError();
            client.closeOutput();

            System.out.println("test0: Expecting STARTED from server");
            server.expect("TestObject.test1() started");
            server.pipeInput();

            System.out.println("test0: destroying registry");
            registry.destroy();

            System.out.println("test0: destroying client");
            client.destroy();

            System.out.println("test0: waiting for server to return");
            assertEquals("Test server return", 0, server.waitFor());
        } finally {
            if (registry != null) {
                registry.destroy();
            }
            if (client != null) {
                client.destroy();
            }
            if (server != null) {
                server.destroy();
            }
        }
View Full Code Here

     *
     * @throws  Exception
     *          If some error occurs.
     */
    private void test3(int config, boolean endorsed) throws Exception {
        SubProcess server = null;

        try {
            System.out.println("test3: starting server");
            server = startProcess("org.apache.harmony.rmi.DGCTest",
                    SERVER_ID_3, config, endorsed);
            server.pipeInput();
            server.pipeError();
            server.closeOutput();
            assertEquals("Test server return", 0, server.waitFor());
        } finally {
            if (server != null) {
                server.destroy();
            }
        }
    }
View Full Code Here

     */
    public static SubProcess invokeSimilar(String[] options, String className,
            String[] params, boolean useEndorsedDirs, boolean useBootClassPath)
            throws IOException {
        // @ToDo: Rewrite with ProcessBuilder for Java 5.0.
        return new SubProcess(createArgsArray(options, className, params,
                useEndorsedDirs, useBootClassPath));
    }
View Full Code Here

     *
     * @throws  Exception
     *          If some error occurs.
     */
    public void testSingleVM(int config, boolean endorsed) throws Exception {
        SubProcess server = null;

        try {
            System.out.println("Starting test server");
            server = startProcess("org.apache.harmony.rmi.ConnectionTest",
                            CHILD_ID, config, endorsed);
            server.pipeError();
            server.closeOutput();
            System.out.println("Expecting READY from server");
            server.expect();
            server.pipeInput();
        } finally {
            if (server != null) {
                System.out.println("Destroying server");
                server.destroy();
            }
        }
    }
View Full Code Here

import org.apache.harmony.rmi.common.SubProcess;
import junit.framework.TestCase;

public class StartupShutdownTest extends TestCase {
    public void testStartup() throws Exception {
        SubProcess rmid = JavaInvoker.invokeSimilar((String[]) null,
                "org.apache.harmony.rmi.activation.Rmid", (String[]) null, true, true);
        rmid.pipeError();
        rmid.pipeInput();
        rmid.closeOutput();
        Thread.sleep(5000);
        ActivationSystem as = ActivationGroup.getSystem();
        assertNotNull(as);
        rmid.destroy();
    }
View Full Code Here

     *
     * @throws  Exception
     *          If some error occurs.
     */
    public void testSingleVM(int config, boolean endorsed) throws Exception {
        SubProcess server = null;

        try {
            System.out.println("Starting test server");
            server = startProcess("org.apache.harmony.rmi.ConnectionTest",
                            CHILD_ID, config, endorsed);
            server.pipeError();
            server.closeOutput();
            System.out.println("Expecting READY from server");
            server.expect();
            server.pipeInput();
        } finally {
            if (server != null) {
                System.out.println("Destroying server");
                server.destroy();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.rmi.common.SubProcess

Copyright © 2018 www.massapicom. 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.