aboutsummaryrefslogtreecommitdiff
path: root/bigtop-tests
diff options
context:
space:
mode:
authorRaj Desai <rddesai@us.ibm.com>2016-10-27 10:31:24 -0700
committerRoman Shaposhnik <rvs@apache.org>2017-03-23 10:27:09 -0700
commita9be67525558cbb5651181966297b00de78fc9a3 (patch)
tree0fe3bacc059997de1c3f5797f73eb10677a350b6 /bigtop-tests
parent62dbaf77de9c197e70c3a0424bebdef8a678d2ce (diff)
Added logging and return in catch blocks from Alan's comments.
(cherry picked from commit 84eef9f47d05392f7b8710c3897fa3bf47bca796)
Diffstat (limited to 'bigtop-tests')
-rw-r--r--bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java b/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
index 2ac9cc8e..a4477ffe 100644
--- a/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
+++ b/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
@@ -36,8 +36,7 @@ import org.apache.commons.logging.LogFactory;
public class HiveHelper {
private static final Log LOG = LogFactory.getLog(HiveHelper.class.getName());
-
-
+
public static Map<String, String> execCommand(CommandLine commandline) {
System.out.println("Executing command:");
@@ -48,6 +47,7 @@ public class HiveHelper {
env = EnvironmentUtils.getProcEnvironment();
} catch (IOException e1) {
// TODO Auto-generated catch block
+ LOG.debug("Failed to get process environment: "+ e1.getMessage());
e1.printStackTrace();
}
@@ -63,10 +63,20 @@ public class HiveHelper {
executor.execute(commandline, env, resultHandler);
} catch (ExecuteException e) {
// TODO Auto-generated catch block
+ LOG.debug("Failed to execute command with exit value: "+ String.valueOf(resultHandler.getExitValue()));
+ LOG.debug("outputStream: "+ outputStream.toString());
+ entry.put("exitValue", String.valueOf(resultHandler.getExitValue()));
+ entry.put("outputStream", outputStream.toString() + e.getMessage());
e.printStackTrace();
+ return entry;
} catch (IOException e) {
// TODO Auto-generated catch block
+ LOG.debug("Failed to execute command with exit value: "+ String.valueOf(resultHandler.getExitValue()));
+ LOG.debug("outputStream: "+ outputStream.toString());
+ entry.put("exitValue", String.valueOf(resultHandler.getExitValue()));
+ entry.put("outputStream", outputStream.toString() + e.getMessage());
e.printStackTrace();
+ return entry;
}
try {