Java Code Examples for org.apache.cxf.message.MessageImpl#setInterceptorChain()

The following examples show how to use org.apache.cxf.message.MessageImpl#setInterceptorChain() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestBase.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    SortedSet<Phase> phases = new TreeSet<>();
    Phase phase1 = new Phase("phase1", 1);
    Phase phase2 = new Phase("phase2", 2);
    Phase phase3 = new Phase("phase3", 3);
    phases.add(phase1);
    phases.add(phase2);
    phases.add(phase3);
    chain = new PhaseInterceptorChain(phases);

    Exchange exchange = new ExchangeImpl();
    MessageImpl messageImpl = new MessageImpl();
    messageImpl.setInterceptorChain(chain);
    messageImpl.setExchange(exchange);
    xmlMessage = messageImpl;
}
 
Example 2
Source File: TestUtil.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static SoapMessage createEmptySoapMessage(SoapVersion soapVersion, InterceptorChain chain) {
    Exchange exchange = new ExchangeImpl();
    MessageImpl messageImpl = new MessageImpl();
    messageImpl.setInterceptorChain(chain);
    messageImpl.setExchange(exchange);
    SoapMessage soapMessage = new SoapMessage(messageImpl);
    soapMessage.setVersion(soapVersion);
    soapMessage.put(Message.HTTP_REQUEST_METHOD, "POST");
    return soapMessage;
}
 
Example 3
Source File: JMSContinuationTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    m = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    m.setExchange(exchange);
    m.setInterceptorChain(EasyMock.createMock(InterceptorChain.class));
    exchange.setInMessage(m);

    b = BusFactory.getDefaultBus();
    observer = EasyMock.createMock(MessageObserver.class);
}
 
Example 4
Source File: GZIPAcceptEncodingTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
    interceptor = new GZIPOutInterceptor();
    inMessage = new MessageImpl();
    outMessage = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    exchange.setInMessage(inMessage);
    inMessage.setExchange(exchange);
    inMessage.setContent(InputStream.class, new ByteArrayInputStream(new byte[0]));
    exchange.setOutMessage(outMessage);
    outMessage.setExchange(exchange);
    outMessage.setContent(OutputStream.class, new ByteArrayOutputStream());
    outInterceptors = EasyMock.createMock(InterceptorChain.class);
    outMessage.setInterceptorChain(outInterceptors);
}