use of org.apache.hadoop.hive.ql.QTestProcessExecResult in project hive by apache.
the class CoreNegativeCliDriver method runTest.
@Override
public void runTest(String tname, String fname, String fpath) throws Exception {
long startTime = System.currentTimeMillis();
try {
System.err.println("Begin query: " + fname);
qt.setInputFile(fpath);
qt.cliInit();
try {
qt.executeClient();
qt.failed(fname, QTestUtil.DEBUG_HINT);
} catch (CommandProcessorException e) {
// this is the expected outcome
}
QTestProcessExecResult result = qt.checkCliDriverResults();
if (result.getReturnCode() != 0) {
String message = Strings.isNullOrEmpty(result.getCapturedOutput()) ? QTestUtil.DEBUG_HINT : "\r\n" + result.getCapturedOutput();
qt.failedDiff(result.getReturnCode(), fname, message);
}
} catch (AssumptionViolatedException e) {
throw e;
} catch (Error error) {
QTestProcessExecResult qTestProcessExecResult = qt.checkNegativeResults(fname, error);
if (qTestProcessExecResult.getReturnCode() != 0) {
String message = Strings.isNullOrEmpty(qTestProcessExecResult.getCapturedOutput()) ? QTestUtil.DEBUG_HINT : "\r\n" + qTestProcessExecResult.getCapturedOutput();
qt.failedDiff(qTestProcessExecResult.getReturnCode(), fname, message);
}
} catch (Exception e) {
qt.failedWithException(e, fname, QTestUtil.DEBUG_HINT);
}
long elapsedTime = System.currentTimeMillis() - startTime;
System.err.println("Done query: " + fname + " elapsedTime=" + elapsedTime / 1000 + "s");
assertTrue("Test passed", true);
}
use of org.apache.hadoop.hive.ql.QTestProcessExecResult in project hive by apache.
the class CoreKuduNegativeCliDriver method runTest.
@Override
public void runTest(String tname, String fname, String fpath) {
long startTime = System.currentTimeMillis();
try {
System.err.println("Begin query: " + fname);
qt.setInputFile(fpath);
qt.cliInit();
try {
qt.executeClient();
qt.failed(fname, null);
} catch (CommandProcessorException e) {
// this is the expected behaviour
}
QTestProcessExecResult result = qt.checkCliDriverResults();
if (result.getReturnCode() != 0) {
qt.failedDiff(result.getReturnCode(), fname, result.getCapturedOutput());
}
} catch (Exception e) {
qt.failedWithException(e, fname, null);
}
long elapsedTime = System.currentTimeMillis() - startTime;
System.err.println("Done query: " + fname + " elapsedTime=" + elapsedTime / 1000 + "s");
assertTrue("Test passed", true);
}
Aggregations