use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class SequenceTest method testTwowayNonAnonymousMaximumSequenceLength2.
// A maximum sequence length of 2 is configured for the client only (server allows 10).
// However, as we use the defaults regarding the including and acceptance
// for inbound sequence offers and correlate offered sequences that are
// included in a CreateSequence request and accepted with those that are
// created on behalf of such a request, the server also tries terminate its
// sequences.
@Test
public void testTwowayNonAnonymousMaximumSequenceLength2() throws Exception {
init("org/apache/cxf/systest/ws/rm/seqlength10.xml", true);
RMManager manager = greeterBus.getExtension(RMManager.class);
assertEquals("Unexpected maximum sequence length.", 10, manager.getSourcePolicy().getSequenceTerminationPolicy().getMaxLength());
manager.getSourcePolicy().getSequenceTerminationPolicy().setMaxLength(2);
greeter.greetMe("one");
greeter.greetMe("two");
greeter.greetMe("three");
awaitMessages(7, 6, 5000);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
mf.verifyMessages(7, true);
String[] expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_ACTION, GREETME_ACTION, GREETME_ACTION, RM10Constants.TERMINATE_SEQUENCE_ACTION, RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION, RM10Constants.CREATE_SEQUENCE_ACTION, GREETME_ACTION };
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] { null, "1", "2", null, null, null, "1" }, true);
mf.verifyLastMessage(new boolean[] { false, false, true, false, false, false, false }, true);
mf.verifyAcknowledgements(new boolean[] { false, false, true, false, true, false, false }, true);
// 7 partial responses plus 2 full responses to CreateSequence requests
// plus 3 full responses to greetMe requests plus server originiated
// TerminateSequence request
mf.verifyMessages(6, false);
expectedActions = new String[] { RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION, RM10Constants.TERMINATE_SEQUENCE_ACTION, RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, GREETME_RESPONSE_ACTION };
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] { null, "1", "2", null, null, "1" }, false);
boolean[] expected = new boolean[6];
expected[2] = true;
mf.verifyLastMessage(expected, false);
expected[1] = true;
expected[5] = true;
mf.verifyAcknowledgements(expected, false);
}
use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class ServiceInvocationAckBase method testRobustInvocationHandling.
@Test
public void testRobustInvocationHandling() throws Exception {
setupGreeter();
control.setRobustInOnlyMode(true);
FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory().createFaultLocation();
location.setPhase(Phase.INVOKE);
location.setBefore(ServiceInvokerInterceptor.class.getName());
RMManager manager = greeterBus.getExtension(RMManager.class);
// the message is acked and the invocation takes place
greeter.greetMeOneWay("one");
waitForEmpty(manager.getRetransmissionQueue());
control.setFaultLocation(location);
// the invocation fails but the message is acked because the delivery succeeds
greeter.greetMeOneWay("two");
waitForNotEmpty(manager.getRetransmissionQueue());
location.setPhase(null);
control.setFaultLocation(location);
// the retransmission succeeds and the invocation succeeds, the message is acked
waitForEmpty(manager.getRetransmissionQueue());
}
use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class ServiceInvocationAckBase method testDefaultInvocationHandling.
@Test
public void testDefaultInvocationHandling() throws Exception {
setupGreeter();
control.setRobustInOnlyMode(false);
FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory().createFaultLocation();
location.setPhase(Phase.INVOKE);
location.setBefore(ServiceInvokerInterceptor.class.getName());
RMManager manager = greeterBus.getExtension(RMManager.class);
// the message is acked and the invocation takes place
greeter.greetMeOneWay("one");
waitForEmpty(manager.getRetransmissionQueue());
control.setFaultLocation(location);
// the invocation fails but the message is acked because the delivery succeeds
greeter.greetMeOneWay("two");
waitForEmpty(manager.getRetransmissionQueue());
}
Aggregations