You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/03/12 19:37:40 UTC

qpid-jms git commit: add more tests around truststore handling during ssl context creation

Repository: qpid-jms
Updated Branches:
  refs/heads/master 4ded822f4 -> d26790342


add more tests around truststore handling during ssl context creation


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/d2679034
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/d2679034
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/d2679034

Branch: refs/heads/master
Commit: d267903425d12113f88160bb3cd30c87b53bf96e
Parents: 4ded822
Author: Robert Gemmell <ro...@apache.org>
Authored: Thu Mar 12 17:12:39 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Thu Mar 12 18:37:13 2015 +0000

----------------------------------------------------------------------
 .../jms/transports/TransportSupportTest.java    | 25 ++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d2679034/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/TransportSupportTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/TransportSupportTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/TransportSupportTest.java
index b9067de..7de95a8 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/TransportSupportTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/TransportSupportTest.java
@@ -34,7 +34,7 @@ import org.apache.qpid.jms.test.QpidJmsTestCase;
 import org.junit.Test;
 
 /**
- * Tests for the TransmportSupport class.
+ * Tests for the TransportSupport class.
  */
 public class TransportSupportTest extends QpidJmsTestCase {
 
@@ -84,12 +84,33 @@ public class TransportSupportTest extends QpidJmsTestCase {
     }
 
     @Test(expected = IOException.class)
-    public void testCreateSslContextBadPathToStore() throws Exception {
+    public void testCreateSslContextBadPathToKeyStore() throws Exception {
         TransportSslOptions options = createJksSslOptions();
         options.setKeyStoreLocation(CLIENT_JKS_KEYSTORE + ".bad");
         TransportSupport.createSslContext(options);
     }
 
+    @Test(expected = UnrecoverableKeyException.class)
+    public void testCreateSslContextNoTrustStorePassword() throws Exception {
+        TransportSslOptions options = createJksSslOptions();
+        options.setTrustStorePassword(null);
+        TransportSupport.createSslContext(options);
+    }
+
+    @Test(expected = IOException.class)
+    public void testCreateSslContextWrongTrustStorePassword() throws Exception {
+        TransportSslOptions options = createJksSslOptions();
+        options.setTrustStorePassword("wrong");
+        TransportSupport.createSslContext(options);
+    }
+
+    @Test(expected = IOException.class)
+    public void testCreateSslContextBadPathToTrustStore() throws Exception {
+        TransportSslOptions options = createJksSslOptions();
+        options.setTrustStoreLocation(CLIENT_JKS_TRUSTSTORE + ".bad");
+        TransportSupport.createSslContext(options);
+    }
+
     @Test
     public void testCreateSslContextJceksStore() throws Exception {
         TransportSslOptions options = createJceksSslOptions();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org