use of org.neo4j.kernel.impl.transaction.TransactionRepresentation in project neo4j by neo4j.
the class PhysicalLogicalTransactionStoreTest method verifyTransaction.
private void verifyTransaction(TransactionIdStore transactionIdStore, TransactionMetadataCache positionCache, byte[] additionalHeader, int masterId, int authorId, long timeStarted, long latestCommittedTxWhenStarted, long timeCommitted, LogicalTransactionStore store) throws IOException {
TransactionMetadata expectedMetadata;
try (TransactionCursor cursor = store.getTransactions(TransactionIdStore.BASE_TX_ID + 1)) {
boolean hasNext = cursor.next();
assertTrue(hasNext);
CommittedTransactionRepresentation tx = cursor.get();
TransactionRepresentation transaction = tx.getTransactionRepresentation();
assertArrayEquals(additionalHeader, transaction.additionalHeader());
assertEquals(masterId, transaction.getMasterId());
assertEquals(authorId, transaction.getAuthorId());
assertEquals(timeStarted, transaction.getTimeStarted());
assertEquals(timeCommitted, transaction.getTimeCommitted());
assertEquals(latestCommittedTxWhenStarted, transaction.getLatestCommittedTxWhenStarted());
expectedMetadata = new TransactionMetadata(masterId, authorId, tx.getStartEntry().getStartPosition(), tx.getStartEntry().checksum(), timeCommitted);
}
positionCache.clear();
TransactionMetadata actualMetadata = store.getMetadataFor(transactionIdStore.getLastCommittedTransactionId());
assertEquals(expectedMetadata, actualMetadata);
}
Aggregations