public void testCancel() throws Exception {
System.out
.println("\n\nStarting 'testCancel'. This test invokes a WS twice within a BA. The BA is later cancelled, which causes these WS calls to be compensated.");
System.out.println("[CLIENT] Creating a new Business Activity");
UserBusinessActivity uba = UserBusinessActivityFactory.userBusinessActivity();
try {
String value1 = "1";
String value2 = "2";
System.out
.println("[CLIENT] Beginning Business Activity (All calls to Web services that support WS-BA will be included in this activity)");
uba.begin();
System.out.println("[CLIENT] invoking addValueToSet(1) on WS");
client.addValueToSet(value1);
System.out.println("[CLIENT] invoking addValueToSet(2) on WS");
client.addValueToSet(value2);
Assert.assertTrue("Expected value to be in the set, but it wasn't", client.isInSet(value1));
Assert.assertTrue("Expected value to be in the set, but it wasn't", client.isInSet(value2));
System.out.println("[CLIENT] Cancelling Business Activity (This will cause the work to be compensated)");
uba.cancel();
Assert.assertTrue("Expected value to not be in the set, but it was", !client.isInSet(value1));
Assert.assertTrue("Expected value to not be in the set, but it was", !client.isInSet(value2));
} finally {