Package org.apache.qpid.jms

Examples of org.apache.qpid.jms.ConnectionURL


    public void testHostNamesWithUnderScore() throws URLSyntaxException
    {
        String url = "amqp://guest:guest@clientid/test?brokerlist='tcp://under_score:6672'";

        ConnectionURL connectionurl = new AMQConnectionURL(url);

        assertTrue(connectionurl.getUsername().equals("guest"));
        assertTrue(connectionurl.getPassword().equals("guest"));
        assertTrue(connectionurl.getVirtualHost().equals("/test"));

        assertTrue(connectionurl.getBrokerCount() == 1);
        BrokerDetails service = connectionurl.getBrokerDetails(0);
        assertTrue(service.getTransport().equals("tcp"));
        assertTrue(service.getHost().equals("under_score"));
        assertTrue(service.getPort() == 6672);

        url = "amqp://guest:guest@clientid/test?brokerlist='tcp://under_score'";

        connectionurl = new AMQConnectionURL(url);

        assertTrue(connectionurl.getUsername().equals("guest"));
        assertTrue(connectionurl.getPassword().equals("guest"));
        assertTrue(connectionurl.getVirtualHost().equals("/test"));

        assertTrue(connectionurl.getBrokerCount() == 1);
        service = connectionurl.getBrokerDetails(0);
        assertTrue(service.getTransport().equals("tcp"));
        assertTrue(service.getHost().equals("under_score"));
        assertTrue(service.getPort() == 5672);
    }
View Full Code Here


    public void testRejectBehaviourPresent() throws Exception
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&rejectbehaviour='server'";

        ConnectionURL connectionURL = new AMQConnectionURL(url);

        assertTrue(connectionURL.getFailoverMethod() == null);
        assertTrue(connectionURL.getUsername().equals("guest"));
        assertTrue(connectionURL.getPassword().equals("guest"));
        assertTrue(connectionURL.getVirtualHost().equals("/test"));

        //check that the reject behaviour option is returned as expected
        assertEquals("Reject behaviour option was not as expected", "server",
                connectionURL.getOption(ConnectionURL.OPTIONS_REJECT_BEHAVIOUR));
    }
View Full Code Here

    public void testRejectBehaviourNotPresent() throws URLSyntaxException
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&foo='bar'";

        ConnectionURL connectionurl = new AMQConnectionURL(url);

        assertTrue(connectionurl.getFailoverMethod() == null);
        assertTrue(connectionurl.getUsername().equals("guest"));
        assertTrue(connectionurl.getPassword().equals("guest"));
        assertTrue(connectionurl.getVirtualHost().equals("/test"));

        //check that the reject behaviour option is null as expected
        assertNull("Reject behaviour option was not as expected",
                connectionurl.getOption(ConnectionURL.OPTIONS_REJECT_BEHAVIOUR));
    }
View Full Code Here

     * such that this can later be used to verify it wasnt specified.
     */
    public void testDefaultSsl() throws URLSyntaxException
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&foo='bar'";
        ConnectionURL connectionURL = new AMQConnectionURL(url);

        assertNull("default ssl value should be null", connectionURL.getOption(ConnectionURL.OPTIONS_SSL));
    }
View Full Code Here

     * such that this can later be used to verify what value it was specified as.
     */
    public void testOverridingSsl() throws URLSyntaxException
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&ssl='true'";
        ConnectionURL connectionURL = new AMQConnectionURL(url);

        assertTrue("value should be true", Boolean.valueOf(connectionURL.getOption(ConnectionURL.OPTIONS_SSL)));

        url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&ssl='false'";
        connectionURL = new AMQConnectionURL(url);

        assertFalse("value should be false", Boolean.valueOf(connectionURL.getOption(ConnectionURL.OPTIONS_SSL)));
    }
View Full Code Here

     * verify it wasn't specified.
     */
    public void testDefaultVerifyQueueOnSend() throws URLSyntaxException
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&foo='bar'";
        ConnectionURL connectionURL = new AMQConnectionURL(url);

        assertNull("default ssl value should be null", connectionURL.getOption(ConnectionURL.OPTIONS_SSL));
    }
View Full Code Here

     * to verify what value it was specified as.
     */
    public void testOverridingVerifyQueueOnSend() throws URLSyntaxException
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&verifyQueueOnSend='true'";
        ConnectionURL connectionURL = new AMQConnectionURL(url);

        assertTrue("value should be true", Boolean.valueOf(connectionURL.getOption(ConnectionURL.OPTIONS_VERIFY_QUEUE_ON_SEND)));

        url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'&verifyQueueOnSend='false'";
        connectionURL = new AMQConnectionURL(url);

        assertFalse("value should be false", Boolean.valueOf(connectionURL.getOption(ConnectionURL.OPTIONS_VERIFY_QUEUE_ON_SEND)));
    }
View Full Code Here

        // Start broker
        super.setUp();
       
        // Connect to broker
        String broker = ("tcp://localhost:" + DEFAULT_PORT);
        ConnectionURL url = new AMQConnectionURL("amqp://guest:guest@clientid/test?brokerlist='" + broker + "'&maxprefetch='1'");
        _con = (AMQConnection) getConnection(url);
        _con.setExceptionListener(this);
        _con.start();
       
        // Create queue
View Full Code Here

        AMQConnection conn = null;
        try
        {
            BrokerDetails broker = getBroker();
            broker.setProperty(BrokerDetails.OPTIONS_RETRY, "1");
            ConnectionURL url = new AMQConnectionURL("amqp://guest:guest@clientid/test?brokerlist='"
                                     + broker
                                     + "'&defaultQueueExchange='test.direct'"
                                     + "&defaultTopicExchange='test.topic'"
                                     + "&temporaryQueueExchange='tmp.direct'"
                                     + "&temporaryTopicExchange='tmp.topic'");

            System.err.println(url.toString());
            conn = new AMQConnection(url);


            AMQSession sess = (AMQSession) conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

        {
            _rejectBehaviour = destination.getRejectBehaviour();
        }
        else
        {
            ConnectionURL connectionURL = connection.getConnectionURL();
            String rejectBehaviour = connectionURL.getOption(ConnectionURL.OPTIONS_REJECT_BEHAVIOUR);
            if (rejectBehaviour != null)
            {
                _rejectBehaviour = RejectBehaviour.valueOf(rejectBehaviour.toUpperCase());
            }
            else
View Full Code Here

TOP

Related Classes of org.apache.qpid.jms.ConnectionURL

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.