assertContentForQueue(queueName, expectedQueueSize, messageIdsForQueue);
}
private Set<Long> assertDeliveriesForQueue(final String queueName, final int expectedQueueSize)
{
final QueueEntryKeyBinding queueEntryKeyBinding = new QueueEntryKeyBinding();
final AtomicInteger deliveryCounter = new AtomicInteger();
final Set<Long> messagesForQueue = new HashSet<Long>();
CursorOperation deliveryDatabaseOperation = new CursorOperation()
{
@Override
public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
DatabaseEntry key, DatabaseEntry value)
{
QueueEntryKey entryKey = queueEntryKeyBinding.entryToObject(key);
String thisQueueName = entryKey.getQueueName().asString();
if (thisQueueName.equals(queueName))
{
deliveryCounter.incrementAndGet();
messagesForQueue.add(entryKey.getMessageId());