From d15cb05bdbca4b5a904a644c81b524d426a21799 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Sun, 31 Mar 2013 21:45:08 +0000 Subject: QPID-4657, QPID-4683: review changes for new port configuration functionality - Fix ability to select SSL for a port - Add ability to set SSL Client Auth attributes for a port - Enforce that you have SSL keystores/trustures in place when creating new ports that will fail to work without them - Update names and placeholder text in UI to convey what happens when you dont fill out an optional attribute. - Remove the default AMQP port value in form, makes the user specify port and avoid near definite clash. - Removed requirement to specify Transport since it is actually optional. - Ensure the port state is set accurately for newly added ports - Fix the ability to override the management ports in ManagementMode - Allow editing the management ports in Management Mode without having to override them first. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1463060 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/systest/rest/Asserts.java | 6 +++++- .../src/main/java/org/apache/qpid/systest/rest/PortRestTest.java | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'java/systests') diff --git a/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java b/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java index 144e64f0bf..e20db6a6ac 100644 --- a/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java +++ b/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java @@ -181,12 +181,16 @@ public class Asserts public static void assertPortAttributes(Map port) { + assertPortAttributes(port, State.ACTIVE); + } + public static void assertPortAttributes(Map port, State state) + { assertNotNull("Unexpected value of attribute " + Port.ID, port.get(Port.ID)); assertEquals("Unexpected value of attribute " + Port.DURABLE, Boolean.FALSE, port.get(Port.DURABLE)); assertEquals("Unexpected value of attribute " + Port.LIFETIME_POLICY, LifetimePolicy.PERMANENT.name(), port.get(Broker.LIFETIME_POLICY)); - assertEquals("Unexpected value of attribute " + Port.STATE, State.ACTIVE.name(), port.get(Port.STATE)); + assertEquals("Unexpected value of attribute " + Port.STATE, state.name(), port.get(Port.STATE)); assertEquals("Unexpected value of attribute " + Port.TIME_TO_LIVE, 0, port.get(Port.TIME_TO_LIVE)); @SuppressWarnings("unchecked") diff --git a/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java b/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java index 9302ac88de..f8a7a9855f 100644 --- a/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java +++ b/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java @@ -30,6 +30,7 @@ import java.util.Map; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.Protocol; +import org.apache.qpid.server.model.State; import org.apache.qpid.server.plugin.AuthenticationManagerFactory; import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; import org.apache.qpid.test.utils.TestBrokerConfiguration; @@ -107,7 +108,7 @@ public class PortRestTest extends QpidRestTestCase assertNotNull("Port details cannot be null", portDetails); assertEquals("Unexpected number of ports with name " + portName, 1, portDetails.size()); Map port = portDetails.get(0); - Asserts.assertPortAttributes(port); + Asserts.assertPortAttributes(port, State.QUIESCED); // make sure that port is there after broker restart restartBroker(); @@ -115,6 +116,8 @@ public class PortRestTest extends QpidRestTestCase portDetails = getRestTestHelper().getJsonAsList("/rest/port/" + portName); assertNotNull("Port details cannot be null", portDetails); assertEquals("Unexpected number of ports with name " + portName, 1, portDetails.size()); + port = portDetails.get(0); + Asserts.assertPortAttributes(port, State.ACTIVE); // try to add a second RMI port attributes = new HashMap(); -- cgit v1.2.1