use of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.NewPreparedTransaction in project qpid-broker-j by apache.
the class UpgradeFrom5To6Test method assertXidEntries.
private void assertXidEntries(Environment environment) {
final DatabaseEntry value = new DatabaseEntry();
final DatabaseEntry key = getXidKey();
new DatabaseTemplate(environment, NEW_XID_DB_NAME, null).run(new DatabaseRunnable() {
@Override
public void run(Database xidDatabase, Database nullDatabase, Transaction transaction) {
xidDatabase.get(null, key, value, LockMode.DEFAULT);
}
});
NewPreparedTransactionBinding newBinding = new NewPreparedTransactionBinding();
NewPreparedTransaction newTransaction = newBinding.entryToObject(value);
NewRecordImpl[] newEnqueues = newTransaction.getEnqueues();
NewRecordImpl[] newDequeues = newTransaction.getDequeues();
assertEquals("Unxpected new enqueus number", 1, newEnqueues.length);
NewRecordImpl enqueue = newEnqueues[0];
assertEquals("Unxpected queue id", UUIDGenerator.generateQueueUUID("TEST1", getVirtualHost().getName()), enqueue.getId());
assertEquals("Unxpected message id", 1, enqueue.getMessageNumber());
assertEquals("Unxpected new dequeues number", 1, newDequeues.length);
NewRecordImpl dequeue = newDequeues[0];
assertEquals("Unxpected queue id", UUIDGenerator.generateQueueUUID("TEST2", getVirtualHost().getName()), dequeue.getId());
assertEquals("Unxpected message id", 2, dequeue.getMessageNumber());
}
Aggregations