Package org.apache.synapse.config

Examples of org.apache.synapse.config.SynapseConfiguration


        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


        URL u = this.getClass().getClassLoader().getResource("synapse-config");
        String root = new File(u.toURI()).getAbsolutePath();

        System.out.println("Using SYNAPSE_CONFIG_HOME=" + root);
        try {
            SynapseConfiguration synapseConfig =
                    MultiXMLConfigurationBuilder.getConfiguration(root, new Properties());

            assertNotNull(synapseConfig.getDefinedSequences().get("main"));
            assertNotNull(synapseConfig.getDefinedSequences().get("fault"));
            SequenceMediator foo = synapseConfig.getDefinedSequences().get("foo");
            SequenceMediator seq1 = synapseConfig.getDefinedSequences().get("synapse_xml_seq1");
            assertNotNull(foo);
            assertNotNull(seq1);
            assertEquals("foo.xml", foo.getFileName());
            assertNull(seq1.getFileName());
            assertNull(synapseConfig.getDefinedSequences().get("bar"));
                       
            assertNotNull(synapseConfig.getDefinedEndpoints().get("epr1"));
            assertNotNull(synapseConfig.getDefinedEndpoints().get("synapse_xml_epr1"));

            assertNotNull(synapseConfig.getProxyService("proxy1"));

            assertNotNull(synapseConfig.getStartup("task1"));

            assertNotNull(synapseConfig.getRegistry());
            assertTrue(JavaUtils.isTrueExplicitly(synapseConfig.getProperty(
                    MultiXMLConfigurationBuilder.SEPARATE_REGISTRY_DEFINITION)));
           
        } catch (XMLStreamException e) {
            fail("Error while parsing a configuration file: " + e.getMessage());
        }
View Full Code Here

        }

        // we should try to get the synapse configuration and environment from
        // the axis2 configuration.
        SynapseEnvironment synapseEnvironment = getSynapseEnvironment(axisMsgCtx);
        SynapseConfiguration synapseConfiguration = getSynapseConfiguration(axisMsgCtx);
        if (synapseConfiguration != null && synapseEnvironment != null) {
            return new Axis2MessageContext(axisMsgCtx, synapseConfiguration, synapseEnvironment);
        } else {
            return new Axis2MessageContext(axisMsgCtx, synCfg, synEnv);
        }
View Full Code Here

     * Test that a proxy service without publishWSDL will produce a meaningful WSDL.
     * This is a regression test for SYNAPSE-366.
     */
    public void testWSDLWithoutPublishWSDL() throws Exception {
        // Build the proxy service
        SynapseConfiguration synCfg = new SynapseConfiguration();
        AxisConfiguration axisCfg = new AxisConfiguration();
        ProxyService proxyService = new ProxyService("Test");
        AxisService axisService = proxyService.buildAxisService(synCfg, axisCfg);
        // Serialize the WSDL
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

     * test checks that the proxy service can be built and produce a WSDL.
     * This is a test for the feature introduced by SYNAPSE-200 and a regression test
     * for SYNAPSE-362.
     */
    public void testWSDLWithPublishWSDLAndRecursiveImports() throws Exception {
        SynapseConfiguration synCfg = new SynapseConfiguration();
        AxisConfiguration axisCfg = new AxisConfiguration();
        // Add local entries
        Entry entry = new Entry();
        entry.setType(Entry.URL_SRC);
        entry.setSrc(getClass().getResource("root.wsdl"));
        synCfg.addEntry("root_wsdl", entry);
        entry = new Entry();
        entry.setType(Entry.URL_SRC);
        entry.setSrc(getClass().getResource("imported.xsd"));
        synCfg.addEntry("imported_xsd", entry);
        entry = new Entry();
        entry.setType(Entry.URL_SRC);
        entry.setSrc(getClass().getResource("imported.wsdl"));
        synCfg.addEntry("imported_wsdl", entry);
        // Build the proxy service
        ProxyService proxyService = new ProxyService("Test");
        proxyService.setWSDLKey("root_wsdl");
        ResourceMap resourceMap = new ResourceMap();
        resourceMap.addResource("imported.wsdl", "imported_wsdl");
View Full Code Here

     * Test a proxy service with recursive imports and without a {@link ResourceMap}.
     * Regression test for SYNAPSE-442.
     */
    public void testRecursiveImports2() throws Exception {
        ProxyService testService = new ProxyService("mytest");
        SynapseConfiguration synCfg = new SynapseConfiguration();
        AxisConfiguration axisCfg = new AxisConfiguration();
        testService.setWsdlURI(getClass().getResource("SimpleStockService.wsdl").toURI());
        testService.buildAxisService(synCfg, axisCfg);
    }
View Full Code Here

    }

    private MessageContext createMessageContext(String payload, String action) {
        try {
            SynapseConfiguration synapseConfig = new SynapseConfiguration();
            AxisConfiguration axisConfig = new AxisConfiguration();
            synapseConfig.setAxisConfiguration(axisConfig);
            ConfigurationContext cfgCtx = new ConfigurationContext(axisConfig);
            SynapseEnvironment env = new Axis2SynapseEnvironment(cfgCtx, synapseConfig);
            axisConfig.addParameter(SynapseConstants.SYNAPSE_CONFIG, synapseConfig);
            axisConfig.addParameter(SynapseConstants.SYNAPSE_ENV, env);
View Full Code Here

*/
public class HessianMessageBuilderTest extends TestCase {

    public void testProcessDocumentFaultWithSynEnv() throws IOException {
        SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(
                new AxisConfiguration()), new SynapseConfiguration());
        testProcessDocumentFault(synEnv);
    }
View Full Code Here

        testProcessDocumentFault(null);
    }

    public void testProcessDocumentWithSynEnv() throws IOException {
        SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(
                new AxisConfiguration()), new SynapseConfiguration());
        testProcessDocument(synEnv);
    }
View Full Code Here

    public static MessageContext createLightweightSynapseMessageContext(
            String payload) throws Exception {
        org.apache.axis2.context.MessageContext mc =
                new org.apache.axis2.context.MessageContext();
        SynapseConfiguration config = new SynapseConfiguration();
        SynapseEnvironment env = new Axis2SynapseEnvironment(config);
        MessageContext synMc = new Axis2MessageContext(mc, config, env);
        SOAPEnvelope envelope =
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        OMDocument omDoc =
View Full Code Here

TOP

Related Classes of org.apache.synapse.config.SynapseConfiguration

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.