private final List<Long> _unacked;
private StoreContext _storeContext = new StoreContext();
Scenario(int messageCount, List<Long> acked, List<Long> unacked) throws Exception
{
TransactionalContext txnContext = new NonTransactionalContext(new TestMemoryMessageStore(),
_storeContext, null,
new LinkedList<RequiredDeliveryException>()
);
AMQQueue queue =
AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false, new VirtualHost("test", new MemoryMessageStore()),
null);
for (int i = 0; i < messageCount; i++)
{
long deliveryTag = i + 1;
MessagePublishInfo info = new MessagePublishInfo()
{
public AMQShortString getExchange()
{
return null;
}
public void setExchange(AMQShortString exchange)
{
//To change body of implemented methods use File | Settings | File Templates.
}
public boolean isImmediate()
{
return false;
}
public boolean isMandatory()
{
return false;
}
public AMQShortString getRoutingKey()
{
return null;
}
};
TestMessage message = new TestMessage(deliveryTag, i, info, txnContext.getStoreContext());
_map.add(deliveryTag, queue.enqueue(new StoreContext(), message));
}
_acked = acked;
_unacked = unacked;
}