summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java')
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
index 52e021240e..d9d3c9fe8f 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
@@ -176,7 +176,17 @@ public class ManagementModeStoreHandlerTest extends QpidTestCase
assertEquals("Unexpected state", State.QUIESCED, portEntry.getAttributes().get(Port.STATE));
}
- public void testVirtualHostEntryIsQuiesced()
+ public void testVirtualHostEntryIsNotQuiescedByDefault()
+ {
+ virtualHostEntryQuiescedStatusTestImpl(false);
+ }
+
+ public void testVirtualHostEntryIsQuiescedWhenRequested()
+ {
+ virtualHostEntryQuiescedStatusTestImpl(true);
+ }
+
+ private void virtualHostEntryQuiescedStatusTestImpl(boolean mmQuiesceVhosts)
{
UUID virtualHostId = UUID.randomUUID();
ConfigurationEntry virtualHost = mock(ConfigurationEntry.class);
@@ -188,11 +198,17 @@ public class ManagementModeStoreHandlerTest extends QpidTestCase
when(_store.getEntry(virtualHostId)).thenReturn(virtualHost);
when(_root.getChildrenIds()).thenReturn(new HashSet<UUID>(Arrays.asList(_portEntryId, virtualHostId)));
+ State expectedState = mmQuiesceVhosts ? State.QUIESCED : null;
+ if(mmQuiesceVhosts)
+ {
+ _options.setManagementModeQuiesceVirtualHosts(mmQuiesceVhosts);
+ }
+
_handler = new ManagementModeStoreHandler(_store, _options);
ConfigurationEntry hostEntry = _handler.getEntry(virtualHostId);
Map<String, Object> hostAttributes = hostEntry.getAttributes();
- assertEquals("Unexpected state", State.QUIESCED, hostAttributes.get(VirtualHost.STATE));
+ assertEquals("Unexpected state", expectedState, hostAttributes.get(VirtualHost.STATE));
hostAttributes.remove(VirtualHost.STATE);
assertEquals("Unexpected attributes", attributes, hostAttributes);
}