Example #1
0
  private int runTool(BaseTool tool, String... arguments) throws Exception {
    mToolOutputBytes.reset();
    final PrintStream pstream = new PrintStream(mToolOutputBytes);
    tool.setPrintStream(pstream);
    try {
      LOG.info("Running tool: '{}' with parameters {}", tool.getName(), arguments);
      return tool.toolMain(Lists.newArrayList(arguments));
    } finally {
      pstream.flush();
      pstream.close();

      mToolOutputStr = Bytes.toString(mToolOutputBytes.toByteArray());
      LOG.info(
          "Captured output for tool: '{}' with parameters {}:\n{}\n{}{}\n",
          tool.getName(),
          arguments,
          RULER,
          mToolOutputStr,
          RULER);
      mToolOutputLines = mToolOutputStr.split("\n");
    }
  }
Example #2
0
 @Inject
 @Override
 public void setServiceUrl(@Named("service.deployments") String serviceUrl) {
   super.setServiceUrl(serviceUrl);
 }