use of com.jboss.transaction.txinterop.interop.states.BAInteropParticipantCompletedState in project narayana by jbosstm.
the class BATestCase method testBA1_8.
/**
* testBA1_7 - 1.7 UnsolicitedComplete
* Tests a protocol error, participant send Completed for coordinator completion. Throws an invalid state fault.
* @throws Exception on failure.
*
* this test relies on rewriting the protocol at registration time so that the returned endpoint
* is for the coordinator completion coordinator rather than the participant completion coordinator.
* the participant engine tries to use the endpoint to send an unsolicited complete to the coordinator
* completion coordinator. unfortunately, since the endpoint nwo contains service and port metadata the
* send fails. so this test has had to be decommissioned.
*/
/*
public void testBA1_7()
throws Exception
{
final String conversationId = getConversationId() ;
final BAInteropUnsolicitedCompleteState state = new BAInteropUnsolicitedCompleteState() ;
ProxyConversation.setConversationState(conversationId, state) ;
try
{
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
getParticipantStub().unsolicitedComplete(serviceURI, context) ;
state.waitForCompletion(getTestTimeout()) ;
final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
terminator.cancel() ;
}
finally
{
ProxyConversation.clearConversationState(conversationId) ;
}
assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
}
*/
//
/**
* testBA1_8 - 1.8 Compensate
* The PA successfully completes its work on behalf of the activity and the activity is compensated.
* @throws Exception on failure.
*/
public void testBA1_8() throws Exception {
final String conversationId = getConversationId();
final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED);
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI());
getParticipantStub().participantCompleteClose(serviceURI, context);
assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout()));
final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue());
terminator.cancel();
state.waitForCompletion(0);
} finally {
ProxyConversation.clearConversationState(conversationId);
}
assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
use of com.jboss.transaction.txinterop.interop.states.BAInteropParticipantCompletedState in project narayana by jbosstm.
the class BATestCase method testBA1_9.
/**
* testBA1_9 - 1.9 CompensationFail
* The PA successfully completes its work on behalf of the activity but compensation fails..
* @throws Exception on failure.
*/
public void testBA1_9() throws Exception {
final String conversationId = getConversationId();
final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_FAILED);
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI());
getParticipantStub().compensationFail(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());
}
use of com.jboss.transaction.txinterop.interop.states.BAInteropParticipantCompletedState in project narayana by jbosstm.
the class BATestCase method testBA1_5.
/**
* testBA1_5 - 1.5 ParticipantCompleteClose
* The PA successfully completes its work on behalf of the activity and the activity is closed.
* @throws Exception on failure.
*/
public void testBA1_5() throws Exception {
final String conversationId = getConversationId();
final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_CLOSED);
ProxyConversation.setConversationState(conversationId, state);
try {
final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI());
getParticipantStub().participantCompleteClose(serviceURI, context);
assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout()));
final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue());
terminator.close();
state.waitForCompletion(0);
} finally {
ProxyConversation.clearConversationState(conversationId);
}
assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Aggregations