Examples of ProcessLauncher


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

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

        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

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

        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

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

     * @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

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

     * @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

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.ProcessLauncher

  protected void launch(final List<String> processArguments, final Map<String, String> enVars) throws CoreException {
    // If there are process arguments, launch the process
    if (!processArguments.isEmpty()) {

      // Launch the process from the same thread
      new ProcessLauncher() {
        protected String getLaunchName() {
          return serviceCommand.getDisplayName();
        }

        protected List<String> getProcessArguments() throws CoreException {
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.