@Test
public void testCommitPreparing() throws Exception {
final Exception[] abortCause = { null };
DummyTransactionParticipant[] participants = {
new DummyNonDurableTransactionParticipant() {
protected boolean prepareResult() { return true; }
},
new DummyNonDurableTransactionParticipant() {
public boolean prepare(Transaction txn) {
try {
handle.commit();
fail("Expected IllegalStateException");
} catch (IllegalStateException e) {
System.err.println(e);
abortCause[0] = e;
throw e;
} catch (Exception e) {
fail("Unexpected exception: " + e);
}
throw new AssertionError();
}
},
new DummyNonDurableTransactionParticipant() {
protected boolean prepareResult() { return true; }
},
new DummyTransactionParticipant()
};
for (TransactionParticipant participant : participants) {