You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/01/09 11:11:55 UTC

qpid-broker-j git commit: QPID-6933: [System Tests] Fix failing tests in TlsTest

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master ac146cdc8 -> adf475f1e


QPID-6933: [System Tests] Fix failing tests in TlsTest


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

Branch: refs/heads/master
Commit: adf475f1e9198ca32b17c80644bbe8319f47f071
Parents: ac146cd
Author: Alex Rudyy <or...@apache.org>
Authored: Tue Jan 9 11:09:34 2018 +0000
Committer: Alex Rudyy <or...@apache.org>
Committed: Tue Jan 9 11:11:12 2018 +0000

----------------------------------------------------------------------
 .../jms_1_1/extensions/tls/TlsTest.java         | 21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/adf475f1/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/tls/TlsTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/tls/TlsTest.java b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/tls/TlsTest.java
index 4036db0..7d7e1a1 100644
--- a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/tls/TlsTest.java
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/tls/TlsTest.java
@@ -36,7 +36,10 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
 import java.net.InetSocketAddress;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.security.Key;
 import java.security.cert.Certificate;
@@ -138,7 +141,7 @@ public class TlsTest extends JmsTestBase
                                                       .setHost(brokerAddress.getHostName())
                                                       .setTls(true)
                                                       .setOptions(Collections.singletonMap("trusted_certs_path",
-                                                                                           trustCertFile.getCanonicalPath()))
+                                                                                           encodePathOption(trustCertFile.getCanonicalPath())))
                                                       .build();
         try
         {
@@ -487,8 +490,8 @@ public class TlsTest extends JmsTestBase
         clearSslStoreSystemProperties();
         File[] certAndKeyFiles = extractResourcesFromTestKeyStore();
         final Map<String, String> options = new HashMap<>();
-        options.put("client_cert_path", certAndKeyFiles[1].getCanonicalPath());
-        options.put("client_cert_priv_key_path", certAndKeyFiles[0].getCanonicalPath());
+        options.put("client_cert_path", encodePathOption(certAndKeyFiles[1].getCanonicalPath()));
+        options.put("client_cert_priv_key_path", encodePathOption(certAndKeyFiles[0].getCanonicalPath()));
         InetSocketAddress brokerAddress = getBrokerAdmin().getBrokerAddress(BrokerAdmin.PortType.AMQP);
         Connection connection = getConnectionBuilder().setSslPort(port)
                                                       .setHost(brokerAddress.getHostName())
@@ -764,4 +767,16 @@ public class TlsTest extends JmsTestBase
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         assertNotNull("create session should be successful", session);
     }
+
+    private String encodePathOption(final String canonicalPath)
+    {
+        try
+        {
+            return URLEncoder.encode(canonicalPath, StandardCharsets.UTF_8.name()).replace("+", "%20");
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
 }


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