Package org.apache.synapse

Examples of org.apache.synapse.SynapseMessage


*
*/

public class BulitinProcessorTest extends TestCase {
    public void testLogProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        Processor log = new LogProcessor();
        boolean result = log.process(null,sm);
        assertTrue(result);
    }
View Full Code Here


*
*/

public class ClassMediatorProcessorTest extends TestCase {
    public void testClassMediatorProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        ClassMediatorProcessor pro = new ClassMediatorProcessor();
        pro.setClazz(Class.forName("org.apache.synapse.mediators.LoggerTestSample"));
        boolean result = pro.process(null,sm);
        assertTrue(result);
View Full Code Here

                Thread.currentThread().getContextClassLoader());
    }

    public void testServiceMediatorWithAddressingEngage() throws Exception {

        SynapseMessage smc = new Axis2SynapseMessage(msgCtx);
        env.injectMessage(smc);
        assertNotNull(env.lookupProcessor("service-mediator"));
    }
View Full Code Here

    public void testMultipleAddressingModuleEngagement() throws Exception {
        /**
         * Test case return an excetion if Something goes wrong in AddressingINProcessor
         */
        SynapseMessage smc = new Axis2SynapseMessage(msgCtx);
        env.injectMessage(smc);
        assertNotNull(env.lookupProcessor("mediation"));
    }
View Full Code Here

        // So it a mediator uses EnvironmentAware, that mediator will be injected with the correct environment
        mc.setProperty(
                org.apache.synapse.Constants.MEDIATOR_SYNAPSE_ENV_PROPERTY,
                env);
        ////////////////////////////////////////////////////////////////////////
        SynapseMessage smc = new Axis2SynapseMessage(mc);
        env.injectMessage(smc);

        ///////////////////////////////////////////////////////////////////////
        // Response handling mechanism for 200/202 and 5XX
        // smc.isResponse =true then the response will be handle with 200 OK
        // else, response will be 202 OK without no http body
        // smc.isFaultRespose = true then the response is a fault with 500 Internal Server Error
        if (smc.isResponse()) {
            mc.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN,
                    Constants.VALUE_TRUE);
        }
        if (smc.isFaultResponse()) {
            // todo: a good way to inject faultSoapEnv to the Axis2 Transport
            throw new AxisFault(
                    "Synapse Encounters an Error - Please See Log for More Details");
        }
        ///////////////////////////////////////////////////////////////////////
View Full Code Here

                Thread.currentThread().getContextClassLoader());
    }

    public void testFalseReturnFromMediator() throws Exception {

        SynapseMessage smc = new Axis2SynapseMessage(msgCtx);
        env.injectMessage(smc);
        assertNotNull(env.lookupProcessor("mediator_false"));
        assertNull(smc.getProperty("test_string"));
    }
View Full Code Here

    public void testAddressingProcessor() throws Exception {
        SynapseEnvironment env = new Axis2SynapseEnvironment(
                Axis2EnvSetup.getSynapseConfigElement(synapsexml),
                Thread.currentThread().getContextClassLoader());
        SynapseMessage smc = new Axis2SynapseMessage(msgCtx);
        env.injectMessage(smc);
        assertTrue(((Boolean) smc.getProperty(
                Constants.MEDIATOR_RESPONSE_PROPERTY)).booleanValue());
        assertEquals("add",env.lookupProcessor("add").getName());
    }
View Full Code Here

                    "<xslt name=\"stlt_test_name\" xsl=\"./tranformation/simple_transformation.xsl\" type=\"body\"/>" +
                    "</synapse>";


    public void testXSLTProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        XSLTProcessor pro = new XSLTProcessor();
        pro.setXSLInputStream(new ByteArrayInputStream(xsl.getBytes()));
        pro.setIsBody(true);
        boolean result = pro.process(null, sm);
View Full Code Here

        SynapseEnvironment env = new Axis2SynapseEnvironment(
                Axis2EnvSetup.getSynapseConfigElement(synapsexml),
                Thread.currentThread().getContextClassLoader());
        assertNotNull(env.getMasterProcessor());

        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        // throws exceptions if anything goes wrong
        env.injectMessage(sm);

    }
View Full Code Here

                Thread.currentThread().getContextClassLoader());
    }

    public void testAxis2MediatorProcessor() throws Exception {

        SynapseMessage smc = new Axis2SynapseMessage(msgCtx);
        env.injectMessage(smc);
        assertNotNull(env.lookupProcessor("service-mediator"));
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.SynapseMessage

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.