diff options
| author | Alex Rudyy <orudyy@apache.org> | 2013-03-21 13:43:40 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2013-03-21 13:43:40 +0000 |
| commit | a7f267df53b4b9bad41dc4a1a75be00bbc79fc52 (patch) | |
| tree | 090b8fa2a47b800509ae47a6f0c9637103ba90d1 /qpid/java/broker/src/test | |
| parent | e60947dfba845a5b3067f58de7a341ab8ac15b35 (diff) | |
| download | qpid-python-a7f267df53b4b9bad41dc4a1a75be00bbc79fc52.tar.gz | |
QPID-4390: Add ability to save java broker store version with existing broker configuration stores. Add broker attributes for the store version, store type, store location and version of management interfaces.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1459307 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/test')
3 files changed, 28 insertions, 3 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java index b357c0b8e9..9d7f6a9cc1 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java @@ -110,7 +110,10 @@ public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase assertEquals("Unexpected type ", Broker.class.getSimpleName(), brokerConfigEntry.getType()); Map<String, Object> attributes = brokerConfigEntry.getAttributes(); assertNotNull("Attributes cannot be null", attributes); - assertEquals("Unexpected attributes", _brokerAttributes, attributes); + for (Map.Entry<String, Object> attribute : _brokerAttributes.entrySet()) + { + assertEquals("Unexpected attribute " + attribute.getKey(), attribute.getValue(), attributes.get(attribute.getKey())); + } } public void testGetEntry() diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java index 92e304ab86..1cb760f611 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java @@ -52,6 +52,7 @@ public class JsonConfigurationEntryStoreTest extends ConfigurationEntryStoreTest Map<String, Object> brokerObjectMap = new HashMap<String, Object>(); brokerObjectMap.put(Broker.ID, brokerId); brokerObjectMap.put("@type", Broker.class.getSimpleName()); + brokerObjectMap.put("storeVersion", 1); brokerObjectMap.putAll(brokerAttributes); StringWriter sw = new StringWriter(); @@ -114,8 +115,9 @@ public class JsonConfigurationEntryStoreTest extends ConfigurationEntryStoreTest assertEquals("Unexpected root entry", brokerId, root.getId()); Map<String, Object> attributes = root.getAttributes(); assertNotNull("Attributes not found", attributes); - assertEquals("Unexpected number of attriburtes", 1, attributes.size()); + assertEquals("Unexpected number of attriburtes", 2, attributes.size()); assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME)); + assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION)); } public void testCreateFromInitialStore() throws Exception @@ -135,8 +137,18 @@ public class JsonConfigurationEntryStoreTest extends ConfigurationEntryStoreTest assertEquals("Unexpected root entry", brokerId, root.getId()); Map<String, Object> attributes = root.getAttributes(); assertNotNull("Attributes not found", attributes); - assertEquals("Unexpected number of attriburtes", 1, attributes.size()); + assertEquals("Unexpected number of attriburtes", 2, attributes.size()); assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME)); + assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION)); } + public void testGetVersion() + { + assertEquals("Unexpected version", 1, getStore().getVersion()); + } + + public void testGetType() + { + assertEquals("Unexpected type", "json", getStore().getType()); + } } diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java index 65ced69915..314e673c08 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java @@ -94,4 +94,14 @@ public class MemoryConfigurationEntryStoreTest extends ConfigurationEntryStoreTe assertEquals("Unexpected broker attributes", initialStoreRoot.getAttributes(), root.getAttributes()); assertEquals("Unexpected broker children", initialStoreRoot.getChildrenIds(), root.getChildrenIds()); } + + public void testGetVersion() + { + assertEquals("Unexpected version", 1, getStore().getVersion()); + } + + public void testGetType() + { + assertEquals("Unexpected type", "memory", getStore().getType()); + } } |
