Examples of ExecResult


Examples of jetbrains.buildServer.ExecResult

  }

  public static ExecResult runCommand(@NotNull GeneralCommandLine cli, Integer timeout) throws VcsException {
    String cmdStr = cli.getCommandLineString();
    Loggers.VCS.info("Run Command: " + cmdStr);
    ExecResult res = SimpleCommandLineProcessRunner.runCommand(cli, null, new OurRunCommandEvents(timeout));
    CommandUtil.checkCommandFailed(cmdStr, res);
    Loggers.VCS.info(res.getStdout());
    return res;
  }
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

            int exitValue = executor.execute(cl);
            // if the size is zero, we have no output, so construct the result
            // with null (required by ExecResult)
            InputStream stdout = out.size() == 0 ? null : new ByteArrayInputStream(out.toByteArray());
            InputStream stderr = err.size() == 0 ? null : new ByteArrayInputStream(err.toByteArray());
            ExecResult result = new ExecResult(command, stdout, stderr, exitValue);
            return result;

        } catch (ExecuteException ee) {
            LOG.error("ExecException while executing command: " + command.toString() + " - " + ee.getMessage());
            throw new ExecException("Failed to execute command " + command, ee);
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

    public ExecResult lastCommandResult;

    public ExecResult execute(ExecCommand command) {

        lastCommandResult = new ExecResult(command, new ByteArrayInputStream(STD_OUT_VALUE.getBytes()), null, 0);
        return lastCommandResult;
    }
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

            int exitValue = executor.execute(cl);
            // if the size is zero, we have no output, so construct the result
            // with null (required by ExecResult)
            InputStream stdout = out.size() == 0 ? null : new ByteArrayInputStream(out.toByteArray());
            InputStream stderr = err.size() == 0 ? null : new ByteArrayInputStream(err.toByteArray());
            ExecResult result = new ExecResult(command, stdout, stderr, exitValue);
            return result;

        } catch (ExecuteException ee) {
            LOG.error("ExecException while executing command: " + command.toString() + " - " + ee.getMessage());
            throw new ExecException("Failed to execute command " + command, ee);
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

    @Test
    @Ignore
    public void testExecLinuxWordCount() throws Exception {
        // use type conversion here
        ExecResult body = templateWordCount.requestBody((Object)"test", ExecResult.class);
        assertNotNull(body);

    }
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

     * The test assumes, that java is in the system path
     */
    @Test
    @Ignore
    public void testJavaVersion() throws Exception {
        ExecResult body = templateJavaVersion.requestBody((Object)"test", ExecResult.class);
        InputStream out = body.getStdout();
        InputStream err = body.getStderr();
        // Strange that Sun Java 1.5 writes the -version in the syserr
        assertNull(out);
        assertNotNull(err);
        String outString = IOUtils.toString(err);
        log.info("Received stdout: " + outString);
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

    }

    @Test
    @Ignore
    public void testWinJavaVersionWorkingDir() throws Exception {
        ExecResult body = templateJavaVersionWorkingDir.requestBody((Object)"test", ExecResult.class);
        InputStream out = body.getStdout();
        InputStream err = body.getStderr();
        // Strange that Sun Java 1.5 writes the -version in the syserr
        assertNull(out);
        assertNotNull(err);
        String outerr = IOUtils.toString(err);
        log.info("Received stderr: " + outerr);
View Full Code Here

Examples of org.apache.camel.component.exec.ExecResult

    public void testExecWinAnt() throws Exception {
        File f = new File(ANT_BUILD_FILE_NAME);
        f.createNewFile();
        FileUtils.writeStringToFile(f, ANT_BUILD_FILE_CONTENT);
        assertTrue("You must create a sample build file!", f.exists());
        ExecResult body = templateExecAnt.requestBody((Object)"test", ExecResult.class);
        String stdout = IOUtils.toString(body.getStdout());
        assertNull(body.getStderr());
        assertTrue("The ant script should print" + TEST_MSG, stdout.contains(TEST_MSG));
        f.delete();
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.ExecResult

      IOException ioe = new IOException(e.toString());
      ioe.setStackTrace(e.getStackTrace());
      throw ioe;
    }

    return new ExecResult(value);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.ExecResult

            mutations.add(a);
          } else if (action instanceof Get) {
            response.add(regionName, originalIndex,
                get(regionName, (Get)action));
          } else if (action instanceof Exec) {
            ExecResult result = execCoprocessor(regionName, (Exec)action);
            response.add(regionName, new Pair<Integer, Object>(
                a.getOriginalIndex(), result.getValue()
            ));
          } else if (action instanceof Increment) {
            response.add(regionName, originalIndex,
                increment(regionName, (Increment)action));
          } else if (action instanceof Append) {
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.