Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQConnectionURL


    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 = _broker.equals(VM) ? ("vm://:" + DEFAULT_VM_PORT) : ("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

        //        while the tcp:localhost broker has 3 retries with a 2s connect delay
        String connectionString = "amqp://guest:guest@/test?brokerlist=" +
                                  "'vm://:" + ApplicationRegistry.DEFAULT_INSTANCE +
                                  ";tcp://localhost:5670?connectdelay='2000',retries='3''";

        AMQConnectionURL url = new AMQConnectionURL(connectionString);

        try
        {
            long start = System.currentTimeMillis();
            AMQConnection connection = new AMQConnection(url, null);
View Full Code Here

    public void testFailoverSingleDelay() throws URLSyntaxException, AMQVMBrokerCreationException,
                                                 InterruptedException, JMSException
    {
        String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='2000',retries='3''";

        AMQConnectionURL url = new AMQConnectionURL(connectionString);

        try
        {
            long start = System.currentTimeMillis();
            AMQConnection connection = new AMQConnection(url, null);
View Full Code Here

    {
        int CONNECT_DELAY = 2000;
        String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='" + CONNECT_DELAY + "'," +
                                  "retries='3'',failover='nofailover'";

        AMQConnectionURL url = new AMQConnectionURL(connectionString);

        try
        {
            //Kill initial broker
            stopBroker();
View Full Code Here

     * Convenience method to build an {@link AMQConnectionURL} with the right parameters.
     */
    public AMQConnectionURL createConnectionURL(String vhost, String username, String password) throws URLSyntaxException
    {
        String url = "amqp://" + username + ":" + password + "@clientid/" + vhost + "?brokerlist='" + getBroker() + "?retries='0''";
        return new AMQConnectionURL(url);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.AMQConnectionURL

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.