}
@Test
public void testAbortCommitting() throws Exception {
DummyTransactionParticipant[] participants = {
new DummyNonDurableTransactionParticipant(),
new DummyNonDurableTransactionParticipant() {
protected boolean prepareResult() { return true; }
},
new DummyNonDurableTransactionParticipant() {
public void commit(Transaction txn) {
assertNotAborted();
try {
txn.abort(abortXcp);
fail("Expected IllegalStateException");
} catch (IllegalStateException e) {
System.err.println(e);
throw e;
} catch (RuntimeException e) {
fail("Unexpected exception: " + e);
}
}
},
new DummyNonDurableTransactionParticipant() {
protected boolean prepareResult() { return true; }
}
};
for (TransactionParticipant participant : participants) {
txn.join(participant);