Example usage for org.openqa.selenium.os CommandLine getExitCode

List of usage examples for org.openqa.selenium.os CommandLine getExitCode

Introduction

In this page you can find the example usage for org.openqa.selenium.os CommandLine getExitCode.

Prototype

public int getExitCode() 

Source Link

Usage

From source file:com.opera.core.systems.common.io.ProcessManager.java

License:Apache License

private static String executeCommand(String commandName, String... args) {
    CommandLine cmd = new CommandLine(commandName, args);
    logger.fine(cmd.toString());/*from   w  ww.ja  v a  2 s .co  m*/

    cmd.execute();
    String output = cmd.getStdOut();

    if (!cmd.isSuccessful()) {
        throw new WebDriverException(String.format("exec return code %d: %s", cmd.getExitCode(), output));
    }

    return output;
}