use of org.apache.cxf.systest.ws.util.MessageFlow in project cxf by apache.
the class SequenceTest method testConcurrency.
@Test
public void testConcurrency() throws Exception {
init("org/apache/cxf/systest/ws/rm/rminterceptors.xml", true);
int max = 5;
for (int i = 0; i < max; i++) {
greeter.greetMeAsync(Integer.toString(i));
}
// CreateSequence and five greetMe messages
// full and partial responses to each
awaitMessages(max + 1, 1, 7500);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
mf.verifyMessages(max + 1, true);
String[] expectedActions = new String[max + 1];
expectedActions[0] = RM10Constants.CREATE_SEQUENCE_ACTION;
for (int i = 1; i < expectedActions.length; i++) {
expectedActions[i] = GREETME_ACTION;
}
mf.verifyActions(expectedActions, true);
}
use of org.apache.cxf.systest.ws.util.MessageFlow in project cxf by apache.
the class SequenceTest method testTwowayNonAnonymousNoOffer.
@Test
public void testTwowayNonAnonymousNoOffer() throws Exception {
init("org/apache/cxf/systest/ws/rm/no-offer.xml", true);
greeter.greetMe("one");
// greeter.greetMe("two");
// Outbound expected:
// CreateSequence + greetMe + CreateSequenceResponse = 3 messages
awaitMessages(3, 3);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
mf.verifyMessages(3, true);
String[] expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_ACTION, GREETME_ACTION, RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION };
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] { null, "1", null }, true);
mf.verifyLastMessage(new boolean[] { false, false, false }, true);
mf.verifyAcknowledgements(new boolean[] { false, false, false }, true);
expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, RM10Constants.CREATE_SEQUENCE_ACTION, GREETME_RESPONSE_ACTION };
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] { null, null, "1" }, false);
mf.verifyAcknowledgements(new boolean[] { false, false, false }, false);
}
use of org.apache.cxf.systest.ws.util.MessageFlow in project cxf by apache.
the class SequenceTest method verifyTwowayNonAnonymous.
private void verifyTwowayNonAnonymous() throws Exception {
// CreateSequence and three greetMe messages
// TODO there should be partial responses to the decoupled responses!
awaitMessages(4, 4);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
mf.verifyMessages(4, true);
String[] expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_ACTION, GREETME_ACTION, GREETME_ACTION, GREETME_ACTION };
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] { null, "1", "2", "3" }, true);
mf.verifyLastMessage(new boolean[] { false, false, false, false }, true);
mf.verifyAcknowledgements(new boolean[] { false, false, true, true }, true);
// createSequenceResponse plus 3 greetMeResponse messages plus
// one partial response for each of the four messages
// the first partial response should no include an acknowledgement, the other three should
mf.verifyMessages(4, false);
expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION };
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] { null, "1", "2", "3" }, false);
mf.verifyLastMessage(new boolean[4], false);
mf.verifyAcknowledgements(new boolean[] { false, true, true, true }, false);
}
use of org.apache.cxf.systest.ws.util.MessageFlow in project cxf by apache.
the class SequenceTest method verifyOnewayAnonymousAcks.
private void verifyOnewayAnonymousAcks() throws Exception {
// three application messages plus createSequence
awaitMessages(4, 4);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
mf.verifyMessages(4, true);
String[] expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_ACTION, GREETMEONEWAY_ACTION, GREETMEONEWAY_ACTION, GREETMEONEWAY_ACTION };
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] { null, "1", "2", "3" }, true);
// createSequenceResponse plus 3 partial responses
mf.verifyMessages(4, false);
expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION, RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION, RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION };
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] { null, null, null, null }, false);
mf.verifyAcknowledgements(new boolean[] { false, true, true, true }, false);
}
use of org.apache.cxf.systest.ws.util.MessageFlow in project cxf by apache.
the class SequenceTest method testTwowayMessageLoss.
private void testTwowayMessageLoss(Executor executor) throws Exception {
init("org/apache/cxf/systest/ws/rm/message-loss.xml", true, executor);
greeterBus.getOutInterceptors().add(new MessageLossSimulator());
RMManager manager = greeterBus.getExtension(RMManager.class);
manager.getConfiguration().setBaseRetransmissionInterval(new Long(2000));
greeter.greetMe("one");
greeter.greetMe("two");
greeter.greetMe("three");
greeter.greetMe("four");
awaitMessages(7, 5, 10000);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
// Expected outbound:
// CreateSequence
// + 4 greetMe messages
// + 2 resends
String[] expectedActions = new String[7];
expectedActions[0] = RM10Constants.CREATE_SEQUENCE_ACTION;
for (int i = 1; i < expectedActions.length; i++) {
expectedActions[i] = GREETME_ACTION;
}
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] { null, "1", "2", "2", "3", "4", "4" }, true);
mf.verifyLastMessage(new boolean[7], true);
boolean[] expectedAcks = new boolean[7];
for (int i = 2; i < expectedAcks.length; i++) {
expectedAcks[i] = true;
}
mf.verifyAcknowledgements(expectedAcks, true);
// Expected inbound:
// createSequenceResponse
// + 4 greetMeResponse actions (to original or resent)
// + 5 partial responses (to CSR & each of the initial greetMe messages)
// + at least 2 further partial response (for each of the resends)
expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION };
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] { null, "1", "2", "3", "4" }, false);
mf.verifyAcknowledgements(new boolean[] { false, true, true, true, true }, false);
}
Aggregations