use of com.jboss.transaction.wstf.interop.states.Sc007RetryPreparedCommitState in project narayana by jbosstm.
the class Sc007TestCase method test3_7.
/**
* test3_7 - 3.7 RetryPreparedCommit
* Tests recovery from a communication failure during the prepare phase. Transaction commits normally.
* @throws Exception on failure.
*/
public void test3_7() throws Exception {
final String conversationId = getConversationId();
final Sc007RetryPreparedCommitState state = new Sc007RetryPreparedCommitState();
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final CoordinationContextType context = InteropUtil.createCoordinationContext(getSourceCoordinatorURI());
getParticipantStub().retryPreparedCommit(serviceURI, context);
final CompletionCoordinatorParticipant participant = InteropUtil.registerCompletion(context, context.getIdentifier().getValue());
participant.commit();
state.waitForCompletion(0);
} finally {
ProxyConversation.clearConversationState(conversationId);
}
assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Aggregations