assertNull("Second virtual host configuration should be removed", _store.getEntry(virtualHost2Id));
}
public void testSaveBroker()
{
ConfigurationEntry brokerConfigEntry = _store.getRootEntry();
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 19);
attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);
attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 16);
attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 15);
attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 15);
attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 13);
attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 12);
attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, false);
attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 11);
attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 11000);
attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 12000);
attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 14000);
attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, false);
ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(_brokerId, Broker.class.getSimpleName(), attributes,
brokerConfigEntry.getChildrenIds(), _store);
_store.save(updatedBrokerEntry);
ConfigurationEntry newBrokerConfigEntry = _store.getRootEntry();
assertNotNull("Root entry does not exist", newBrokerConfigEntry);
assertEquals("Unexpected id", _brokerId, newBrokerConfigEntry.getId());
assertEquals("Unexpected type ", Broker.class.getSimpleName(), newBrokerConfigEntry.getType());
Map<String, Object> newBrokerattributes = newBrokerConfigEntry.getAttributes();
assertNotNull("Attributes cannot be null", newBrokerattributes);
assertEquals("Unexpected attributes", attributes, newBrokerattributes);
}