Repository: sqoop Updated Branches: refs/heads/sqoop2 cba043cce -> 1007da03e
SQOOP-2778: Sqoop2: LinkRestTest failed (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/1007da03 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/1007da03 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/1007da03 Branch: refs/heads/sqoop2 Commit: 1007da03e1109531a59403c62251ab071fef9f06 Parents: cba043c Author: Jarek Jarcec Cecho <[email protected]> Authored: Wed Jan 6 07:36:19 2016 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Wed Jan 6 07:36:19 2016 -0800 ---------------------------------------------------------------------- .../org/apache/sqoop/test/infrastructure/SqoopTestCase.java | 3 ++- .../sqoop/integration/server/rest/ConnectorRestTest.java | 9 ++------- .../apache/sqoop/integration/server/rest/LinkRestTest.java | 4 ++-- .../org/apache/sqoop/integration/server/rest/RestTest.java | 4 ++-- .../sqoop/integration/server/rest/VersionRestTest.java | 2 +- test/src/test/resources/new-integration-tests-suite.xml | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/1007da03/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 c300b33..becfa6b 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 @@ -48,6 +48,7 @@ import org.apache.sqoop.test.infrastructure.providers.SqoopInfrastructureProvide import org.apache.sqoop.test.kdc.KdcRunner; import org.apache.sqoop.test.utils.HdfsUtils; import org.apache.sqoop.test.utils.SqoopUtils; +import org.apache.sqoop.utils.UrlSafeUtils; import org.apache.sqoop.validation.Status; import org.testng.Assert; import org.testng.ITest; @@ -261,7 +262,7 @@ public class SqoopTestCase implements ITest { return HdfsUtils.joinPathFragments( getInfrastructureProvider(HadoopInfrastructureProvider.class).getInstance().getTestDirectory(), getClass().getName(), - getTestName()); + UrlSafeUtils.urlPathEncode((getTestName()))); } /** http://git-wip-us.apache.org/repos/asf/sqoop/blob/1007da03/test/src/test/java/org/apache/sqoop/integration/server/rest/ConnectorRestTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/sqoop/integration/server/rest/ConnectorRestTest.java b/test/src/test/java/org/apache/sqoop/integration/server/rest/ConnectorRestTest.java index 83265d3..839a4d0 100644 --- a/test/src/test/java/org/apache/sqoop/integration/server/rest/ConnectorRestTest.java +++ b/test/src/test/java/org/apache/sqoop/integration/server/rest/ConnectorRestTest.java @@ -31,11 +31,6 @@ public class ConnectorRestTest extends RestTest { void validate() throws Exception { assertResponseCode(200); }}), - new TestDescription("Get connector by ID", "v1/connector/1", "GET", null, new Validator() { - @Override - void validate() throws Exception { - assertResponseCode(200); - }}), new TestDescription("Get connector by name", "v1/connector/generic-jdbc-connector", "GET", null, new Validator() { @Override void validate() throws Exception { @@ -45,13 +40,13 @@ public class ConnectorRestTest extends RestTest { @Override void validate() throws Exception { assertResponseCode(500); - assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0006"); + assertServerException("Entity requested doesn't exist", "SERVER_0006"); }}), new TestDescription("Invalid post request", "v1/connector", "POST", "Random data", new Validator() { @Override void validate() throws Exception { assertResponseCode(500); - assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0002"); + assertServerException("Unsupported HTTP method", "SERVER_0002"); }}), }; http://git-wip-us.apache.org/repos/asf/sqoop/blob/1007da03/test/src/test/java/org/apache/sqoop/integration/server/rest/LinkRestTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/sqoop/integration/server/rest/LinkRestTest.java b/test/src/test/java/org/apache/sqoop/integration/server/rest/LinkRestTest.java index 36f3598..c6f4eed 100644 --- a/test/src/test/java/org/apache/sqoop/integration/server/rest/LinkRestTest.java +++ b/test/src/test/java/org/apache/sqoop/integration/server/rest/LinkRestTest.java @@ -55,14 +55,14 @@ public class LinkRestTest extends RestTest { @Override void validate() throws Exception { assertResponseCode(500); - assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0006"); + assertServerException("Entity requested doesn't exist", "SERVER_0006"); assertContains("Invalid link name: i-dont-exists"); }}), new TestDescription("Get links for non existing connector", "v1/link/all?cname=i-dont-exists", "GET", null, new Validator() { @Override void validate() throws Exception { assertResponseCode(500); - assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0006"); + assertServerException("Entity requested doesn't exist", "SERVER_0006"); assertContains("Invalid connector: i-dont-exists"); }}), }; http://git-wip-us.apache.org/repos/asf/sqoop/blob/1007da03/test/src/test/java/org/apache/sqoop/integration/server/rest/RestTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/sqoop/integration/server/rest/RestTest.java b/test/src/test/java/org/apache/sqoop/integration/server/rest/RestTest.java index ff6b30d..71384fb 100644 --- a/test/src/test/java/org/apache/sqoop/integration/server/rest/RestTest.java +++ b/test/src/test/java/org/apache/sqoop/integration/server/rest/RestTest.java @@ -75,12 +75,12 @@ public abstract class RestTest extends SqoopTestCase { } // Assert given exception from server - public void assertServerException(String errorClass, String errorCode) throws Exception { + public void assertServerException(String errorMessage, String errorCode) throws Exception { // On exception, the error trace can't be null assertNotNull(error); // We're not parsing entire JSON, but rather just looking for sub-strings that are of particular interest - assertTrue(error.contains("error-code-class\":\"" + errorClass)); + assertTrue(error.contains("error-code-message\":\"" + errorMessage)); assertTrue(error.contains("error-code\":\"" + errorCode)); } http://git-wip-us.apache.org/repos/asf/sqoop/blob/1007da03/test/src/test/java/org/apache/sqoop/integration/server/rest/VersionRestTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/sqoop/integration/server/rest/VersionRestTest.java b/test/src/test/java/org/apache/sqoop/integration/server/rest/VersionRestTest.java index bac5c43..e4c89df 100644 --- a/test/src/test/java/org/apache/sqoop/integration/server/rest/VersionRestTest.java +++ b/test/src/test/java/org/apache/sqoop/integration/server/rest/VersionRestTest.java @@ -35,7 +35,7 @@ public class VersionRestTest extends RestTest { @Override void validate() throws Exception { assertResponseCode(500); - assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0002"); + assertServerException("Unsupported HTTP method", "SERVER_0002"); }}), }; http://git-wip-us.apache.org/repos/asf/sqoop/blob/1007da03/test/src/test/resources/new-integration-tests-suite.xml ---------------------------------------------------------------------- diff --git a/test/src/test/resources/new-integration-tests-suite.xml b/test/src/test/resources/new-integration-tests-suite.xml index 8206e52..96a1320 100644 --- a/test/src/test/resources/new-integration-tests-suite.xml +++ b/test/src/test/resources/new-integration-tests-suite.xml @@ -26,7 +26,7 @@ limitations under the License. <test name="ServerTests"> <packages> - <package name="org.apache.sqoop.integration.server"/> + <package name="org.apache.sqoop.integration.server.*"/> </packages> </test>
