Package org.apache.cxf.phase

Examples of org.apache.cxf.phase.PhaseManagerImpl


                     iter.hasNext());
    }

    @Test
    public void testGetInInterceptorChain() throws Exception {
        PhaseManagerImpl phaseMgr = new PhaseManagerImpl();
        SortedSet<Phase> list = phaseMgr.getInPhases();
        ColocUtil.setPhases(list, Phase.SETUP, Phase.POST_LOGICAL);
       
        Endpoint ep = control.createMock(Endpoint.class);
        Service srv = control.createMock(Service.class);
        Exchange ex = new ExchangeImpl();
View Full Code Here


    }

    private Exchange getExchange() {
        Bus bus = control.createMock(Bus.class);
        bus.getExtension(PhaseManager.class);
        EasyMock.expectLastCall().andReturn(new PhaseManagerImpl()).anyTimes();
       
        Exchange exchange = control.createMock(Exchange.class);
        exchange.get(Bus.class);
        EasyMock.expectLastCall().andReturn(bus).anyTimes();
        EasyMock.expect(exchange.isEmpty()).andReturn(true).anyTimes();
View Full Code Here

        CachedStream originalEmptyOs = new CachedStream();
       
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(originalEmptyOs);
        message.setContent(XMLStreamWriter.class, writer);

        InterceptorChain chain = new PhaseInterceptorChain((new PhaseManagerImpl()).getOutPhases());
        //Interceptors after SOAPHandlerInterceptor DOMXMLStreamWriter to write
        chain.add(new AbstractProtocolHandlerInterceptor<SoapMessage>(binding, Phase.MARSHAL) {

            public void handleMessage(SoapMessage message) throws Fault {
                try {
View Full Code Here

        // This is to set direction to outbound
        expect(exchange.getOutMessage()).andReturn(message).anyTimes();
        CachedStream originalEmptyOs = new CachedStream();
        message.setContent(OutputStream.class, originalEmptyOs);

        InterceptorChain chain = new PhaseInterceptorChain((new PhaseManagerImpl()).getOutPhases());
        //Interceptors after SOAPHandlerInterceptor DOMXMLStreamWriter to write
        chain.add(new AbstractProtocolHandlerInterceptor<SoapMessage>(binding, Phase.MARSHAL) {

            public void handleMessage(SoapMessage message) throws Fault {
                try {
View Full Code Here

    @Test
    public void testPhases() {
        Bus bus = new SpringBusFactory().createBus();
        PhaseManager cxfPM = bus.getExtension(PhaseManager.class);
        PhaseManager defaultPM = new PhaseManagerImpl();
        SortedSet<Phase> cxfPhases = cxfPM.getInPhases();
        SortedSet<Phase> defaultPhases = defaultPM.getInPhases();
        assertEquals(defaultPhases.size(), cxfPhases.size());
        assertTrue(cxfPhases.equals(defaultPhases));
        cxfPhases = cxfPM.getOutPhases();
        defaultPhases = defaultPM.getOutPhases();
        assertEquals(defaultPhases.size(), cxfPhases.size());
        assertTrue(cxfPhases.equals(defaultPhases));
    }
View Full Code Here

        CachedStream originalEmptyOs = new CachedStream();
       
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(originalEmptyOs);
        message.setContent(XMLStreamWriter.class, writer);

        InterceptorChain chain = new PhaseInterceptorChain((new PhaseManagerImpl()).getOutPhases());
        //Interceptors after SOAPHandlerInterceptor DOMXMLStreamWriter to write
        chain.add(new AbstractProtocolHandlerInterceptor<SoapMessage>(binding, Phase.MARSHAL) {

            public void handleMessage(SoapMessage message) throws Fault {
                try {
View Full Code Here

        // This is to set direction to outbound
        expect(exchange.getOutMessage()).andReturn(message).anyTimes();
        CachedStream originalEmptyOs = new CachedStream();
        message.setContent(OutputStream.class, originalEmptyOs);

        InterceptorChain chain = new PhaseInterceptorChain((new PhaseManagerImpl()).getOutPhases());
        //Interceptors after SOAPHandlerInterceptor DOMXMLStreamWriter to write
        chain.add(new AbstractProtocolHandlerInterceptor<SoapMessage>(binding, Phase.MARSHAL) {

            public void handleMessage(SoapMessage message) throws Fault {
                try {
View Full Code Here

        phases = new ArrayList<Phase>();
        phases.add(new Phase(Phase.SEND, 1000));
        empty = new ArrayList<Interceptor>();

        bus = control.createMock(Bus.class);
        PhaseManager pm = new PhaseManagerImpl();
        EasyMock.expect(bus.getExtension(PhaseManager.class)).andReturn(pm).anyTimes();

        service = control.createMock(Service.class);
        endpoint = control.createMock(Endpoint.class);
        binding = control.createMock(Binding.class);
View Full Code Here

    @Test
    public void testInvokeInboundChain() {
        //Reset Exchange on msg
        msg.setExchange(null);
        Bus bus = setupBus();
        PhaseManager pm = new PhaseManagerImpl();
        EasyMock.expect(bus.getExtension(PhaseManager.class)).andReturn(pm).times(2);

        Endpoint ep = control.createMock(Endpoint.class);
        Binding  bd = control.createMock(Binding.class);
        Service srv = control.createMock(Service.class);
View Full Code Here

        EasyMock.expect(oi.getInput()).andReturn(mi);

        EasyMock.expect(ep.getService()).andReturn(srv).anyTimes();
        EasyMock.expect(
            bus.getExtension(PhaseManager.class)).andReturn(
                                      new PhaseManagerImpl()).times(2);
        EasyMock.expect(bus.getInInterceptors()).andReturn(new ArrayList<Interceptor>());
        EasyMock.expect(ep.getInInterceptors()).andReturn(new ArrayList<Interceptor>());
        EasyMock.expect(srv.getInInterceptors()).andReturn(new ArrayList<Interceptor>());

        control.replay();
View Full Code Here

TOP

Related Classes of org.apache.cxf.phase.PhaseManagerImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.