Package org.mule.endpoint

Examples of org.mule.endpoint.MuleEndpointURI


    public void setAsText(String text)
    {
        try
        {
            setValue(new MuleEndpointURI(text, muleContext));
        }
        catch (EndpointException e)
        {
            throw new IllegalArgumentException(e.getMessage());
        }
View Full Code Here


    private boolean registerAsSoap(String endpoint, Object listener) throws MuleException
    {
        if (endpoint.startsWith("soap") || endpoint.startsWith("axis") || endpoint.startsWith("cxf"))
        {
            EndpointURI ep = new MuleEndpointURI(endpoint, muleContext);

            // get the service name from the URI path
            String serviceName = null;
            if (ep.getPath() != null)
            {
                String path = ep.getPath();
                if (path.endsWith("/"))
                {
                    path = path.substring(0, path.length() - 1);
                }
                int i = path.lastIndexOf("/");
View Full Code Here

    public void testAxisHttpEndpointURICopy() throws Exception
    {

        // Create MuleEndpointURI and test values
        MuleEndpointURI endpointUri = new MuleEndpointURI("axis:http://localhost:8080?param=1", muleContext);
        endpointUri.initialise();
        assertEquals("http", endpointUri.getScheme());
        assertEquals("axis", endpointUri.getSchemeMetaInfo());
        assertEquals("axis:http", endpointUri.getFullScheme());
        assertEquals("http://localhost:8080?param=1", endpointUri.getAddress());

        // Reconstruct MuleEndpointURI and test values
        EndpointURI newEndpointUri = new MuleEndpointURI(endpointUri);
        newEndpointUri.initialise();
        assertEquals("http", newEndpointUri.getScheme());
        assertEquals("axis", newEndpointUri.getSchemeMetaInfo());
        assertEquals("axis:http", newEndpointUri.getFullScheme());
        assertEquals("http://localhost:8080?param=1", newEndpointUri.getAddress());
        assertEquals(endpointUri, newEndpointUri);
    }
View Full Code Here

    public void testAxisJmsEndpointURICopy() throws Exception
    {

        // Create MuleEndpointURI and test values
        MuleEndpointURI endpointUri = new MuleEndpointURI("axis:jms://myComponent", muleContext);
        assertEquals("jms", endpointUri.getScheme());
        assertEquals("axis", endpointUri.getSchemeMetaInfo());
        assertEquals("axis:jms", endpointUri.getFullScheme());
        assertEquals("jms://myComponent", endpointUri.getAddress());
        endpointUri.initialise();

        // Reconstruct MuleEndpointURI and test values
        EndpointURI newEndpointUri = new MuleEndpointURI(endpointUri);
        newEndpointUri.initialise();
        assertEquals("jms", newEndpointUri.getScheme());
        assertEquals("axis", newEndpointUri.getSchemeMetaInfo());
        assertEquals("axis:jms", newEndpointUri.getFullScheme());
        assertEquals("jms://myComponent", newEndpointUri.getAddress());
        assertEquals(endpointUri, newEndpointUri);
    }
View Full Code Here

        assertEquals("jms://?address=[[testgroup]]test.queue", url.toString());
    }

    public void testJmsQueueDestinationsWithEncoding() throws Exception
    {
        EndpointURI url = new MuleEndpointURI("jms://%5B%5Btestgroup%5D%5Dtest.queue", muleContext);
        url.initialise();
        assertEquals("jms", url.getScheme());
        assertEquals("[[testgroup]]test.queue", url.getAddress());
        assertNull( url.getResourceInfo());
        assertEquals("jms://%5B%5Btestgroup%5D%5Dtest.queue", url.toString());
    }
View Full Code Here

public class JdbcEndpointTestCase extends AbstractMuleTestCase
{

    public void testWithoutEndpointName() throws Exception
    {
        EndpointURI url = new MuleEndpointURI("jdbc:/?sql=SELECT * FROM TABLE", muleContext);
        url.initialise();
        assertEquals("jdbc", url.getScheme());
        assertEquals("", url.getAddress());
        assertNotNull(url.getParams());
        assertEquals("SELECT * FROM TABLE", url.getParams().get("sql"));
        assertEquals("jdbc:/?sql=SELECT%20*%20FROM%20TABLE", url.toString());
    }
View Full Code Here

        assertEquals("jms://%5B%5Btestgroup%5D%5Dtest.queue", url.toString());
    }

    public void testJmsTopicDestinationsWithEncoding() throws Exception
    {
        EndpointURI url = new MuleEndpointURI("jms:topic://%5B%5Btestgroup%5D%5Dtest.topic", muleContext);
        url.initialise();
        assertEquals("jms", url.getScheme());
        assertEquals("[[testgroup]]test.topic", url.getAddress());
        assertEquals("topic", url.getResourceInfo());
        assertEquals("jms://%5B%5Btestgroup%5D%5Dtest.topic", url.toString());
    }
View Full Code Here

        assertEquals("jms://%5B%5Btestgroup%5D%5Dtest.topic", url.toString());
    }

    public void testJmsLegacyTopicDestinationsWithEncoding() throws Exception
    {
        EndpointURI url = new MuleEndpointURI("jms://topic:%5B%5Btestgroup%5D%5Dtest.topic", muleContext);
        url.initialise();
        assertEquals("jms", url.getScheme());
        assertEquals("[[testgroup]]test.topic", url.getAddress());
        assertEquals("topic", url.getResourceInfo());
        assertEquals("jms://topic:%5B%5Btestgroup%5D%5Dtest.topic", url.toString());
    }
View Full Code Here

        assertEquals("jdbc:/?sql=SELECT%20*%20FROM%20TABLE", url.toString());
    }

    public void testWithoutEndpointName2() throws Exception
    {
        EndpointURI url = new MuleEndpointURI("jdbc://?sql=SELECT * FROM TABLE", muleContext);
        url.initialise();
        assertEquals("jdbc", url.getScheme());
        assertEquals("jdbc", url.getAddress());
        assertNotNull(url.getParams());
        assertEquals("SELECT * FROM TABLE", url.getParams().get("sql"));
        assertEquals("jdbc://?sql=SELECT%20*%20FROM%20TABLE", url.toString());
    }
View Full Code Here

        assertEquals("jdbc://?sql=SELECT%20*%20FROM%20TABLE", url.toString());
    }

    public void testWithEndpointName() throws Exception
    {
        EndpointURI url = new MuleEndpointURI("jdbc://writeTests?type=2", muleContext);
        url.initialise();
        assertEquals("jdbc", url.getScheme());
        assertEquals("writeTests", url.getAddress());
        assertNotNull(url.getParams());
        assertEquals("2", url.getParams().get("type"));
        assertEquals("jdbc://writeTests?type=2", url.toString());
    }
View Full Code Here

TOP

Related Classes of org.mule.endpoint.MuleEndpointURI

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.