use of com.jboss.transaction.wstf.interop.states.InteropWaitState in project narayana by jbosstm.
the class Sc007TestCase method test1_1.
/**
* test1_1 - 1.1 CompletionCommit
* Participant creates and commits a transaction using the initiator's coordinator.
* @throws Exception on failure.
*/
public void test1_1() throws Exception {
final String conversationId = getConversationId();
final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final String coordinatorURI = ProxyURIRewriting.rewriteURI(ProxyConversation.getAlternateConversationId(conversationId), getSourceCoordinatorURI());
getParticipantStub().completionCommit(serviceURI, coordinatorURI);
state.waitForCompletion(getTestTimeout());
} finally {
ProxyConversation.clearConversationState(conversationId);
}
assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
use of com.jboss.transaction.wstf.interop.states.InteropWaitState in project narayana by jbosstm.
the class Sc007TestCase method test3_6.
/**
* test3_6 - 3.6 ReplayCommit
* Participant registers for Durable2PC, initator initiates commit, participant fails after prepared, recovers and resends prepared. Transaction commits normally.
* @throws Exception on failure.
*/
public void test3_6() throws Exception {
final String conversationId = getConversationId();
final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final CoordinationContextType context = InteropUtil.createCoordinationContext(getSourceCoordinatorURI());
getParticipantStub().replayCommit(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