summaryrefslogtreecommitdiff
path: root/java/systests
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-05-17 15:26:04 +0000
committerAlex Rudyy <orudyy@apache.org>2013-05-17 15:26:04 +0000
commit9a6441eb8b76af354562fa1b9a260bc79011a182 (patch)
tree7dceade5ca42bad95bbad6497fb2f2d96af08bd2 /java/systests
parent45684377c17bb7bbd155aabbf8493cbd9c5b6ae1 (diff)
downloadqpid-python-9a6441eb8b76af354562fa1b9a260bc79011a182.tar.gz
QPID-4863: Validate plugin attribute changes and throw UnsupportedOperationException where attribute changes are not supported
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1483861 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/systest/rest/HttpManagementRestTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/systest/rest/HttpManagementRestTest.java b/java/systests/src/main/java/org/apache/qpid/systest/rest/HttpManagementRestTest.java
index 3a0b834cc2..ab38d77b6c 100644
--- a/java/systests/src/main/java/org/apache/qpid/systest/rest/HttpManagementRestTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/systest/rest/HttpManagementRestTest.java
@@ -66,4 +66,26 @@ public class HttpManagementRestTest extends QpidRestTestCase
assertEquals("Unexpected http sasl auth enabled", false, details.get(HttpManagement.HTTP_SASL_AUTHENTICATION_ENABLED));
assertEquals("Unexpected https sasl auth enabled", false, details.get(HttpManagement.HTTPS_SASL_AUTHENTICATION_ENABLED));
}
+
+ public void testUpdateAttributesWithInvalidValues() throws Exception
+ {
+ Map<String, Object> invalidAttributes = new HashMap<String, Object>();
+ invalidAttributes.put(HttpManagement.HTTPS_BASIC_AUTHENTICATION_ENABLED, 1);
+ invalidAttributes.put(HttpManagement.HTTPS_SASL_AUTHENTICATION_ENABLED, 2);
+ invalidAttributes.put(HttpManagement.HTTP_SASL_AUTHENTICATION_ENABLED, 3);
+ invalidAttributes.put(HttpManagement.TIME_OUT, "undefined");
+
+ for (Map.Entry<String, Object> invalidAttribute : invalidAttributes.entrySet())
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(invalidAttribute.getKey(), invalidAttribute.getValue());
+ int response = getRestTestHelper().submitRequest("/rest/plugin/" + TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, "PUT", attributes);
+ assertEquals("Update should fail for attribute " + invalidAttribute.getKey() + " with value " + invalidAttribute.getValue() , 409, response);
+ }
+
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(HttpManagement.TIME_OUT, -1l);
+ int response = getRestTestHelper().submitRequest("/rest/plugin/" + TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, "PUT", attributes);
+ assertEquals("Update should fail for invalid session timeout", 409, response);
+ }
}