geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nre...@apache.org
Subject [geode] branch feature/GEODE-3781 updated: Add missing test
Date Fri, 17 Nov 2017 00:18:41 GMT
This is an automated email from the ASF dual-hosted git repository.

nreich pushed a commit to branch feature/GEODE-3781
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3781 by this push:
     new ab71e44  Add missing test
ab71e44 is described below

commit ab71e4471f207f5ea8113d8019a9587e7c5caa6f
Author: Nick Reich <nreich@pivotal.io>
AuthorDate: Thu Nov 16 16:18:28 2017 -0800

    Add missing test
---
 .../org/apache/geode/connectors/jdbc/internal/ConnectionManager.java | 2 +-
 .../apache/geode/connectors/jdbc/internal/xml/ElementTypeTest.java   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java
b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java
index 67e6b51..4f4a520 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java
@@ -134,8 +134,8 @@ class ConnectionManager {
             "The table " + tableName + " has more than one primary key column.");
       }
     } catch (SQLException e) {
+      key = null;
       handleSQLException(e);
-      key = null; // never reached
     }
     return key;
   }
diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/xml/ElementTypeTest.java
b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/xml/ElementTypeTest.java
index 42fe507..cca2bec 100644
--- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/xml/ElementTypeTest.java
+++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/xml/ElementTypeTest.java
@@ -74,6 +74,11 @@ public class ElementTypeTest {
   }
 
   @Test
+  public void gettingElementTypeThatDoesNotExistThrowsException() {
+    assertThatThrownBy(() -> ElementType.getTypeFromName("non-existant element")).isInstanceOf(IllegalArgumentException.class);
+  }
+
+  @Test
   public void startElementConnectionServiceThrowsWithoutCacheCreation() {
     stack.push(new Object());
     assertThatThrownBy(() -> CONNECTION_SERVICE.startElement(stack, attributes))

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message