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);
}
}
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);
}
}
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;
}
}
Aggregations