Search in sources :

Example 1 with Sc007RetryPreparedAbortState

use of com.jboss.transaction.wstf.interop.states.Sc007RetryPreparedAbortState in project narayana by jbosstm.

the class Sc007TestCase method test3_8.

/**
 * test3_8 - 3.8 RetryPreparedAbort
 * Tests recovery from a communication failure during the prepare phase. Transaction times out.
 * @throws Exception on failure.
 */
public void test3_8() throws Exception {
    final String conversationId = getConversationId();
    final Sc007RetryPreparedAbortState state = new Sc007RetryPreparedAbortState();
    ProxyConversation.setConversationState(conversationId, state);
    try {
        final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
        final CoordinationContextType context = InteropUtil.createCoordinationContext(getSourceCoordinatorURI());
        getParticipantStub().retryPreparedAbort(serviceURI, context);
        final CompletionCoordinatorParticipant participant = InteropUtil.registerCompletion(context, context.getIdentifier().getValue());
        participant.commit();
        fail("Transaction rollback expected");
    } catch (final TransactionRolledBackException trbe) {
        state.waitForCompletion(getTestTimeout());
    } finally {
        ProxyConversation.clearConversationState(conversationId);
    }
    assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Also used : TransactionRolledBackException(com.arjuna.wst.TransactionRolledBackException) CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType) CompletionCoordinatorParticipant(com.arjuna.wst.CompletionCoordinatorParticipant) Sc007RetryPreparedAbortState(com.jboss.transaction.wstf.interop.states.Sc007RetryPreparedAbortState)

Aggregations

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