use of org.opensolaris.opengrok.util.Executor in project OpenGrok by OpenGrok.
the class MercurialRepositoryTest method runHgCommand.
/**
* Run Mercurial command.
*
* @param command hg command to run
* @param reposRoot directory of the repository root
* @param arg argument to use for the command
*/
static void runHgCommand(String command, File reposRoot, String arg) {
String[] cmdargs = { MercurialRepository.CMD_FALLBACK, command, arg };
Executor exec = new Executor(Arrays.asList(cmdargs), reposRoot);
int exitCode = exec.exec();
if (exitCode != 0) {
fail("hg " + command + " failed." + "\nexit code: " + exitCode + "\nstdout:\n" + exec.getOutputString() + "\nstderr:\n" + exec.getErrorString());
}
}
Aggregations