@Test
public void testAbortAborting() {
final Exception abortCause = new Exception("Why we aborted");
DummyTransactionParticipant[] participants = {
new DummyNonDurableTransactionParticipant() {
public void abort(Transaction txn) {
assertAborted(abortCause);
super.abort(txn);
}
},
new DummyNonDurableTransactionParticipant() {
protected boolean prepareResult() { return true; }
public void abort(Transaction txn) {
assertAborted(abortCause);
super.abort(txn);
}
},
new DummyNonDurableTransactionParticipant() {
public void abort(Transaction txn) {
assertAborted(abortCause);
try {
txn.abort(abortXcp);
} catch (RuntimeException e) {
fail("Unexpected exception: " + e);
}
assertAborted(abortCause);
}
},
new DummyNonDurableTransactionParticipant() {
protected boolean prepareResult() { return true; }
public void abort(Transaction txn) {
assertAborted(abortCause);
super.abort(txn);
}