sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2546: Sqoop2: RESTiliency: Unify behavior on getting details on non-existing connector
Date Thu, 24 Dec 2015 11:49:09 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 15328cc92 -> b1561866e


SQOOP-2546: Sqoop2: RESTiliency: Unify behavior on getting details on non-existing connector

(Colin Ma 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/b1561866
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/b1561866
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/b1561866

Branch: refs/heads/sqoop2
Commit: b1561866ed3e1f4b85299d27568351a50dffa3da
Parents: 15328cc
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Thu Dec 24 12:48:14 2015 +0100
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Thu Dec 24 12:48:14 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/sqoop/handler/LinkRequestHandler.java    | 2 +-
 .../java/org/apache/sqoop/server/common/ServerError.java     | 3 ---
 .../sqoop/integration/server/rest/ConnectorRestTest.java     | 8 +-------
 .../apache/sqoop/integration/server/rest/LinkRestTest.java   | 2 +-
 4 files changed, 3 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/b1561866/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
index 189293a..5b1258f 100644
--- a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
@@ -203,7 +203,7 @@ public class LinkRequestHandler implements RequestHandler {
         links = repository.findLinks();
       } else {
         if(repository.findConnector(connectorName) == null) {
-          throw new SqoopException(ServerError.SERVER_0005, "Invalid connector: " + connectorName);
+          throw new SqoopException(ServerError.SERVER_0006, "Invalid connector: " + connectorName);
         }
         links = repository.findLinksForConnector(connectorName);
       }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/b1561866/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/server/common/ServerError.java b/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
index 57bb5c0..1b021cf 100644
--- a/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
+++ b/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
@@ -36,9 +36,6 @@ public enum ServerError implements ErrorCode {
   /** Invalid argument in HTTP request */
   SERVER_0004("Invalid argument in HTTP request"),
 
-  /** Invalid entity requested */
-  SERVER_0005("Invalid entity requested"),
-
   /** Entity requested doesn't exist*/
   SERVER_0006("Entity requested doesn't exist"),
   ;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/b1561866/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 3146279..83265d3 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
@@ -41,17 +41,11 @@ public class ConnectorRestTest extends RestTest {
       void validate() throws Exception {
         assertResponseCode(200);
       }}),
-    new TestDescription("Get connector by non-existing ID", "v1/connector/666", "GET", null,
new Validator() {
-      @Override
-      void validate() throws Exception {
-        assertResponseCode(500);
-        assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0006");
-      }}),
     new TestDescription("Get connector by non-existing name", "v1/connector/jarcecs-cool-connector",
"GET", null, new Validator() {
       @Override
       void validate() throws Exception {
         assertResponseCode(500);
-        assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0005");
+        assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0006");
       }}),
     new TestDescription("Invalid post request", "v1/connector", "POST", "Random data", new
Validator() {
       @Override

http://git-wip-us.apache.org/repos/asf/sqoop/blob/b1561866/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 99959ac..36f3598 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
@@ -62,7 +62,7 @@ public class LinkRestTest extends RestTest {
       @Override
       void validate() throws Exception {
         assertResponseCode(500);
-        assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0005");
+        assertServerException("org.apache.sqoop.server.common.ServerError", "SERVER_0006");
         assertContains("Invalid connector: i-dont-exists");
       }}),
   };


Mime
View raw message