use of javax.xml.ws.handler.LogicalHandler in project cxf by apache.
the class LogicalHandlerInterceptorTest method xtestReturnFalseClientSide.
// JAX-WS spec: If handler returns false, for a request-response MEP, if the message
// direction is reversed during processing of a request message then the message
// becomes a response message.
// NOTE: commented out as this has been covered by other tests.
@Test
@org.junit.Ignore
public void xtestReturnFalseClientSide() throws Exception {
@SuppressWarnings("rawtypes") List<Handler> list = new ArrayList<>();
list.add(new LogicalHandler<LogicalMessageContext>() {
public void close(MessageContext arg0) {
}
public boolean handleFault(LogicalMessageContext messageContext) {
return true;
}
public boolean handleMessage(LogicalMessageContext messageContext) {
LogicalMessage msg = messageContext.getMessage();
AddNumbersResponse resp = new AddNumbersResponse();
resp.setReturn(11);
msg.setPayload(resp, null);
return false;
}
});
HandlerChainInvoker invoker1 = new HandlerChainInvoker(list);
IMocksControl control1 = createNiceControl();
Binding binding1 = control1.createMock(Binding.class);
@SuppressWarnings("rawtypes") List<Handler> hList = CastUtils.cast(list);
expect(binding1.getHandlerChain()).andReturn(hList).anyTimes();
Exchange exchange1 = control1.createMock(Exchange.class);
expect(exchange1.get(HandlerChainInvoker.class)).andReturn(invoker1).anyTimes();
Message outMessage = new MessageImpl();
outMessage.setExchange(exchange1);
InterceptorChain chain = control1.createMock(InterceptorChain.class);
outMessage.setInterceptorChain(chain);
chain.abort();
EasyMock.expectLastCall();
MessageObserver observer = control1.createMock(MessageObserver.class);
expect(exchange1.get(MessageObserver.class)).andReturn(observer).anyTimes();
observer.onMessage(isA(Message.class));
EasyMock.expectLastCall();
control1.replay();
LogicalHandlerInInterceptor li = new LogicalHandlerInInterceptor(binding1);
li.handleMessage(outMessage);
control1.verify();
}
Aggregations