use of com.jboss.transaction.txinterop.interop.states.BAInteropDroppedParticipantCompletedState in project narayana by jbosstm.
the class BATestCase method testBA1_10.
/**
* testBA1_10 - 1.10 ParticipantCancelCompletedRace
* Simulate a race between cancel and completed.
* @throws Exception on failure.
*/
public void testBA1_10() throws Exception {
final String conversationId = getConversationId();
final BAInteropDroppedParticipantCompletedState state = new BAInteropDroppedParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED);
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI());
getParticipantStub().participantCancelCompletedRace(serviceURI, context);
assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout()));
final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue());
terminator.cancel();
state.waitForCompletion(getTestTimeout());
} finally {
ProxyConversation.clearConversationState(conversationId);
}
assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Aggregations