PHOENIX-4758 Validate that HADOOP_CONF_DIR is not set for HiveMRIT

Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/99465bc1
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/99465bc1
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/99465bc1

Branch: refs/heads/4.x-HBase-1.2
Commit: 99465bc149095dec23f43849d8d0a49f49526acf
Parents: 9db22d8
Author: Josh Elser <els...@apache.org>
Authored: Tue May 29 14:14:04 2018 -0400
Committer: Josh Elser <els...@apache.org>
Committed: Mon Jun 4 12:46:52 2018 -0400

----------------------------------------------------------------------
 .../src/it/java/org/apache/phoenix/hive/HiveMapReduceIT.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/99465bc1/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveMapReduceIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveMapReduceIT.java 
b/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveMapReduceIT.java
index 644ff24..4bc5a7d 100644
--- a/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveMapReduceIT.java
+++ b/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveMapReduceIT.java
@@ -18,6 +18,10 @@
 
 package org.apache.phoenix.hive;
 
+import static org.junit.Assert.fail;
+
+import java.util.Map;
+
 import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
@@ -28,6 +32,10 @@ public class HiveMapReduceIT extends HivePhoenixStoreIT {
 
     @BeforeClass
     public static void setUpBeforeClass() throws Exception {
+        final String hadoopConfDir = System.getenv("HADOOP_CONF_DIR");
+        if (hadoopConfDir != null && hadoopConfDir.length() != 0) {
+            fail("HADOOP_CONF_DIR is non-empty in the current shell 
environment which will very likely cause this test to fail.");
+        }
         setup(HiveTestUtil.MiniClusterType.mr);
     }
 }

Reply via email to