diff --git a/src/test/org/apache/sqoop/TestFreeFormQueryImport.java b/src/test/org/apache/sqoop/TestFreeFormQueryImport.java index 2df4352a..d39faee5 100644 --- a/src/test/org/apache/sqoop/TestFreeFormQueryImport.java +++ b/src/test/org/apache/sqoop/TestFreeFormQueryImport.java @@ -90,7 +90,7 @@ public void tearDown() { args.add("--connect"); args.add(getConnectString()); args.add("--target-dir"); - args.add(getWarehouseDir()); + args.add(getTablePath().toString()); args.add("--split-by"); args.add(splitByCol); args.add("--num-mappers"); @@ -134,8 +134,7 @@ public void testSimpleJoin() throws IOException { runImport(getArgv(tableName1 + "." + getColName(0), query)); - Path warehousePath = new Path(this.getWarehouseDir()); - Path filePath = new Path(warehousePath, "part-m-00000"); + Path filePath = new Path(getTablePath(), "part-m-00000"); String expectedVal = "1,foo"; BufferedReader reader = null; diff --git a/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java b/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java index 734499e5..eaab8c57 100644 --- a/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java +++ b/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java @@ -87,7 +87,7 @@ public void tearDown() { args.add(mySQLTestUtils.getUserName()); mySQLTestUtils.addPasswordIfIsSet(args); args.add("--target-dir"); - args.add(getWarehouseDir()); + args.add(getTablePath().toString()); args.add("--num-mappers"); args.add("1"); args.add("--table"); @@ -105,8 +105,7 @@ public void testEscapeColumnWithDoubleQuote() throws IOException { String[] args = getArgv(); runImport(args); - Path warehousePath = new Path(this.getWarehouseDir()); - Path filePath = new Path(warehousePath, "part-m-00000"); + Path filePath = new Path(getTablePath(), "part-m-00000"); String output = Files.toString(new File(filePath.toString()), Charsets.UTF_8); assertEquals("hello, world", output.trim()); diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java index d4146dcb..684586c8 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java @@ -87,7 +87,7 @@ public void tearDown() { args.add("--password"); args.add(OracleUtils.ORACLE_USER_PASS); args.add("--target-dir"); - args.add(getWarehouseDir()); + args.add(getTablePath().toString()); args.add("--num-mappers"); args.add("1"); args.add("--query"); @@ -104,8 +104,7 @@ public void testRegexpReplaceEscapeWithSpecialCharacters() throws IOException { String[] args = getArgv(); runImport(args); - Path warehousePath = new Path(this.getWarehouseDir()); - Path filePath = new Path(warehousePath, "part-m-00000"); + Path filePath = new Path(getTablePath(), "part-m-00000"); String output = Files.toString(new File(filePath.toString()), Charsets.UTF_8); assertEquals("hello, world!", output.trim()); diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java index 4dde3d62..8e6ccc96 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java @@ -109,7 +109,7 @@ public void tearDown() { args.add("--connect"); args.add(getConnectString()); args.add("--target-dir"); - args.add(getWarehouseDir()); + args.add(getTablePath().toString()); args.add("--num-mappers"); args.add("1"); args.add("--split-by"); @@ -153,8 +153,7 @@ public void testIncrementalImportWithLastModified() throws IOException { String[] args = getArgv(tableName, connPropsFileName, getColName(2)); runImport(args); - Path warehousePath = new Path(this.getWarehouseDir()); - Path filePath = new Path(warehousePath, "part-m-00000"); + Path filePath = new Path(getTablePath().toString(), "part-m-00000"); String output = readLineFromPath(filePath); String expectedVal = "2,new_data,2000-11-11"; assertEquals("Incremental import result expected a different string", @@ -181,8 +180,7 @@ public void testIncrementalImportWithLastModifiedTimestamp() throws IOException String[] args = getArgv(tableName, connPropsFileName, getColName(2)); runImport(args); - Path warehousePath = new Path(this.getWarehouseDir()); - Path filePath = new Path(warehousePath, "part-m-00000"); + Path filePath = new Path(getTablePath(), "part-m-00000"); String output = readLineFromPath(filePath); String expectedVal = "2,new_data,2000-11-11 23:23:23.0"; assertEquals("Incremental import result expected a different string", diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleSpecialCharacterTableImportTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleSpecialCharacterTableImportTest.java index 453ad821..6539e5a9 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleSpecialCharacterTableImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleSpecialCharacterTableImportTest.java @@ -98,7 +98,7 @@ public void tearDown() { args.add("--password"); args.add(OracleUtils.ORACLE_USER_PASS); args.add("--target-dir"); - args.add(getWarehouseDir()); + args.add(getTablePath().toString()); args.add("--num-mappers"); args.add("1"); args.add("--table"); @@ -120,8 +120,7 @@ public void testImportWithTableNameContainingSpecialCharacters() throws IOExcept String[] args = getArgv(); runImport(args); - Path warehousePath = new Path(this.getWarehouseDir()); - Path filePath = new Path(warehousePath, "part-m-00000"); + Path filePath = new Path(getTablePath(), "part-m-00000"); String output = Files.toString(new File(filePath.toString()), Charsets.UTF_8); assertEquals("hello, world!", output.trim()); diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java index 33b7d745..c2f9532c 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java @@ -91,7 +91,7 @@ public void tearDown() { args.add("--connect"); args.add(getConnectString()); args.add("--target-dir"); - args.add(getWarehouseDir()); + args.add(getTablePath().toString()); args.add("--num-mappers"); args.add("2"); args.add("--split-by"); @@ -127,13 +127,13 @@ public void testTimestampSplitter() throws IOException { List lines; // First row should be in the first file - file = new File(this.getWarehouseDir(), "part-m-00000"); + file = new File(getTablePath().toString(), "part-m-00000"); lines = FileUtils.readLines(file, "UTF-8"); assertEquals(1, lines.size()); assertEquals("1,old_data,1999-01-01 11:11:11.0", lines.get(0)); // With second line in the second file - file = new File(this.getWarehouseDir(), "part-m-00001"); + file = new File(getTablePath().toString(), "part-m-00001"); lines = FileUtils.readLines(file, "UTF-8"); assertEquals(1, lines.size()); assertEquals("2,new_data,2000-11-11 23:23:23.0", lines.get(0));