diff options
| author | Alex Rudyy <orudyy@apache.org> | 2013-03-29 13:26:05 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2013-03-29 13:26:05 +0000 |
| commit | 0c2bbd4aafa9d6fe7954a6ecdc6451c10f8d578b (patch) | |
| tree | 8a7b04c10ef27194b5ff69a2fcda9b860f7514c2 /java/systests | |
| parent | eea584fe06ff17b0184d07cbbf95711a279dbe43 (diff) | |
| download | qpid-python-0c2bbd4aafa9d6fe7954a6ecdc6451c10f8d578b.tar.gz | |
QPID-4661: Fix broker attribute conversion bug
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1462470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java b/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java index fe4115b4c0..20905175ee 100644 --- a/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java +++ b/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java @@ -34,7 +34,6 @@ import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.State; import org.apache.qpid.server.model.VirtualHost; -import org.apache.qpid.server.model.adapter.BrokerAdapter; import org.apache.qpid.test.utils.QpidTestCase; import org.apache.qpid.test.utils.TestBrokerConfiguration; import org.apache.qpid.test.utils.TestSSLConstants; @@ -103,6 +102,28 @@ public class BrokerRestTest extends QpidRestTestCase assertBrokerAttributes(brokerAttributes, brokerDetails); } + public void testPutUpdateWhereNumericAttributesAreSetAsStringValues() throws Exception + { + Map<String, Object> validAttributes = getValidBrokerAttributes(); + Map<String, Object> attributes = new HashMap<String, Object>(); + + for (Map.Entry<String, Object> entry : validAttributes.entrySet()) + { + Object value = entry.getValue(); + if (value instanceof Number) + { + value = String.valueOf(value); + } + attributes.put(entry.getKey(), value); + } + + int response = getRestTestHelper().submitRequest("/rest/broker", "PUT", attributes); + assertEquals("Unexpected update response", 200, response); + + Map<String, Object> brokerDetails = getRestTestHelper().getJsonAsSingletonList("/rest/broker"); + assertBrokerAttributes(validAttributes, brokerDetails); + } + public void testPutToUpdateWithInvalidAttributeValues() throws Exception { Map<String, Object> invalidAttributes = new HashMap<String, Object>(); |
