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


Java CommandLine.getStdOut方法代码示例

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


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

示例1: start

import org.openqa.selenium.os.CommandLine; //导入方法依赖的package包/类
/**
 * 启动appium服务端
 *
 *
 * @throws AppiumServerHasNotBeenStartedLocallyException
 * 如果在产生子进程中发生错误,则抛此异常
 *
 * @see #stop()
 */
public void start() throws AppiumServerHasNotBeenStartedLocallyException {
    lock.lock();
    try {
        if (isRunning()) {
            return;
        }

        try {
            process = new CommandLine(this.nodeJSExec.getCanonicalPath(),
                nodeJSArgs.toArray(new String[] {}));
            process.setEnvironmentVariables(nodeJSEnvironment);
            process.copyOutputTo(stream);
            process.executeAsync();
            ping(startupTimeout, timeUnit);
        } catch (Throwable e) {
            destroyProcess();
            String msgTxt = "本地appium服务尚未启动. "
                + "Node.js路径: " + this.nodeJSExec.getAbsolutePath()
                + " 参数: " + nodeJSArgs.toString() + " " + "\n";
            if (process != null) {
                String processStream = process.getStdOut();
                if (!StringUtils.isBlank(processStream)) {
                    msgTxt = msgTxt + "Process output: " + processStream + "\n";
                }
            }

            throw new AppiumServerHasNotBeenStartedLocallyException(msgTxt, e);
        }
    } finally {
        lock.unlock();
    }
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:42,代码来源:AppiumDriverLocalService.java


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