本文整理汇总了Java中org.apache.commons.exec.LogOutputStream类的典型用法代码示例。如果您正苦于以下问题:Java LogOutputStream类的具体用法?Java LogOutputStream怎么用?Java LogOutputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogOutputStream类属于org.apache.commons.exec包,在下文中一共展示了LogOutputStream类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runMavenCommand
import org.apache.commons.exec.LogOutputStream; //导入依赖的package包/类
@When("I run maven with args: (.*)")
public void runMavenCommand(List<String> mvnArgs) throws IOException {
this.mvnArgs.addAll(mvnArgs);
System.out.println("Launching Maven with args <" + Joiner.on(" ").join(mvnArgs) + ">");
CommandLine cmdLine = new CommandLine(getCommandLine());
for (String mvnArg : mvnArgs) {
cmdLine.addArgument(mvnArg);
}
if (confdForCucumberLocation != null) {
cmdLine.addArgument("-Dcucumber.confd.binary.path=" + confdForCucumberLocation);
}
DefaultExecutor executor = new DefaultExecutor();
if (projectRootAsFile != null) {
executor.setWorkingDirectory(projectRootAsFile);
}
executor.setExitValue(expectedExitCode);
executor.setStreamHandler(new PumpStreamHandler(new LogOutputStream() {
@Override
protected void processLine(String line, int level) {
System.out.println(line);
executorOutput.add(line);
}
}));
exitCode = executor.execute(cmdLine, environment);
fullOutput = Joiner.on(LINE_SEPARATOR).join(executorOutput);
}
示例2: configure
import org.apache.commons.exec.LogOutputStream; //导入依赖的package包/类
@Override
public void configure(Binder binder) {
binder.bind(Osprey.class).in(Singleton.class);
binder.bind(Commander.class).toProvider(CommanderProvider.class).in(Singleton.class);
binder.bind(DeployCommand.class).in(Singleton.class);
binder.bind(Logger.class).toProvider(LoggerProvider.class).in(Singleton.class);
binder.bind(DeploymentPlanManager.class).toProvider(DeploymentPlanManagerProvider.class).in(Singleton.class);
binder.bind(LogOutputStream.class).to(LogOutputStreamImpl.class).in(Singleton.class);
binder.bind(PluginManager.class).toProvider(PluginManagerProvider.class).in(Singleton.class);
binder.bind(ProjectActionPlanner.class).in(Singleton.class);
}
示例3: LocalShellAction
import org.apache.commons.exec.LogOutputStream; //导入依赖的package包/类
public LocalShellAction(CommandLine commandLine, LogOutputStream logOutputStream) {
this.commandLine = commandLine;
this.logOutputStream = logOutputStream;
}