use of com.arjuna.wsc.tests.arq.TestActivationCoordinatorProcessor.CreateCoordinationContextDetails in project narayana by jbosstm.
the class ActivationTest method executeRequestTest.
private void executeRequestTest(final String messageId, final String coordinationType, final Long expires, final CoordinationContext coordinationContext) throws Exception {
final MAP map = AddressingHelper.createRequestContext(TestUtil11.activationCoordinatorService, messageId);
Expires expiresInstance;
if (expires == null) {
expiresInstance = null;
} else {
expiresInstance = new Expires();
expiresInstance.setValue(expires.longValue());
}
CreateCoordinationContextResponseType createCoordinationContextResponseType;
createCoordinationContextResponseType = ActivationCoordinatorClient.getClient().sendCreateCoordination(map, coordinationType, expiresInstance, coordinationContext);
final CreateCoordinationContextDetails details = testActivationCoordinatorProcessor.getCreateCoordinationContextDetails(messageId, 10000);
final CreateCoordinationContextType requestCreateCoordinationContext = details.getCreateCoordinationContext();
final MAP requestMAP = details.getMAP();
assertNotNull(requestMAP.getTo());
assertEquals(requestMAP.getTo(), TestUtil11.activationCoordinatorService);
// we don't care about the reply to field -- this is an RPC style message
// assertNotNull(requestMAP.getReplyTo());
// assertTrue(AddressingHelper.isNoneReplyTo(requestMAP));
assertNotNull(requestMAP.getMessageID());
assertEquals(requestMAP.getMessageID(), messageId);
if (expires == null) {
assertNull(requestCreateCoordinationContext.getExpires());
} else {
assertNotNull(requestCreateCoordinationContext.getExpires());
assertEquals(expires.longValue(), requestCreateCoordinationContext.getExpires().getValue());
}
if (coordinationContext == null) {
assertNull(requestCreateCoordinationContext.getCurrentContext());
} else {
assertNotNull(requestCreateCoordinationContext.getCurrentContext());
assertEquals(requestCreateCoordinationContext.getCurrentContext().getIdentifier().getValue(), coordinationContext.getIdentifier().getValue());
if (coordinationContext.getExpires() == null) {
assertNull(requestCreateCoordinationContext.getCurrentContext().getExpires());
} else {
assertNotNull(requestCreateCoordinationContext.getCurrentContext().getExpires());
assertEquals(requestCreateCoordinationContext.getCurrentContext().getExpires().getValue(), coordinationContext.getExpires().getValue());
}
assertNotNull(requestCreateCoordinationContext.getCurrentContext().getIdentifier());
assertEquals(requestCreateCoordinationContext.getCurrentContext().getIdentifier().getValue(), coordinationContext.getIdentifier().getValue());
}
assertNotNull(requestCreateCoordinationContext.getCoordinationType());
assertEquals(requestCreateCoordinationContext.getCoordinationType(), coordinationType);
// make sure we got a sensible response
checkResponse(coordinationType, expiresInstance, createCoordinationContextResponseType);
}
use of com.arjuna.wsc.tests.arq.TestActivationCoordinatorProcessor.CreateCoordinationContextDetails in project narayana by jbosstm.
the class EnduranceTest method doCreateCoordinationContextRequest.
public void doCreateCoordinationContextRequest(final String messageId) throws Exception {
final String coordinationType = TestUtil.COORDINATION_TYPE;
final MAP map = AddressingHelper.createRequestContext(TestUtil11.activationCoordinatorService, messageId);
CreateCoordinationContextResponseType response = ActivationCoordinatorClient.getClient().sendCreateCoordination(map, coordinationType, null, null);
final CreateCoordinationContextDetails details = testActivationCoordinatorProcessor.getCreateCoordinationContextDetails(messageId, 10000);
final CreateCoordinationContextType requestCreateCoordinationContext = details.getCreateCoordinationContext();
final MAP requestMap = details.getMAP();
assertEquals(requestMap.getTo(), TestUtil11.activationCoordinatorService);
assertEquals(requestMap.getMessageID(), messageId);
assertNull(requestCreateCoordinationContext.getExpires());
assertNull(requestCreateCoordinationContext.getCurrentContext());
assertEquals(requestCreateCoordinationContext.getCoordinationType(), coordinationType);
CoordinationContext context = response.getCoordinationContext();
assertNotNull(context);
assertNull(context.getExpires());
assertEquals(context.getCoordinationType(), coordinationType);
assertNotNull(context.getIdentifier());
}
Aggregations