Package org.mule.transport.ajax.embedded

Examples of org.mule.transport.ajax.embedded.AjaxConnector


            if (getConnector() instanceof AjaxConnector)
            {
                // If a replyTo channel is set the client is expecting a response.
                // Mule does not invoke the replyTo handler if an error occurs, but in this case we
                // want it to.
                AjaxConnector ajaxConnector = (AjaxConnector) getConnector();
                if (!ajaxConnector.isDisableReplyTo() && message != null && message.getExceptionPayload() == null && replyTo != null)
                {
                    ajaxConnector.getReplyToHandler(endpoint).processReplyTo(RequestContext.getEvent(), message, replyTo);
                }
            }
            return null;
        }
View Full Code Here


public class AjaxEmbeddedConnectorTestCase extends AbstractConnectorTestCase
{
    @Override
    public Connector createConnector() throws Exception
    {
        AjaxConnector c = new AjaxConnector(muleContext);
        c.setName("test");
        //By default the connector is not started until the servlet container is up.  We start it here because
        //this test looks at the connector lifecycle
        c.setInitialStateStopped(false);
        c.setServerUrl(new URL("http://0.0.0.0:12345"));
        return c;
    }
View Full Code Here

        return "ajax-namespace-config.xml";
    }

    public void testConnector1Properties() throws Exception
    {
        AjaxConnector connector =
                (AjaxConnector) muleContext.getRegistry().lookupConnector("connector1");

        assertNotNull(connector);

        assertTrue(connector.isJsonCommented());
        assertEquals(1000, connector.getInterval());
        assertEquals(1, connector.getLogLevel());
        assertEquals(10000, connector.getMaxInterval());
        assertEquals(3000, connector.getMultiFrameInterval());
        assertEquals(4000, connector.getRefsThreshold());
        assertEquals(50000, connector.getTimeout());
        assertEquals(new URL("http://0.0.0.0:" + getPorts().get(0) + "/service"), connector.getServerUrl());
        assertEquals("/foo/bar", connector.getResourceBase());
    }
View Full Code Here

        assertEquals("/foo/bar", connector.getResourceBase());
    }

    public void testSecureConnector2Properties() throws Exception
    {
        AjaxConnector connector =
                (AjaxConnector) muleContext.getRegistry().lookupConnector("connector2");

        assertNotNull(connector);

        assertTrue(connector.isJsonCommented());
        assertEquals(1000, connector.getInterval());
        assertEquals(1, connector.getLogLevel());
        assertEquals(10000, connector.getMaxInterval());
        assertEquals(3000, connector.getMultiFrameInterval());
        assertEquals(4000, connector.getRefsThreshold());
        assertEquals(50000, connector.getTimeout());
        assertEquals(new URL("https://0.0.0.0:" + getPorts().get(1) + "/service"), connector.getServerUrl());
        assertEquals("/foo/bar", connector.getResourceBase());

        //The full path gets resolved, we're just checkng that the property got set
        assertTrue(connector.getKeyStore().endsWith("/serverKeystore"));
        assertEquals("mulepassword", connector.getKeyPassword());
        assertEquals("mulepassword", connector.getKeyStorePassword());
        //The full path gets resolved, we're just checkng that the property got set
        assertTrue(connector.getClientKeyStore().endsWith("/clientKeystore"));
        assertEquals("mulepassword", connector.getClientKeyStorePassword());
        //The full path gets resolved, we're just checkng that the property got set
        assertTrue(connector.getTrustStore().endsWith("/trustStore"));
        assertEquals("mulepassword", connector.getTrustStorePassword());
        assertTrue(connector.isExplicitTrustStoreOnly());
        assertTrue(connector.isRequireClientAuthentication());
    }
View Full Code Here

public class AjaxEmbeddedConnectorTestCase extends AbstractConnectorTestCase
{
    @Override
    public Connector createConnector() throws Exception
    {
        AjaxConnector c = new AjaxConnector(muleContext);
        c.setName("test");
        //By default the connector is not started until the servlet container is up.  We start it here because
        //this test looks at the connector lifecycle
        c.setInitialStateStopped(false);
        c.setServerUrl(new URL("http://0.0.0.0:12345"));
        return c;
    }
View Full Code Here

    }

    @Test
    public void testConnector1Properties() throws Exception
    {
        AjaxConnector connector =
                (AjaxConnector) muleContext.getRegistry().lookupConnector("connector1");

        assertNotNull(connector);

        assertTrue(connector.isJsonCommented());
        assertEquals(1000, connector.getInterval());
        assertEquals(1, connector.getLogLevel());
        assertEquals(10000, connector.getMaxInterval());
        assertEquals(3000, connector.getMultiFrameInterval());
        assertEquals(4000, connector.getRefsThreshold());
        assertEquals(50000, connector.getTimeout());
        assertEquals(new URL("http://0.0.0.0:" + dynamicPort1.getNumber() + "/service"), connector.getServerUrl());
        assertEquals("/foo/bar", connector.getResourceBase());
        // Test a abstract connector property (MULE-5776)
        assertTrue(connector.isValidateConnections());
    }
View Full Code Here

    }

    @Test
    public void testSecureConnector2Properties() throws Exception
    {
        AjaxConnector connector =
                (AjaxConnector) muleContext.getRegistry().lookupConnector("connector2");

        assertNotNull(connector);

        assertTrue(connector.isJsonCommented());
        assertEquals(1000, connector.getInterval());
        assertEquals(1, connector.getLogLevel());
        assertEquals(10000, connector.getMaxInterval());
        assertEquals(3000, connector.getMultiFrameInterval());
        assertEquals(4000, connector.getRefsThreshold());
        assertEquals(50000, connector.getTimeout());
        assertEquals(new URL("https://0.0.0.0:" + dynamicPort2.getNumber() + "/service"), connector.getServerUrl());
        assertEquals("/foo/bar", connector.getResourceBase());

        //The full path gets resolved, we're just checkng that the property got set
        assertTrue(connector.getKeyStore().endsWith("/serverKeystore"));
        assertEquals("muleserver", connector.getKeyAlias());
        assertEquals("mulepassword", connector.getKeyPassword());
        assertEquals("mulepassword", connector.getKeyStorePassword());
        //The full path gets resolved, we're just checkng that the property got set
        assertTrue(connector.getClientKeyStore().endsWith("/clientKeystore"));
        assertEquals("mulepassword", connector.getClientKeyStorePassword());
        //The full path gets resolved, we're just checkng that the property got set
        assertTrue(connector.getTrustStore().endsWith("/trustStore"));
        assertEquals("mulepassword", connector.getTrustStorePassword());
        assertTrue(connector.isExplicitTrustStoreOnly());
        assertTrue(connector.isRequireClientAuthentication());
    }
View Full Code Here

            if (getConnector() instanceof AjaxConnector)
            {
                // If a replyTo channel is set the client is expecting a response.
                // Mule does not invoke the replyTo handler if an error occurs, but in this case we
                // want it to.
                AjaxConnector ajaxConnector = (AjaxConnector) getConnector();
                if (!ajaxConnector.isDisableReplyTo() && message != null && message.getExceptionPayload() == null && replyTo != null)
                {
                    ajaxConnector.getReplyToHandler(endpoint).processReplyTo(RequestContext.getEvent(), message, replyTo);
                }
            }
            return null;
        }
View Full Code Here

TOP

Related Classes of org.mule.transport.ajax.embedded.AjaxConnector

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.