public static void testMultiCancel()
throws Exception
{
UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, "1239");
FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CANCEL, "5678");
try {
uba.begin();
bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1239");
bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");
} catch (Exception eouter) {
try {
uba.cancel();
} catch(Exception einner) {
}
throw eouter;
}
try {
uba.cancel();
} catch (SystemException ex) {
// failure will result in heuristic hazard warning message but wil not throw an exception
throw ex;
} catch (Exception eouter) {
try {
uba.cancel();
} catch(Exception einner) {
}
throw eouter;
}
assertTrue(p.passed());
}