Package org.apache.synapse.endpoints

Examples of org.apache.synapse.endpoints.AddressEndpoint


        fac = OMAbstractFactory.getOMFactory();
        OMElement endpointElement
                = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE);

        AddressEndpoint addressEndpoint = (AddressEndpoint) endpoint;

        EndpointDefinition epAddress = addressEndpoint.getDefinition();
        OMElement addressElement = serializeEndpointDefinition(epAddress);
        endpointElement.addChild(addressElement);

        // serialize the properties
        serializeProperties(addressEndpoint, endpointElement);
View Full Code Here


        OMElement config2 = serializer.serializeMediator(null, send1);
        SendMediator send2 = (SendMediator) factory.createMediator(config2, new Properties());

        assertTrue("Top level endpoint should be a address endpoint.",
                send1.getEndpoint() instanceof AddressEndpoint);
        AddressEndpoint ep1 = (AddressEndpoint) send1.getEndpoint();

        assertTrue("Top level endpoint should be a WSDL endpoint.",
                send2.getEndpoint() instanceof AddressEndpoint);
        AddressEndpoint ep2 = (AddressEndpoint) send2.getEndpoint();

        assertEquals("Address URI is not serialized properly",
                ep1.getDefinition().getAddress(), ep2.getDefinition().getAddress());

        assertEquals(
                "Addressing information is not serialized properly",
                ep1.getDefinition().isAddressingOn(),
                ep2.getDefinition().isAddressingOn());
    }
View Full Code Here

        assertTrue("Leaf level endpoints should be address endpoints",
                addresses.get(1) instanceof AddressEndpoint);
        assertTrue("Leaf level endpoints should be address endpoints",
                addresses.get(2) instanceof AddressEndpoint);

        AddressEndpoint addressEndpoint = (AddressEndpoint) addresses.get(0);
        assertTrue("URI of address endpoint is not serialized properly",
                "http://localhost:9001/services/Service1".equals(addressEndpoint.getDefinition().getAddress()));
    }
View Full Code Here

        assertTrue("Leaf level endpoints should be address endpoints",
                addresses.get(1) instanceof AddressEndpoint);
        assertTrue("Leaf level endpoints should be address endpoints",
                addresses.get(2) instanceof AddressEndpoint);

        AddressEndpoint addressEndpoint = (AddressEndpoint) addresses.get(0);
        assertTrue("URI of address endpoint is not serialized properly",
                "http://localhost:9001/services/Service1".equals(addressEndpoint.getDefinition().getAddress()));
    }
View Full Code Here

        String inputXML = "<endpoint  xmlns=\"http://ws.apache.org/ns/synapse\">" +
                "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" />" +
                "</endpoint>" ;

        OMElement inputElement = createOMElement(inputXML);
        AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement(
                inputElement,true,null);

        OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint);
        assertTrue(compare(serializedOut,inputElement));
View Full Code Here

                "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" >" +
                "</address>"+
                "</endpoint>" ;

        OMElement inputElement = createOMElement(inputXML);
        AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement(
                inputElement,false,null);
        OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint);
       
        assertTrue(compare(serializedOut,inputElement));
    }
View Full Code Here

                "</retryConfig>" +
                "</address>" +
                "</endpoint>" ;

        OMElement inputElement = createOMElement(inputXML);
        AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement(
                inputElement,true,null);

        OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint);
        assertTrue(compare(serializedOut,inputElement));
View Full Code Here

                "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" >" +
                "</address>"+
                "</endpoint>" ;

        OMElement inputElement = createOMElement(inputXML);
        AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement(
                inputElement, true, null);
        assertNotNull(endpoint.getName()); // make sure we generate names for anonymous endpoints
        OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint);
        // the generated name should not show up in the serialization
        assertTrue(compare(serializedOut,inputElement));
    }
View Full Code Here

    public void testSimpleObserver() {
        SynapseConfiguration synapseConfig = new SynapseConfiguration();
        synapseConfig.setAxisConfiguration(new AxisConfiguration());
        synapseConfig.registerObserver(observer);

        Endpoint epr = new AddressEndpoint();
        epr.setName("endpoint1");
        synapseConfig.addEndpoint(epr.getName(), epr);
        assertItemAdded(epr.getName(), ENDPOINT);
        synapseConfig.removeEndpoint(epr.getName());
        assertItemRemoved(epr.getName(), ENDPOINT);

        SequenceMediator seq = new SequenceMediator();
        seq.setName("sequence1");
        synapseConfig.addSequence(seq.getName(), seq);
        assertItemAdded(seq.getName(), SEQUENCE);
View Full Code Here

        fac = OMAbstractFactory.getOMFactory();
        OMElement endpointElement
                = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE);

        AddressEndpoint addressEndpoint = (AddressEndpoint) endpoint;

        EndpointDefinition epAddress = addressEndpoint.getDefinition();
        OMElement addressElement = serializeEndpointDefinition(epAddress);
        endpointElement.addChild(addressElement);

         // serialize the properties
        serializeProperties(addressEndpoint, endpointElement);
View Full Code Here

TOP

Related Classes of org.apache.synapse.endpoints.AddressEndpoint

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.