Package org.apache.cxf.phase

Examples of org.apache.cxf.phase.PhaseManagerImpl


    }

    public void testPhases() {
        Bus bus = new SpringBusFactory().createBus();
        PhaseManager cxfPM = bus.getExtension(PhaseManager.class);
        PhaseManager defaultPM = new PhaseManagerImpl();
        List<Phase> cxfPhases = cxfPM.getInPhases();
        List<Phase> defaultPhases = defaultPM.getInPhases();
        assertEquals(defaultPhases.size(), cxfPhases.size());
        for (int i = 0; i < cxfPhases.size(); i++) {
            assertEquals(0, cxfPhases.get(i).compareTo(defaultPhases.get(i)));
        }
        cxfPhases = cxfPM.getOutPhases();
        defaultPhases = defaultPM.getOutPhases();
        assertEquals(defaultPhases.size(), cxfPhases.size());
        for (int i = 0; i < cxfPhases.size(); i++) {
            assertEquals(0, cxfPhases.get(i).compareTo(defaultPhases.get(i)));
        }
    }
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) {
           
            @Override
            public String getPhase() {
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) {

            @Override
            public String getPhase() {
View Full Code Here

        BusFactory.setDefaultBus(null);
    }

    @Test
    public void testSetColocInPhases() throws Exception {
        PhaseManagerImpl phaseMgr = new PhaseManagerImpl();
        List<Phase> list = phaseMgr.getInPhases();
        int size1 = list.size();
        ColocUtil.setPhases(list, Phase.USER_LOGICAL, Phase.INVOKE);

        assertNotSame("The list size should not be same",
                      size1, list.size());
View Full Code Here

                     Phase.INVOKE);
    }

    @Test
    public void testSetColocOutPhases() throws Exception {
        PhaseManagerImpl phaseMgr = new PhaseManagerImpl();

        List<Phase> list = phaseMgr.getOutPhases();
        int size1 = list.size();
        ColocUtil.setPhases(list, Phase.SETUP, Phase.POST_LOGICAL);

        assertNotSame("The list size should not be same",
                      size1, list.size());
View Full Code Here

    }
   
    @Test
    public void testGetOutInterceptorChain() throws Exception {
        PhaseManagerImpl phaseMgr = new PhaseManagerImpl();
        List<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

                     iter.hasNext());
    }

    @Test
    public void testGetInInterceptorChain() throws Exception {
        PhaseManagerImpl phaseMgr = new PhaseManagerImpl();
        List<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

        // 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

        // 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

    }

    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

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.