use of com.hp.mwtests.ts.jta.jts.common.ExtendedCrashRecord in project narayana by jbosstm.
the class JTSObjStoreBrowserTest method startTest.
// create 2 participants, start the action and enlist both participants
private ExtendedCrashRecord[] startTest(TwoPhaseCoordinator A) throws Exception {
ThreadActionData.purgeActions();
ExtendedCrashRecord[] recs = { new ExtendedCrashRecord(ExtendedCrashRecord.CrashLocation.NoCrash, ExtendedCrashRecord.CrashType.Normal), new ExtendedCrashRecord(ExtendedCrashRecord.CrashLocation.CrashInCommit, ExtendedCrashRecord.CrashType.HeuristicHazard) };
RecordTypeManager.manager().add(new RecordTypeMap() {
public Class<? extends AbstractRecord> getRecordClass() {
return ExtendedCrashRecord.class;
}
public int getType() {
return RecordType.USER_DEF_FIRST0;
}
});
A.start();
for (ExtendedCrashRecord rec : recs) A.add(rec);
return recs;
}
use of com.hp.mwtests.ts.jta.jts.common.ExtendedCrashRecord in project narayana by jbosstm.
the class JTSObjStoreBrowserTest method jtsRemoveTest.
/**
* Similar to aaRemoveTest but uses a JTS transaction instead of an AtomicAction
* @throws Exception if test fails unexpectedly
*/
@Test
public void jtsRemoveTest() throws Exception {
ArjunaTransactionImple A = new ArjunaTransactionImple(null);
ExtendedCrashRecord[] recs = startTest(A);
int outcome = ActionStatus.COMMITTED;
try {
A.commit(true);
} catch (HeuristicHazard e) {
outcome = ActionStatus.H_HAZARD;
}
assertEquals(ActionStatus.H_HAZARD, outcome);
finishTest(A, false, recs);
}
Aggregations