Search in sources :

Example 1 with TestVirtualHostNode

use of org.apache.qpid.server.virtualhostnode.TestVirtualHostNode in project qpid-broker-j by apache.

the class BrokerImplTest method createVhnWithVh.

private void createVhnWithVh(final BrokerImpl brokerImpl, int nameSuffix, final long totalQueueSize) {
    final Map<String, Object> vhnAttributes = new HashMap<>();
    vhnAttributes.put(VirtualHostNode.TYPE, TestVirtualHostNode.VIRTUAL_HOST_NODE_TYPE);
    vhnAttributes.put(VirtualHostNode.NAME, "testVhn" + nameSuffix);
    final DurableConfigurationStore store = mock(DurableConfigurationStore.class);
    TestVirtualHostNode vhn = new TestVirtualHostNode(brokerImpl, vhnAttributes, store);
    vhn.create();
    final Map<String, Object> vhAttributes = new HashMap<>();
    vhAttributes.put(VirtualHost.TYPE, TestMemoryVirtualHost.VIRTUAL_HOST_TYPE);
    vhAttributes.put(VirtualHost.NAME, "testVh" + nameSuffix);
    TestMemoryVirtualHost vh = new TestMemoryVirtualHost(vhAttributes, vhn) {

        @Override
        public long getTotalDepthOfQueuesBytes() {
            return totalQueueSize;
        }
    };
    vh.create();
}
Also used : TestMemoryVirtualHost(org.apache.qpid.server.virtualhost.TestMemoryVirtualHost) DurableConfigurationStore(org.apache.qpid.server.store.DurableConfigurationStore) HashMap(java.util.HashMap) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) TestVirtualHostNode(org.apache.qpid.server.virtualhostnode.TestVirtualHostNode)

Aggregations

HashMap (java.util.HashMap)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)1 TestMemoryVirtualHost (org.apache.qpid.server.virtualhost.TestMemoryVirtualHost)1 TestVirtualHostNode (org.apache.qpid.server.virtualhostnode.TestVirtualHostNode)1