Package org.apache.qpid.server.queue

Examples of org.apache.qpid.server.queue.AMQQueue


        _exchange.addBinding(bindingKey,q,arguments);
    }

    private AMQQueue create(String name)
    {
        AMQQueue q = mock(AMQQueue.class);
        when(q.toString()).thenReturn(name);
        when(q.getVirtualHost()).thenReturn(_virtualHost);
        return q;
    }
View Full Code Here


    }


    public void testSimple() throws Exception
    {
        AMQQueue q1 = createAndBind("Q1", "F0000");
        AMQQueue q2 = createAndBind("Q2", "F0000=Aardvark");
        AMQQueue q3 = createAndBind("Q3", "F0001");
        AMQQueue q4 = createAndBind("Q4", "F0001=Bear");
        AMQQueue q5 = createAndBind("Q5", "F0000", "F0001");
        AMQQueue q6 = createAndBind("Q6", "F0000=Aardvark", "F0001=Bear");
        AMQQueue q7 = createAndBind("Q7", "F0000", "F0001=Bear");
        AMQQueue q8 = createAndBind("Q8", "F0000=Aardvark", "F0001");

        routeAndTest(mockMessage(getArgsMapFromStrings("F0000")), q1);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000=Aardvark")), q1, q2);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000=Aardvark", "F0001")), q1, q2, q3, q5, q8);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000", "F0001=Bear")), q1, q3, q4, q5, q7);
View Full Code Here

    }

    public void testAny() throws Exception
    {
        AMQQueue q1 = createAndBind("Q1", "F0000", "F0001", "X-match=any");
        AMQQueue q2 = createAndBind("Q2", "F0000=Aardvark", "F0001=Bear", "X-match=any");
        AMQQueue q3 = createAndBind("Q3", "F0000", "F0001=Bear", "X-match=any");
        AMQQueue q4 = createAndBind("Q4", "F0000=Aardvark", "F0001", "X-match=any");
        AMQQueue q5 = createAndBind("Q5", "F0000=Apple", "F0001", "X-match=any");

        routeAndTest(mockMessage(getArgsMapFromStrings("F0000")), q1, q3);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000=Aardvark")), q1, q2, q3, q4);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000=Aardvark", "F0001")), q1, q2, q3, q4, q5);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000", "F0001=Bear")), q1, q2, q3, q4, q5);
View Full Code Here

        routeAndTest(mockMessage(getArgsMapFromStrings("F0002")));
    }

    public void testOnUnbind() throws Exception
    {
        AMQQueue q1 = createAndBind("Q1", "F0000");
        AMQQueue q2 = createAndBind("Q2", "F0000=Aardvark");
        AMQQueue q3 = createAndBind("Q3", "F0001");

        routeAndTest(mockMessage(getArgsMapFromStrings("F0000")), q1);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0000=Aardvark")), q1, q2);
        routeAndTest(mockMessage(getArgsMapFromStrings("F0001")), q3);
View Full Code Here

    }


    public void testWithSelectors() throws Exception
    {
        AMQQueue q1 = create("Q1");
        AMQQueue q2 = create("Q2");
        bind("q1",getArgsMapFromStrings("F"), q1);
        bind("q1select",getArgsMapFromStrings("F", AMQPFilterTypes.JMS_SELECTOR.toString()+"=F='1'"), q1);
        bind("q2",getArgsMapFromStrings("F=1"), q2);

        routeAndTest(mockMessage(getArgsMapFromStrings("F")),q1);

        routeAndTest(mockMessage(getArgsMapFromStrings("F=1")),q1,q2);


        AMQQueue q3 = create("Q3");
        bind("q3select",getArgsMapFromStrings("F", AMQPFilterTypes.JMS_SELECTOR.toString()+"=F='1'"), q3);
        routeAndTest(mockMessage(getArgsMapFromStrings("F=1")),q1,q2,q3);
        routeAndTest(mockMessage(getArgsMapFromStrings("F=2")),q1);
        bind("q3select2",getArgsMapFromStrings("F", AMQPFilterTypes.JMS_SELECTOR.toString()+"=F='2'"), q3);
View Full Code Here

        verify(_recoveryHandler, never()).configuredObject(any(UUID.class), anyString(), anyMap());
    }

    public void testBindQueue() throws Exception
    {
        AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false, null);
        Binding binding = new Binding(UUIDGenerator.generateRandomUUID(), ROUTING_KEY, queue,
                _exchange, _bindingArgs);
        DurableConfigurationStoreHelper.createBinding(_configStore, binding);

        reopenStore();

        Map<String,Object> map = new HashMap<String, Object>();
        map.put(org.apache.qpid.server.model.Binding.EXCHANGE, _exchange.getId().toString());
        map.put(org.apache.qpid.server.model.Binding.QUEUE, queue.getId().toString());
        map.put(org.apache.qpid.server.model.Binding.NAME, ROUTING_KEY);
        map.put(org.apache.qpid.server.model.Binding.ARGUMENTS,_bindingArgs);

        verify(_recoveryHandler).configuredObject(eq(binding.getId()), eq(BINDING),
                eq(map));
View Full Code Here

                eq(map));
    }

    public void testUnbindQueue() throws Exception
    {
        AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false, null);
        Binding binding = new Binding(UUIDGenerator.generateRandomUUID(), ROUTING_KEY, queue,
                _exchange, _bindingArgs);
        DurableConfigurationStoreHelper.createBinding(_configStore, binding);

        DurableConfigurationStoreHelper.removeBinding(_configStore, binding);
View Full Code Here

                anyMap());
    }

    public void testCreateQueueAMQQueue() throws Exception
    {
        AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true, null);
        DurableConfigurationStoreHelper.createQueue(_configStore, queue);

        reopenStore();
        Map<String, Object> queueAttributes = new HashMap<String, Object>();
        queueAttributes.put(Queue.NAME, getName());
View Full Code Here

    public void testCreateQueueAMQQueueFieldTable() throws Exception
    {
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(Queue.CREATE_DLQ_ON_CREATION, Boolean.TRUE);
        attributes.put(Queue.MAXIMUM_DELIVERY_ATTEMPTS, 10);
        AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true, attributes);

        DurableConfigurationStoreHelper.createQueue(_configStore, queue);

        reopenStore();
View Full Code Here

    public void testCreateQueueAMQQueueWithAlternateExchange() throws Exception
    {
        Exchange alternateExchange = createTestAlternateExchange();

        AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true, alternateExchange, null);
        DurableConfigurationStoreHelper.createQueue(_configStore, queue);

        reopenStore();

        Map<String, Object> queueAttributes = new HashMap<String, Object>();
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.queue.AMQQueue

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.