You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2016/08/18 18:21:53 UTC
hive git commit: HIVE-14552: TestParseNegative fix (Hari Subramaniyan,
reviewed by Ashutosh Chauhan)
Repository: hive
Updated Branches:
refs/heads/master a7cf25a5a -> 6d3085b7e
HIVE-14552: TestParseNegative fix (Hari Subramaniyan, reviewed by Ashutosh Chauhan)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/6d3085b7
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/6d3085b7
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/6d3085b7
Branch: refs/heads/master
Commit: 6d3085b7e5b686a7dc7d37df754816d34247c5e6
Parents: a7cf25a
Author: Hari Subramaniyan <ha...@apache.org>
Authored: Thu Aug 18 11:21:37 2016 -0700
Committer: Hari Subramaniyan <ha...@apache.org>
Committed: Thu Aug 18 11:21:37 2016 -0700
----------------------------------------------------------------------
.../hadoop/hive/ql/parse/CoreParseNegative.java | 23 +++++++++-----------
1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/6d3085b7/itests/util/src/main/java/org/apache/hadoop/hive/ql/parse/CoreParseNegative.java
----------------------------------------------------------------------
diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/parse/CoreParseNegative.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/parse/CoreParseNegative.java
index a74f293..8dba0bb 100644
--- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/parse/CoreParseNegative.java
+++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/parse/CoreParseNegative.java
@@ -36,7 +36,7 @@ public class CoreParseNegative extends CliAdapter{
private static QTestUtil qt;
static CliConfigs.ParseNegativeConfig cliConfig = new CliConfigs.ParseNegativeConfig();
-
+ static boolean firstRun;
public CoreParseNegative(AbstractCliConfig testCliConfig) {
super(testCliConfig);
}
@@ -47,7 +47,7 @@ public class CoreParseNegative extends CliAdapter{
MiniClusterType miniMR = cliConfig.getClusterType();
String initScript = cliConfig.getInitScript();
String cleanupScript = cliConfig.getCleanupScript();
-
+ firstRun = true;
try {
String hadoopVer = cliConfig.getHadoopVersion();
qt = new QTestUtil((cliConfig.getResultsDir()), (cliConfig.getLogDir()), miniMR, null,
@@ -68,26 +68,21 @@ public class CoreParseNegative extends CliAdapter{
@Override
@After
public void tearDown() {
- try {
- qt.clearPostTestEffects();
- } catch (Exception e) {
- System.err.println("Exception: " + e.getMessage());
- e.printStackTrace();
- System.err.flush();
- fail("Unexpected exception in tearDown");
- }
}
@Override
@AfterClass
public void shutdown() throws Exception {
+ String reason = "clear post test effects";
try {
+ qt.clearPostTestEffects();
+ reason = "shutdown";
qt.shutdown();
} catch (Exception e) {
System.err.println("Exception: " + e.getMessage());
e.printStackTrace();
System.err.flush();
- throw new RuntimeException("Unexpected exception in shutdown",e);
+ throw new RuntimeException("Unexpected exception in " + reason,e);
}
}
@@ -102,8 +97,10 @@ public class CoreParseNegative extends CliAdapter{
System.err.println("Begin query: " + fname);
qt.addFile(fpath);
-
- qt.init(fname);
+ if (firstRun) {
+ qt.init(fname);
+ firstRun = false;
+ }
ASTNode tree = qt.parseQuery(fname);
List<Task<? extends Serializable>> tasks = qt.analyzeAST(tree);
fail("Unexpected success for query: " + fname + debugHint);