diff options
Diffstat (limited to 'qpid/java/systests/src')
4 files changed, 49 insertions, 8 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java index 0f558f3abe..0345485167 100755 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java @@ -142,6 +142,8 @@ public class QpidBrokerTestCase extends QpidTestCase public static final int DEFAULT_HTTP_MANAGEMENT_PORT_VALUE = 8080; public static final int DEFAULT_HTTPS_MANAGEMENT_PORT_VALUE = 8443; + public static final String TEST_AMQP_PORT_PROTOCOLS_PROPERTY="test.amqp_port_protocols"; + // values protected static final String JAVA = "java"; protected static final String CPP = "cpp"; @@ -559,6 +561,8 @@ public class QpidBrokerTestCase extends QpidTestCase setSystemProperty("test.port.ssl"); setSystemProperty("test.port.alt"); setSystemProperty("test.port.alt.ssl"); + setSystemProperty("test.amqp_port_protocols"); + setSystemProperty("virtualhostnode.type"); setSystemProperty("virtualhostnode.context.blueprint"); diff --git a/qpid/java/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java b/qpid/java/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java index 42f3854d32..b94827f249 100644 --- a/qpid/java/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java +++ b/qpid/java/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java @@ -20,6 +20,15 @@ */ package org.apache.qpid.server; +import java.io.IOException; +import java.io.StringWriter; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.codehaus.jackson.map.ObjectMapper; + import org.apache.qpid.client.AMQConnection; import org.apache.qpid.configuration.ClientProperties; import org.apache.qpid.framing.ProtocolVersion; @@ -43,11 +52,41 @@ public class SupportedProtocolVersionsTest extends QpidBrokerTestCase // No-op, we call super.setUp() from test methods after appropriate config overrides } - private void clearProtocolSupportManipulations() + private void clearProtocolSupportManipulations() throws Exception { //Remove the QBTC provided protocol manipulations, giving only the protocols which default to enabled setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_EXCLUDES, null); setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_INCLUDES, null); + setSystemProperty(QpidBrokerTestCase.TEST_AMQP_PORT_PROTOCOLS_PROPERTY, getProtocolsAsString(getAllAmqpProtocols())); + } + + private Collection<Protocol> getAllAmqpProtocols() throws Exception + { + Collection<Protocol> protocols = new HashSet<>(); + for(Protocol p : Protocol.values()) + { + if(p.getProtocolType() == Protocol.ProtocolType.AMQP) + { + protocols.add(p); + } + } + + return protocols; + } + + private String getProtocolsWithExclusions(Protocol... excludes) throws Exception + { + Set<Protocol> protocols = new HashSet<>(getAllAmqpProtocols()); + protocols.removeAll(Arrays.asList(excludes)); + return getProtocolsAsString(protocols); + } + + private String getProtocolsAsString(final Collection<Protocol> protocols) throws IOException + { + ObjectMapper mapper = new ObjectMapper(); + StringWriter stringWriter = new StringWriter(); + mapper.writeValue(stringWriter, protocols); + return stringWriter.toString(); } /** @@ -89,11 +128,7 @@ public class SupportedProtocolVersionsTest extends QpidBrokerTestCase public void testDisabling010and10() throws Exception { - clearProtocolSupportManipulations(); - - //disable 0-10 and 1-0 support - setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_EXCLUDES, - Protocol.AMQP_1_0 + "," + Protocol.AMQP_0_10); + setSystemProperty(QpidBrokerTestCase.TEST_AMQP_PORT_PROTOCOLS_PROPERTY, getProtocolsWithExclusions(Protocol.AMQP_1_0, Protocol.AMQP_0_10)); super.setUp(); @@ -110,8 +145,8 @@ public class SupportedProtocolVersionsTest extends QpidBrokerTestCase clearProtocolSupportManipulations(); //disable 0-10 support, and set the default unsupported protocol initiation reply to 0-9 - setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_EXCLUDES, - Protocol.AMQP_1_0 + "," + Protocol.AMQP_0_10); + setSystemProperty(QpidBrokerTestCase.TEST_AMQP_PORT_PROTOCOLS_PROPERTY, getProtocolsWithExclusions(Protocol.AMQP_1_0, Protocol.AMQP_0_10)); + setSystemProperty(BrokerProperties.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, "v0_9"); super.setUp(); diff --git a/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java b/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java index 319cc1c9da..c81bbd5469 100644 --- a/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java +++ b/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java @@ -65,6 +65,7 @@ public class BrokerRestHttpsTest extends QpidRestTestCase Asserts.assertAttributesPresent(brokerDetails, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Broker.class), Broker.PROCESS_PID, + Broker.CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER, ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, diff --git a/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestTest.java b/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestTest.java index bae27b802c..ba95eecc6d 100644 --- a/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestTest.java +++ b/qpid/java/systests/src/test/java/org/apache/qpid/systest/rest/BrokerRestTest.java @@ -204,6 +204,7 @@ public class BrokerRestTest extends QpidRestTestCase Asserts.assertAttributesPresent(brokerDetails, BrokerModel.getInstance().getTypeRegistry().getAttributeNames( Broker.class), Broker.PROCESS_PID, + Broker.CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER, ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, |