当前位置: 首页>>代码示例>>Java>>正文


Java ProcessOutput.appendStdout方法代码示例

本文整理汇总了Java中com.intellij.execution.process.ProcessOutput.appendStdout方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessOutput.appendStdout方法的具体用法?Java ProcessOutput.appendStdout怎么用?Java ProcessOutput.appendStdout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.process.ProcessOutput的用法示例。


在下文中一共展示了ProcessOutput.appendStdout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testValid

import com.intellij.execution.process.ProcessOutput; //导入方法依赖的package包/类
@Test
public void testValid() {
  ProcessOutput processOutput = new ProcessOutput(0);
  processOutput.appendStdout(myOutput);
  assertEquals(" Wrong commits number for " + myOutput, myExpected,
               HgPusher.getNumberOfPushedCommits(new HgCommandResult(processOutput)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:HgPushParseTest.java

示例2: execute

import com.intellij.execution.process.ProcessOutput; //导入方法依赖的package包/类
private String execute(@NotNull List<String> parameters, @NotNull File path) throws SvnBindException {
  // workaround: separately capture command output - used in exception handling logic to overcome svn 1.8 issue (see below)
  final ProcessOutput output = new ProcessOutput();
  LineCommandListener listener = new LineCommandAdapter() {
    @Override
    public void onLineAvailable(String line, Key outputType) {
      if (outputType == ProcessOutputTypes.STDOUT) {
        output.appendStdout(line);
      }
    }
  };

  try {
    CommandExecutor command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.info, parameters, listener);

    return command.getOutput();
  }
  catch (SvnBindException e) {
    final String text = StringUtil.notNullize(e.getMessage());
    if (text.contains("W155010")) {
      // if "svn info" is executed for several files at once, then this warning could be printed only for some files, but info for other
      // files should be parsed from output
      return output.getStdout();
    }
    // not a working copy exception
    // "E155007: '' is not a working copy"
    if (text.contains("is not a working copy") && StringUtil.isNotEmpty(output.getStdout())) {
      // TODO: Seems not reproducible in 1.8.4
      // workaround: as in subversion 1.8 "svn info" on a working copy root outputs such error for parent folder,
      // if there are files with conflicts.
      // but the requested info is still in the output except root closing tag
      return output.getStdout() + "</info>";
    }
    throw e;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:CmdInfoClient.java


注:本文中的com.intellij.execution.process.ProcessOutput.appendStdout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。