Package org.apache.qpid.server.binding

Examples of org.apache.qpid.server.binding.Binding


        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(null, null, "bindingKey", queue, new DirectExchange(), null));

        policy.performPolicy(queue);

        assertFalse("Queue should not be deleted", queue.isDeleted());
        assertFalse("Connection should not be closed", _connection.isClosed());
View Full Code Here


        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(null, null, "bindingKey", queue, new TopicExchange(), null));

        queue.setAutoDelete(false);

        policy.performPolicy(queue);
View Full Code Here

        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        final MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(null, null, "bindingKey", queue, new TopicExchange(), null));

        setQueueToAutoDelete(queue);

        policy.performPolicy(queue);
View Full Code Here

        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(null, null, "bindingKey", queue, new TopicExchange(), null));

        policy.performPolicy(queue);

        assertFalse("Queue should not be deleted", queue.isDeleted());
        assertTrue("Connection should be closed", _connection.isClosed());
View Full Code Here

        assertTrue("Config was not updated to delete Persistent topics",
                   _config.deletePersistent());

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(null, null, "bindingKey", queue, new TopicExchange(), null));

        policy.performPolicy(queue);

        assertTrue("Queue should be deleted", queue.isDeleted());
        assertTrue("Connection should be closed", _connection.isClosed());
View Full Code Here

        // Explicity say we are not configuring the policy.
        policy.configure(null);

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(null, null, "bindingKey", queue, new TopicExchange(), null));

        policy.performPolicy(queue);

        assertFalse("Queue should not be deleted", queue.isDeleted());
        assertTrue("Connection should be closed", _connection.isClosed());
View Full Code Here

     */
    private void validateBindingProperties(List<Binding> bindings, boolean useSelectors)
    {
        assertEquals("Each queue should only be bound once.", 1, bindings.size());

        Binding binding = bindings.get(0);

        if (useSelectors)
        {
            assertTrue("Binding does not contain a Selector argument.",
                    binding.getArguments().containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()));
            assertEquals("The binding selector argument is incorrect", SELECTOR_VALUE,
                    binding.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.getValue()).toString());
        }
    }
View Full Code Here

    }

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

        reopenStore();

        ByteBuffer argsAsBytes = ByteBuffer.wrap(_bindingArgs.getDataAsBytes());

        verify(_bindingRecoveryHandler).binding(binding.getId(), _exchange.getId(), queue.getId(), ROUTING_KEY, argsAsBytes);
    }
View Full Code Here

    }

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

        _store.unbindQueue(binding);
        reopenStore();
View Full Code Here

        UUID exchangeId = UUIDGenerator.generateBindingUUID(ExchangeDefaults.DEFAULT_EXCHANGE_NAME.asString(),
                                                            queueName,
                                                            queueName,
                                                            _virtualHost.getName());

        return new Binding(exchangeId, queueName, queue, this, Collections.EMPTY_MAP);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.binding.Binding

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.