use of com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionScanner in project narayana by jbosstm.
the class LogMoveTest method test.
@Test
public void test() {
RecoveryStore recoveryStore = StoreManager.getRecoveryStore();
OutputObjectState fluff = new OutputObjectState();
Uid kungfuTx = new Uid();
boolean passed = false;
final String tn = new AtomicAction().type();
try {
UidHelper.packInto(kungfuTx, fluff);
System.err.println("Creating dummy log");
recoveryStore.write_committed(kungfuTx, tn, fluff);
if (recoveryStore.currentState(kungfuTx, tn) == StateStatus.OS_COMMITTED) {
System.err.println("Wrote dummy transaction " + kungfuTx);
// quicker to deal with scanner directly
ExpiredTransactionScanner scanner = new ExpiredTransactionScanner(tn, "/StateManager/ExpiredEntries");
scanner.scan();
scanner.scan();
if (recoveryStore.currentState(kungfuTx, tn) == StateStatus.OS_COMMITTED)
System.err.println("Transaction log not moved!");
else {
System.err.println("Transaction log moved!");
passed = true;
}
} else
System.err.println("State is not committed!");
} catch (final Exception ex) {
ex.printStackTrace();
}
assertTrue(passed);
}
Aggregations