Search in sources :

Example 11 with ConfiguredObjectRecordHandler

use of org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler in project qpid-broker-j by apache.

the class AbstractDurableConfigurationStoreTestCase method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    _queueId = UUIDGenerator.generateRandomUUID();
    _exchangeId = UUIDGenerator.generateRandomUUID();
    _factory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
    _storeName = getName();
    _storePath = TMP_FOLDER + File.separator + _storeName;
    FileUtils.delete(new File(_storePath), true);
    _handler = mock(ConfiguredObjectRecordHandler.class);
    _bindingArgs = new HashMap<>();
    String argKey = AMQPFilterTypes.JMS_SELECTOR.toString();
    String argValue = "some selector expression";
    _bindingArgs.put(argKey, argValue);
    _parent = createVirtualHostNode(_storePath, _factory);
    _configStore = createConfigStore();
    _configStore.init(_parent);
    _configStore.openConfigurationStore(new ConfiguredObjectRecordHandler() {

        @Override
        public void handle(final ConfiguredObjectRecord record) {
        }
    });
    _rootRecord = new ConfiguredObjectRecordImpl(UUID.randomUUID(), VirtualHost.class.getSimpleName(), Collections.<String, Object>singletonMap(ConfiguredObject.NAME, "vhost"));
    _configStore.create(_rootRecord);
}
Also used : ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) File(java.io.File) ConfiguredObjectFactoryImpl(org.apache.qpid.server.model.ConfiguredObjectFactoryImpl) ConfiguredObjectRecordHandler(org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler)

Aggregations

ConfiguredObjectRecordHandler (org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler)11 ConfiguredObjectRecord (org.apache.qpid.server.store.ConfiguredObjectRecord)8 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)5 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)4 Mockito.doAnswer (org.mockito.Mockito.doAnswer)4 InvocationOnMock (org.mockito.invocation.InvocationOnMock)4 Answer (org.mockito.stubbing.Answer)4 UUID (java.util.UUID)2 IllegalConfigurationException (org.apache.qpid.server.configuration.IllegalConfigurationException)2 VirtualHost (org.apache.qpid.server.model.VirtualHost)2 ConfiguredObjectRecordImpl (org.apache.qpid.server.store.ConfiguredObjectRecordImpl)2 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)2 Matchers.anyString (org.mockito.Matchers.anyString)2 BufferedInputStream (java.io.BufferedInputStream)1 DataInputStream (java.io.DataInputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1