Repository: hbase Updated Branches: refs/heads/branch-1 fd002eaea -> fcb335c4f
HBASE-14572 TestImportExport#testImport94Table can't find its src data file Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/fcb335c4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/fcb335c4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/fcb335c4 Branch: refs/heads/branch-1 Commit: fcb335c4fdee9c9d32ed3d062cff922668ba1c8d Parents: fd002ea Author: stack <[email protected]> Authored: Tue Oct 6 23:27:58 2015 -0700 Committer: stack <[email protected]> Committed: Tue Oct 6 23:30:18 2015 -0700 ---------------------------------------------------------------------- .../hbase/mapreduce/TestImportExport.java | 22 +++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/fcb335c4/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index d18557e..117b5b7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.net.URL; @@ -105,7 +106,8 @@ public class TestImportExport { UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); UTIL.startMiniCluster(); UTIL.startMiniMapReduceCluster(); - FQ_OUTPUT_DIR = new Path(OUTPUT_DIR).makeQualified(FileSystem.get(UTIL.getConfiguration())).toString(); + FQ_OUTPUT_DIR = + new Path(OUTPUT_DIR).makeQualified(FileSystem.get(UTIL.getConfiguration())).toString(); } @AfterClass @@ -220,13 +222,19 @@ public class TestImportExport { */ @Test public void testImport94Table() throws Exception { - URL url = TestImportExport.class.getResource( - "exportedTableIn94Format"); - Path importPath = new Path(url.getPath()); + final String name = "exportedTableIn94Format"; + URL url = TestImportExport.class.getResource(name); + File f = new File(url.toURI()); + if (!f.exists()) { + LOG.warn("FAILED TO FIND " + f + "; skipping out on test"); + return; + } + assertTrue(f.exists()); + LOG.info("FILE=" + f); + Path importPath = new Path(f.toURI()); FileSystem fs = FileSystem.get(UTIL.getConfiguration()); - fs.copyFromLocalFile(importPath, new Path(FQ_OUTPUT_DIR + Path.SEPARATOR - + "exportedTableIn94Format")); - String IMPORT_TABLE = "importTableExportedFrom94"; + fs.copyFromLocalFile(importPath, new Path(FQ_OUTPUT_DIR + Path.SEPARATOR + name)); + String IMPORT_TABLE = name; Table t = UTIL.createTable(TableName.valueOf(IMPORT_TABLE), Bytes.toBytes("f1"), 3); String[] args = new String[] { "-Dhbase.import.version=0.94" ,
