Search in sources :

Example 1 with ATInteropRetryPreparedCommitState

use of com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedCommitState in project narayana by jbosstm.

the class ATTestCase method testAT5_2.

/**
 * testAT5_2 - 5.2 RetryPreparedCommit
 * Tests recovery from a communication failure during the prepare phase. Transaction commits normally.
 * @throws Exception on failure.
 */
public void testAT5_2() throws Exception {
    final String conversationId = getConversationId();
    final ATInteropRetryPreparedCommitState state = new ATInteropRetryPreparedCommitState();
    ProxyConversation.setConversationState(conversationId, state);
    try {
        final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
        final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI());
        getParticipantStub().retryPreparedCommit(serviceURI, context);
        final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue());
        participant.commit();
        state.waitForCompletion(0);
    } finally {
        ProxyConversation.clearConversationState(conversationId);
    }
    assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Also used : ATInteropRetryPreparedCommitState(com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedCommitState) CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType) CompletionCoordinatorParticipant(com.arjuna.wst.CompletionCoordinatorParticipant)

Aggregations

CompletionCoordinatorParticipant (com.arjuna.wst.CompletionCoordinatorParticipant)1 ATInteropRetryPreparedCommitState (com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedCommitState)1 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)1