hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/4] hbase git commit: HBASE-19310 Avoid an NPE IntegrationTestImportTsv when outside of the context of JUnit
Date Wed, 22 Nov 2017 22:32:16 GMT
HBASE-19310 Avoid an NPE IntegrationTestImportTsv when outside of the context of JUnit

Signed-off-by: Michael Stack <stack@apache.org>
Signed-off-by: Ted Yu <tedyu@apache.org>


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

Branch: refs/heads/master
Commit: b0b606429339aabe9fb964af6bf3c3129b3ac375
Parents: 548ebbc
Author: Josh Elser <elserj@apache.org>
Authored: Tue Nov 21 13:34:51 2017 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Nov 22 17:06:49 2017 -0500

----------------------------------------------------------------------
 .../hbase/mapreduce/IntegrationTestImportTsv.java       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b0b60642/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
index 887dd8b..dfc54e0 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
@@ -185,13 +185,15 @@ public class IntegrationTestImportTsv extends Configured implements
Tool {
 
   @Test
   public void testGenerateAndLoad() throws Exception {
+    generateAndLoad(TableName.valueOf(name.getMethodName()));
+  }
+
+  void generateAndLoad(final TableName table) throws Exception {
     LOG.info("Running test testGenerateAndLoad.");
-    final TableName table = TableName.valueOf(name.getMethodName());
     String cf = "d";
     Path hfiles = new Path(
         util.getDataTestDirOnTestFS(table.getNameAsString()), "hfiles");
 
-
     Map<String, String> args = new HashMap<>();
     args.put(ImportTsv.BULK_OUTPUT_CONF_KEY, hfiles.toString());
     args.put(ImportTsv.COLUMNS_CONF_KEY,
@@ -226,7 +228,11 @@ public class IntegrationTestImportTsv extends Configured implements Tool
{
     // adding more test methods? Don't forget to add them here... or consider doing what
     // IntegrationTestsDriver does.
     provisionCluster();
-    testGenerateAndLoad();
+    TableName tableName = TableName.valueOf("IntegrationTestImportTsv");
+    if (util.getAdmin().tableExists(tableName)) {
+      util.deleteTable(tableName);
+    }
+    generateAndLoad(tableName);
     releaseCluster();
 
     return 0;


Mime
View raw message