Search in sources :

Example 16 with QueueManagingVirtualHost

use of org.apache.qpid.server.virtualhost.QueueManagingVirtualHost in project qpid-broker-j by apache.

the class SortedQueueEntryListTest method setUp.

@Override
protected void setUp() throws Exception {
    Map<String, Object> attributes = new HashMap<String, Object>();
    attributes.put(Queue.ID, UUID.randomUUID());
    attributes.put(Queue.NAME, getName());
    attributes.put(Queue.DURABLE, false);
    attributes.put(Queue.LIFETIME_POLICY, LifetimePolicy.PERMANENT);
    attributes.put(SortedQueue.SORT_KEY, "KEY");
    // Create test list
    final QueueManagingVirtualHost virtualHost = BrokerTestHelper.createVirtualHost("testVH");
    _testQueue = new SortedQueueImpl(attributes, virtualHost) {

        SelfValidatingSortedQueueEntryList _entries;

        @Override
        protected void onOpen() {
            super.onOpen();
            _entries = new SelfValidatingSortedQueueEntryList(this);
        }

        @Override
        SelfValidatingSortedQueueEntryList getEntries() {
            return _entries;
        }
    };
    _testQueue.open();
    _sqel = (SelfValidatingSortedQueueEntryList) _testQueue.getEntries();
    super.setUp();
    // Create result array
    Arrays.sort(keysSorted);
    // Build test list
    long messageId = 0L;
    for (final String key : keys) {
        final ServerMessage msg = generateTestMessage(messageId++, key);
        _sqel.add(msg, null);
    }
}
Also used : QueueManagingVirtualHost(org.apache.qpid.server.virtualhost.QueueManagingVirtualHost) HashMap(java.util.HashMap) ServerMessage(org.apache.qpid.server.message.ServerMessage)

Example 17 with QueueManagingVirtualHost

use of org.apache.qpid.server.virtualhost.QueueManagingVirtualHost in project qpid-broker-j by apache.

the class StandardQueueEntryListTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Map<String, Object> queueAttributes = new HashMap<String, Object>();
    queueAttributes.put(Queue.ID, UUID.randomUUID());
    queueAttributes.put(Queue.NAME, getName());
    final QueueManagingVirtualHost virtualHost = BrokerTestHelper.createVirtualHost("testVH");
    _testQueue = new StandardQueueImpl(queueAttributes, virtualHost);
    _testQueue.open();
    _sqel = _testQueue.getEntries();
    for (int i = 1; i <= 100; i++) {
        final QueueEntry bleh = _sqel.add(createServerMessage(i), null);
        assertNotNull("QE should not have been null", bleh);
    }
}
Also used : QueueManagingVirtualHost(org.apache.qpid.server.virtualhost.QueueManagingVirtualHost) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Example 18 with QueueManagingVirtualHost

use of org.apache.qpid.server.virtualhost.QueueManagingVirtualHost in project qpid-broker-j by apache.

the class StandardQueueEntryListTest method getTestList.

@Override
public StandardQueueEntryList getTestList(boolean newList) throws Exception {
    if (newList) {
        Map<String, Object> queueAttributes = new HashMap<String, Object>();
        queueAttributes.put(Queue.ID, UUID.randomUUID());
        queueAttributes.put(Queue.NAME, getName());
        final QueueManagingVirtualHost virtualHost = BrokerTestHelper.createVirtualHost("testVH");
        StandardQueueImpl queue = new StandardQueueImpl(queueAttributes, virtualHost);
        queue.open();
        return queue.getEntries();
    } else {
        return _sqel;
    }
}
Also used : QueueManagingVirtualHost(org.apache.qpid.server.virtualhost.QueueManagingVirtualHost) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Aggregations

QueueManagingVirtualHost (org.apache.qpid.server.virtualhost.QueueManagingVirtualHost)18 HashMap (java.util.HashMap)12 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)4 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 TaskExecutor (org.apache.qpid.server.configuration.updater.TaskExecutor)3 AccessControlException (java.security.AccessControlException)2 Principal (java.security.Principal)2 Collection (java.util.Collection)2 Map (java.util.Map)2 CurrentThreadTaskExecutor (org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)2 TokenMgrError (org.apache.qpid.server.filter.selector.TokenMgrError)2 EventLogger (org.apache.qpid.server.logging.EventLogger)2 Queue (org.apache.qpid.server.model.Queue)2 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)2 Futures (com.google.common.util.concurrent.Futures)1 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 SettableFuture (com.google.common.util.concurrent.SettableFuture)1 DatabaseException (com.sleepycat.je.DatabaseException)1 LogWriteException (com.sleepycat.je.LogWriteException)1 InetSocketAddress (java.net.InetSocketAddress)1