Repository: sqoop Updated Branches: refs/heads/sqoop2 008b12693 -> fc1b1f950
SQOOP-2761: Sqoop2: Provide test infrastructure base class for tool tests (Dian Fu via Jarek Jarcec Cecho) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/fc1b1f95 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/fc1b1f95 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/fc1b1f95 Branch: refs/heads/sqoop2 Commit: fc1b1f950c6ad064d3829c5a93c2c344e114ec13 Parents: 008b126 Author: Jarek Jarcec Cecho <[email protected]> Authored: Thu Dec 31 06:14:55 2015 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Thu Dec 31 06:14:55 2015 -0800 ---------------------------------------------------------------------- .../apache/sqoop/test/infrastructure/SqoopTestCase.java | 8 ++++++++ .../integration/tools/RepositoryDumpLoadToolTest.java | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/fc1b1f95/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java b/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java index 71cdc22..8fbefd8 100644 --- a/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java +++ b/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java @@ -630,4 +630,12 @@ public class SqoopTestCase implements ITest { Assert.assertEquals(inputSet, outputSet); } + + protected String getTemporaryPath() { + return HdfsUtils.joinPathFragments(ROOT_PATH, suiteName); + } + + protected String getSqoopMiniClusterTemporaryPath() { + return getInfrastructureProvider(SqoopInfrastructureProvider.class).getRootPath(); + } } http://git-wip-us.apache.org/repos/asf/sqoop/blob/fc1b1f95/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java b/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java index 8fe37f8..03d4a9f 100644 --- a/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java +++ b/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java @@ -19,7 +19,6 @@ package org.apache.sqoop.integration.tools; import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils; -import org.apache.log4j.Logger; import org.apache.sqoop.common.VersionInfo; import org.apache.sqoop.json.JSONUtils; import org.apache.sqoop.json.JobsBean; @@ -27,7 +26,10 @@ import org.apache.sqoop.json.LinksBean; import org.apache.sqoop.json.SubmissionsBean; import org.apache.sqoop.model.*; import org.apache.sqoop.submission.SubmissionStatus; -import org.apache.sqoop.test.testcases.ConnectorTestCase; +import org.apache.sqoop.test.infrastructure.Infrastructure; +import org.apache.sqoop.test.infrastructure.SqoopTestCase; +import org.apache.sqoop.test.infrastructure.providers.KdcInfrastructureProvider; +import org.apache.sqoop.test.infrastructure.providers.SqoopInfrastructureProvider; import org.apache.sqoop.test.utils.HdfsUtils; import org.apache.sqoop.tools.tool.JSONConstants; import org.apache.sqoop.tools.tool.RepositoryDumpTool; @@ -43,9 +45,9 @@ import java.util.List; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; -public class RepositoryDumpLoadToolTest extends ConnectorTestCase { +@Infrastructure(dependencies = {KdcInfrastructureProvider.class, SqoopInfrastructureProvider.class}) +public class RepositoryDumpLoadToolTest extends SqoopTestCase { - private static final Logger LOG = Logger.getLogger(RepositoryDumpLoadToolTest.class); private String jsonFilePath; // do the load test and insert data to repo first, then do the dump test.
