use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method testGetEntryByPortId.
public void testGetEntryByPortId() {
Collection<ConfiguredObjectRecord> records = openAndGetRecords();
ConfiguredObjectRecord portEntry = getEntry(records, _portEntryId);
assertEquals("Unexpected entry id", _portEntryId, portEntry.getId());
assertTrue("Unexpected children", getChildrenIds(records, portEntry).isEmpty());
assertEquals("Unexpected state", State.QUIESCED, portEntry.getAttributes().get(Port.STATE));
}
use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method testRemoveCLIPort.
public void testRemoveCLIPort() {
_systemConfigAttributes.put(SystemConfig.MANAGEMENT_MODE_HTTP_PORT_OVERRIDE, 1000);
_handler = createManagementModeStoreHandler();
_handler.init(_systemConfig);
Collection<ConfiguredObjectRecord> records = openAndGetRecords();
UUID portId = getOptionsPortId(records);
ConfiguredObjectRecord record = mock(ConfiguredObjectRecord.class);
when(record.getId()).thenReturn(portId);
try {
_handler.remove(record);
fail("Exception should be thrown on trying to remove CLI port");
} catch (IllegalConfigurationException e) {
// pass
}
}
use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method testGetRootEntryWithHttpPortOverriden.
public void testGetRootEntryWithHttpPortOverriden() {
_systemConfigAttributes.put(SystemConfig.MANAGEMENT_MODE_HTTP_PORT_OVERRIDE, 9090);
_handler = createManagementModeStoreHandler();
_handler.init(_systemConfig);
Collection<ConfiguredObjectRecord> records = openAndGetRecords();
ConfiguredObjectRecord root = getRootEntry(records);
assertEquals("Unexpected root id", _rootId, root.getId());
Collection<UUID> childrenIds = getChildrenIds(records, root);
assertEquals("Unexpected children size", 2, childrenIds.size());
assertTrue("Store port entry id is not found", childrenIds.contains(_portEntryId));
}
use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method testGetRootEntryWithManagementPortsOverriden.
public void testGetRootEntryWithManagementPortsOverriden() {
_systemConfigAttributes.put(SystemConfig.MANAGEMENT_MODE_HTTP_PORT_OVERRIDE, 1000);
_handler = createManagementModeStoreHandler();
_handler.init(_systemConfig);
Collection<ConfiguredObjectRecord> records = openAndGetRecords();
ConfiguredObjectRecord root = getRootEntry(records);
assertEquals("Unexpected root id", _rootId, root.getId());
Collection<UUID> childrenIds = getChildrenIds(records, root);
assertEquals("Unexpected children size", 2, childrenIds.size());
assertTrue("Store port entry id is not found", childrenIds.contains(_portEntryId));
}
use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method testGetRootEntryWithEmptyOptions.
public void testGetRootEntryWithEmptyOptions() {
Collection<ConfiguredObjectRecord> records = openAndGetRecords();
ConfiguredObjectRecord root = getRootEntry(records);
assertEquals("Unexpected root id", _rootId, root.getId());
assertEquals("Unexpected children", Collections.singleton(_portEntryId), getChildrenIds(records, root));
}
Aggregations