Package org.apache.synapse

Examples of org.apache.synapse.SynapseMessage


                    .getProperty(Constants.MEDIATOR_SYNAPSE_ENV_PROPERTY);
            ((EnvironmentAware) mediator).setSynapseEnvironment(se);
            ((EnvironmentAware) mediator).setClassLoader(
                    messageContext.getAxisService().getClassLoader());
        }
        SynapseMessage smc = new Axis2SynapseMessage(messageContext);
        boolean returnValue = mediator.mediate(smc);
        messageContext.setProperty(Constants.MEDIATOR_RESPONSE_PROPERTY,
                new Boolean(returnValue));
    }
View Full Code Here


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

    public void testAddressingProcessor() throws Exception {

        SynapseMessage smc = new Axis2SynapseMessage(msgCtx);
        env.injectMessage(smc);
        assertTrue(((Boolean) smc.getProperty(
                Constants.MEDIATOR_RESPONSE_PROPERTY)).booleanValue());
    }
View Full Code Here

        env = new Axis2SynapseEnvironment(config,
                Thread.currentThread().getContextClassLoader());
    }

    public void testRegexProcessor() throws Exception {
        SynapseMessage smc = new Axis2SynapseMessage(mc);
        env.injectMessage(smc);
        assertEquals("regex", env.lookupProcessor("regex").getName());

    }
View Full Code Here

*
*/

public class RegexProcessorTest extends TestCase {
    public void testRegexProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        sm.setTo(new EndpointReference("http://xmethods.org"));
        RegexProcessor pro = new RegexProcessor();
        pro.setPattern("http://xmethods..\\*");
        boolean result = pro.process(null,sm);
        assertTrue(result);

View Full Code Here

*
*/

public class ServiceMediatorProcessorTest extends TestCase {
    public void testServiceMediatorProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository-sendonAxis2"));
        ServiceMediatorProcessor pro = new ServiceMediatorProcessor();
        pro.setServiceName("test-mediator");
        boolean result = pro.process(null,sm);
        assertTrue(result);
View Full Code Here

public class AddressingInProcessorTest extends TestCase {

    public void testAddressingInProcessor() throws Exception {

        SynapseEnvironment se = TestSynapseEnvironment.createAxis2SynapseEnvironment();
        SynapseMessage smNoAdd = TestSynapseMessage.createSampleSOAP11MessageWithoutAddressing("target/synapse-repository");
        AddressingInProcessor aip = new AddressingInProcessor();

        aip.process(se, smNoAdd);
        assertTrue("to should be null if there is no addressing header", smNoAdd.getTo() == null);

        SynapseMessage smAdd = TestSynapseMessage.createSampleSOAP11MessageWithAddressing("target/synapse-repository");
        aip.process(se,smAdd);
        assertTrue("to should be the incoming addressing header",
                smAdd.getTo().getAddress().equals(TestSynapseMessage.URN_SAMPLE_TO_ADDRESS));

    }
View Full Code Here

        env = new Axis2SynapseEnvironment(config,
                Thread.currentThread().getContextClassLoader());
    }

    public void testXpathProcessor() throws Exception {
        SynapseMessage smc = new Axis2SynapseMessage(mc);
        env.injectMessage(smc);
        assertEquals("xpath", env.lookupProcessor("xpath").getName());
    }
View Full Code Here

*
*/

public class XpathProcessorTest extends TestCase {
    public void testXpathProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        XPathProcessor pro = new XPathProcessor();
        pro.setXPathExpr("//ns:text");
        pro.addXPathNamespace("ns", "urn:text-body");
        boolean result = pro.process(null, sm);
View Full Code Here

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

    public void testClassMediatorProcessor() throws Exception {

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

*
*/

public class StageProcessorTest extends TestCase {
    public void testStageProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        StageProcessor pro = new StageProcessor();
        boolean result = pro.process(null, sm);
        assertTrue(result);

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.