Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.Phase


        }
    }

    public void testPhaseFirst() throws AxisFault {
        ArrayList phases = new ArrayList();
        Phase p1 = new Phase("PhaseA");
        phases.add(p1);
        Phase p2 = new Phase("PhaseB");
        phases.add(p2);
        PhaseHolder ph = new PhaseHolder(phases);
        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h1 = new PhaseRuleHandler();
View Full Code Here


        fail("Succeeded in deploying after PhaseFirst handler!");
    }

    public void testPhaseLast() throws AxisFault {
        ArrayList phases = new ArrayList();
        Phase p1 = new Phase("PhaseA");
        phases.add(p1);
        Phase p2 = new Phase("PhaseB");
        phases.add(p2);

        PhaseHolder ph = new PhaseHolder(phases);
        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
View Full Code Here

    }

    public void testPhaseRules() throws Exception {
        // TODO : What is this testing exactly?
        ArrayList inPhase = new AxisConfiguration().getInFlowPhases();
        Phase transportIN = new Phase("TransportIn");
        Phase preDispatch = new Phase("PreDispatch");
        DispatchPhase dispatchPhase = new DispatchPhase();
        dispatchPhase.setName("Dispatch");

        inPhase.add(transportIN);
        inPhase.add(preDispatch);
View Full Code Here

        ph.addHandler(hm3);
    }

    public void testSingleHandler() throws Exception {
        ArrayList phases = new ArrayList();
        Phase p1 = new Phase("PhaseA");
        phases.add(p1);
        Phase p2 = new Phase("PhaseB");
        phases.add(p2);

        PhaseHolder ph = new PhaseHolder(phases);
        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
View Full Code Here

                "handler with both phaseFirst and PhaseLast true ");
    }

    public void testInvalidPhaseFirst() {
        ArrayList phases = new ArrayList();
        Phase p1 = new Phase("PhaseA");
        phases.add(p1);
        Phase p2 = new Phase("PhaseB");
        phases.add(p2);

        PhaseHolder ph = new PhaseHolder(phases);
        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
View Full Code Here

    }

    public void testInvalidPhaseFirst1() {
        try {
            ArrayList phases = new ArrayList();
            Phase p1 = new Phase("PhaseA");
            phases.add(p1);
            Phase p2 = new Phase("PhaseB");
            phases.add(p2);

            PhaseHolder ph = new PhaseHolder(phases);
            HandlerDescription hm = new HandlerDescription();
            hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
View Full Code Here

        }
    }

    public void testPhaseLastErrors() throws Exception {
        ArrayList phases = new ArrayList();
        Phase p1 = new Phase("PhaseA");
        phases.add(p1);
        Phase p2 = new Phase("PhaseB");
        phases.add(p2);

        PhaseHolder ph = new PhaseHolder(phases);
        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
View Full Code Here

    }

    public void testInvalidPhaseLast() {
        try {
            ArrayList phases = new ArrayList();
            Phase p1 = new Phase("PhaseA");
            phases.add(p1);
            Phase p2 = new Phase("PhaseB");
            phases.add(p2);

            PhaseHolder ph = new PhaseHolder(phases);
            HandlerDescription hm = new HandlerDescription();
            hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
View Full Code Here

        PhaseRuleHandler h2 = new PhaseRuleHandler("c");
        hd = new HandlerDescription("c");
        h2.init(hd);

        Phase phase = new Phase();
        phase.addHandler(h1);
        phase.addHandler(h2);

        PhaseRule badRule = new PhaseRule();
        badRule.setBefore("a");
        badRule.setAfter("c");

        hd = new HandlerDescription("b");
        PhaseRuleHandler h3 = new PhaseRuleHandler("b");
        h3.init(hd);

        hd.setHandler(h3);
        hd.setRules(badRule);
        try {
            phase.addHandler(hd);
            fail("Bad PhaseRule was accepted!");
        } catch (PhaseException e) {
            // Correct - exception caught
        }
    }
View Full Code Here

    }

    public void testGlobalDisengagement() throws AxisFault {
        AxisModule module = config.getModule("testModule");
        assertNotNull(module);
        Phase phase;
        Phase userPhase;
        ArrayList globalinflow = config.getInFlowPhases();
        assertNotNull(globalinflow);
        phase = (Phase) globalinflow.get(3);
        assertNotNull(phase);
        assertEquals(phase.getHandlerCount(), 0);
        AxisService service = config.getService(serviceName);
        assertNotNull(service);
        AxisOperation operation = service.getOperation(opName);
        assertNotNull(operation);
        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
        assertNotNull(userPhase);
        assertEquals(0, userPhase.getHandlerCount());

        config.engageModule(module.getName());
        assertEquals(2, phase.getHandlerCount());
        assertEquals(1, userPhase.getHandlerCount());

        config.disengageModule(module);
        assertEquals(0, phase.getHandlerCount());
        assertEquals(0, userPhase.getHandlerCount());
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.Phase

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.