Package org.apache.synapse.axis2

Examples of org.apache.synapse.axis2.Axis2SynapseEnvironment


        return new Axis2SynapseMessage(msgCtx);
    }

    public static Axis2SynapseMessage createSampleSOAP11MessageWithAddressing(
            String testingRepository) {
        Axis2SynapseMessage sm =
                createSampleSOAP11MessageWithoutAddressing(testingRepository);
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
        OMNamespace wsaTo = fac.createOMNamespace(Submission.WSA_NAMESPACE,"wsa");
        SOAPHeaderBlock addressingToHeaderBlock = fac.createSOAPHeaderBlock("To",wsaTo, sm.getEnvelope().getHeader());
        addressingToHeaderBlock.setText(URN_SAMPLE_TO_ADDRESS);
        sm.getEnvelope().getHeader().addChild(addressingToHeaderBlock);
        return sm;

    }
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

*/

public class InProcessorTest extends TestCase {

    public void testInProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        InProcessor pro = new InProcessor();
        boolean retrun = pro.process(null,sm);
        assertTrue(retrun);
    }
View Full Code Here

        msgCtx.setAxisService(service);
        service.setClassLoader(axisConfiguration.getServiceClassLoader());
        AxisOperation axisOp = new InOutAxisOperation(
                new QName("op"));
        msgCtx.setAxisOperation(axisOp);
        axisOp.setMessageReceiver(new SynapseMessageReceiver());
        service.addOperation(axisOp);
        axisConfiguration.addService(service);
        msgCtx.setTo(
                new EndpointReference("/axis2/services/" + "se" + "/" + "op"));
        msgCtx.setSoapAction("op");
View Full Code Here

     */
    public MessageContext build() throws Exception {
        SynapseConfiguration testConfig = new SynapseConfiguration();
        // TODO: check whether we need a SynapseEnvironment in all cases
        SynapseEnvironment synEnv
            = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()),
                                          testConfig);
        MessageContext synCtx;
        if (requireAxis2MessageContext) {
            synCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(),
                                             testConfig, synEnv);
View Full Code Here

     */
    public MessageContext build() throws Exception {
        SynapseConfiguration testConfig = new SynapseConfiguration();
        // TODO: check whether we need a SynapseEnvironment in all cases
        SynapseEnvironment synEnv
            = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()),
                                          testConfig);
        MessageContext synCtx;
        if (requireAxis2MessageContext) {
            synCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(),
                                             testConfig, synEnv);
View Full Code Here

        algorithm.setLoadBalanceEndpoint(loadbalanceEndpoint);

        loadbalanceEndpoint.setChildren(endpoints);
        loadbalanceEndpoint.setAlgorithm(algorithm);

        SynapseEnvironment env = new Axis2SynapseEnvironment(
                new ConfigurationContext(new AxisConfiguration()), new SynapseConfiguration());
        loadbalanceEndpoint.init(env);
        return loadbalanceEndpoint;
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.axis2.Axis2SynapseEnvironment

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.