qpid-broker-j git commit: QPID-7782: [Tests] Add checks for the supported SASL mechanisms

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

qpid-broker-j git commit: QPID-7782: [Tests] Add checks for the supported SASL mechanisms

orudyy
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 2535b45de -> ce077c25c


QPID-7782: [Tests] Add checks for the supported SASL mechanisms


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/ce077c25
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/ce077c25
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/ce077c25

Branch: refs/heads/master
Commit: ce077c25cb96338115e3d871299bd226012ee5a1
Parents: 2535b45
Author: Alex Rudyy <[hidden email]>
Authored: Mon Jun 12 13:09:16 2017 +0100
Committer: Alex Rudyy <[hidden email]>
Committed: Mon Jun 12 13:09:16 2017 +0100

----------------------------------------------------------------------
 .../apache/qpid/tests/protocol/v1_0/BrokerAdmin.java    |  3 +++
 .../protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java  | 12 ++++++++++++
 .../protocol/v1_0/ExternalQpidBrokerAdminImpl.java      | 12 ++++++++++++
 .../protocol/v1_0/transport/security/sasl/SaslTest.java | 10 ++++++++++
 4 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/ce077c25/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java
----------------------------------------------------------------------
diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java
index a263b2d..9af7cf7 100644
--- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java
+++ b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java
@@ -45,6 +45,9 @@ public interface BrokerAdmin extends Pluggable
     boolean supportsRestart();
     ListenableFuture<Void> restart();
 
+    boolean isSASLSupported();
+    boolean isSASLMechanismSupported(String mechanismName);
+
     enum PortType
     {
         ANONYMOUS_AMQP,

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/ce077c25/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
----------------------------------------------------------------------
diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
index 1240b94..baaa172 100644
--- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
+++ b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
@@ -330,6 +330,18 @@ public class EmbeddedBrokerPerClassAdminImpl implements BrokerAdmin
     }
 
     @Override
+    public boolean isSASLSupported()
+    {
+        return true;
+    }
+
+    @Override
+    public boolean isSASLMechanismSupported(final String mechanismName)
+    {
+        return true;
+    }
+
+    @Override
     public String getType()
     {
         return "EMBEDDED_BROKER_PER_CLASS";

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/ce077c25/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java
----------------------------------------------------------------------
diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java
index 7692f3e..bcd0d21 100644
--- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java
+++ b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java
@@ -107,6 +107,18 @@ public class ExternalQpidBrokerAdminImpl implements BrokerAdmin
     }
 
     @Override
+    public boolean isSASLSupported()
+    {
+        return true;
+    }
+
+    @Override
+    public boolean isSASLMechanismSupported(final String mechanismName)
+    {
+        return true;
+    }
+
+    @Override
     public String getType()
     {
         return "EXTERNAL_BROKER";

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/ce077c25/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/security/sasl/SaslTest.java
----------------------------------------------------------------------
diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/security/sasl/SaslTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/security/sasl/SaslTest.java
index 150ccf9..6dadf7c 100644
--- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/security/sasl/SaslTest.java
+++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/security/sasl/SaslTest.java
@@ -26,6 +26,7 @@ import static org.hamcrest.Matchers.hasItem;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.notNullValue;
 import static org.hamcrest.Matchers.nullValue;
+import static org.junit.Assume.assumeThat;
 
 import java.net.InetSocketAddress;
 import java.nio.charset.StandardCharsets;
@@ -35,6 +36,7 @@ import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
 import javax.xml.bind.DatatypeConverter;
 
+import org.junit.Before;
 import org.junit.Test;
 
 import org.apache.qpid.server.protocol.v1_0.type.Binary;
@@ -60,6 +62,14 @@ public class SaslTest extends ProtocolTestBase
     private static final byte[] SASL_AMQP_HEADER_BYTES = "AMQP\3\1\0\0".getBytes(StandardCharsets.UTF_8);
     private static final byte[] AMQP_HEADER_BYTES = "AMQP\0\1\0\0".getBytes(StandardCharsets.UTF_8);
 
+    @Before
+    public void setUp()
+    {
+        assumeThat(getBrokerAdmin().isSASLSupported(), is(true));
+        assumeThat(getBrokerAdmin().isSASLMechanismSupported(PLAIN.toString()), is(true));
+        assumeThat(getBrokerAdmin().isSASLMechanismSupported(CRAM_MD5.toString()), is(true));
+    }
+
     @Test
     @SpecificationTest(section = "5.3.2",
             description = "SASL Negotiation [...] challenge/response step occurs zero times")


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...