use of org.apache.cxf.greeter_control.types.FaultLocation in project cxf by apache.
the class InterceptorFaultTest method testWithAddressingAnonymousReplies.
private void testWithAddressingAnonymousReplies(boolean robust) throws Exception {
setupGreeter("org/apache/cxf/systest/interceptor/addr.xml", false);
control.setRobustInOnlyMode(robust);
// all interceptors pass
testInterceptorsPass(robust);
// test failure in phases <= Phase.UNMARSHALL
FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory().createFaultLocation();
location.setAfter(MAPAggregator.class.getName());
// test failure occuring before and after logical addressing interceptor
// won't get a fault in case of oneways non-robust for the latter (partial response already sent)
testInterceptorFail(inPhases, location, robust);
}
use of org.apache.cxf.greeter_control.types.FaultLocation in project cxf by apache.
the class InterceptorFaultTest method testRobustFailWithoutAddressingInUserLogicalPhase.
@Test
public void testRobustFailWithoutAddressingInUserLogicalPhase() throws Exception {
setupGreeter("org/apache/cxf/systest/interceptor/no-addr.xml", false);
control.setRobustInOnlyMode(true);
// behaviour is identicial for all phases
FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory().createFaultLocation();
location.setPhase("user-logical");
control.setFaultLocation(location);
try {
// writer to grab the content of soap fault.
// robust is not yet used at client's side, but I think it should
StringWriter writer = new StringWriter();
((Client) greeter).getInInterceptors().add(new LoggingInInterceptor(new PrintWriterEventSender(new PrintWriter(writer))));
// it should tell CXF to convert one-way robust out faults into real SoapFaultException
((Client) greeter).getEndpoint().put(Message.ROBUST_ONEWAY, true);
greeter.greetMeOneWay("oneway");
fail("Oneway operation unexpectedly succeded for phase " + location.getPhase());
} catch (SOAPFaultException ex) {
// expected
}
}
use of org.apache.cxf.greeter_control.types.FaultLocation in project cxf by apache.
the class InterceptorFaultTest method testWithoutAddressing.
private void testWithoutAddressing(boolean robust) throws Exception {
setupGreeter("org/apache/cxf/systest/interceptor/no-addr.xml", false);
control.setRobustInOnlyMode(robust);
// all interceptors pass
testInterceptorsPass(robust);
// behaviour is identicial for all phases
FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory().createFaultLocation();
// test failure occuring before and after logical addressing interceptor
// won't get a fault in case of oneways non-robust for the latter (partial response already sent)
testInterceptorFail(inPhases, location, robust);
}
use of org.apache.cxf.greeter_control.types.FaultLocation 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.greeter_control.types.FaultLocation 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