Package org.apache.ace.processlauncher.impl

Examples of org.apache.ace.processlauncher.impl.ProcessLauncher


        String execName = "/bin/sh";
        String input = "echo '1'\nls $0\nsleep 1\n";

        TestProcessStreamListener psl = new TestProcessStreamListener(true /* wantsStdin */, true /* wantsStdout */);

        ProcessLauncher launcher = createProcessLauncher(psl, null, execName);

        launcher.run();

        psl.writeToStdin(input);
        psl.closeStdin();

        Integer exitValue = launcher.waitForTermination();

        assertNotNull(exitValue);
        assertEquals(0, exitValue.intValue());

        String stdout = psl.slurpStdout();
View Full Code Here


        String execName = "/bin/sh";
        String[] execArgs = { "-c", "echo '1'\nls $0\nsleep 1\n" };

        TestProcessStreamListener psl = new TestProcessStreamListener(false /* wantsStdin */, true /* wantsStdout */);

        ProcessLauncher launcher = createProcessLauncher(psl, null, execName, execArgs);

        launcher.run();

        Integer exitValue = launcher.waitForTermination();

        String stdout = psl.slurpStdout();
        assertNotNull(stdout);
        assertTrue(stdout.length() > 0);

View Full Code Here

        String execName = "/bin/cat";
        String input = "echo '1'\nls $0\nqux qoo\n";

        TestProcessStreamListener psl = new TestProcessStreamListener(true /* wantsStdin */, true /* wantsStdout */);

        ProcessLauncher launcher = createProcessLauncher(psl, null, execName);

        launcher.run();

        // Issue the command...
        psl.writeToStdin(input);

        sleep(1000);

        psl.closeStdin();

        Integer exitValue = launcher.waitForTermination();

        assertNotNull(exitValue);
        assertEquals(0, exitValue.intValue());

        String stdout = psl.slurpStdout();
View Full Code Here

     * @param execArgs the (optional) arguments.
     * @return a {@link ProcessLauncher} instance, never <code>null</code>.
     */
    private ProcessLauncher createProcessLauncher(ProcessStreamListener processStreamListener,
        ProcessLifecycleListener processLifecycleListener, String execName, String... execArgs) {
        return new ProcessLauncher(createLaunchConfiguration(false, execName, execArgs), processStreamListener,
            processLifecycleListener);
    }
View Full Code Here

     * @param execName the name of the executable;
     * @param execArgs the (optional) arguments.
     * @return a {@link ProcessLauncher} instance, never <code>null</code>.
     */
    private ProcessLauncher createProcessLauncher(String execName, String... execArgs) {
        return new ProcessLauncher(createLaunchConfiguration(false, execName, execArgs));
    }
View Full Code Here

TOP

Related Classes of org.apache.ace.processlauncher.impl.ProcessLauncher

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.