Package org.apache.qpid.server.queue

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


        _config.setConfiguration("", config);
    }

    private MockAMQQueue createOwnedQueue()
    {
        MockAMQQueue queue = new MockAMQQueue("testQueue");

        _defaultVhost.getQueueRegistry().registerQueue(queue);

        try
        {
            AMQChannel channel = new AMQChannel(_connection, 0, null);
            _connection.addChannel(channel);

            queue.setExclusiveOwningSession(channel);
        }
        catch (AMQException e)
        {
            fail("Unable to create Channel:" + e.getMessage());
        }
View Full Code Here


        _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().
                getVirtualHost("test");
        // Configure items for subjectCreation
        _routingKey = new AMQShortString("RoutingKey");
        _exchange = _testVhost.getExchangeRegistry().getDefaultExchange();
        _queue = new MockAMQQueue("BindingLogSubjectTest");
        ((MockAMQQueue) _queue).setVirtualHost(_testVhost);

        _subject = new BindingLogSubject(String.valueOf(_routingKey), _exchange, _queue);
    }
View Full Code Here

        super.setUp();

        _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().
                getVirtualHost("test");

        _queue = new MockAMQQueue("SubscriptionLogSubjectTest");
        ((MockAMQQueue) _queue).setVirtualHost(_testVhost);

        AMQChannel channel = new AMQChannel(getSession(), _channelID, getSession().getVirtualHost().getMessageStore());

        getSession().addChannel(channel);
View Full Code Here

        super.setUp();

        _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().
                getVirtualHost("test");

        _queue = new MockAMQQueue("QueueLogSubjectTest");
        ((MockAMQQueue) _queue).setVirtualHost(_testVhost);

        _subject = new QueueLogSubject(_queue);
    }
View Full Code Here

    public void testNonExclusiveQueue()
    {
        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

        queue.setExclusiveOwningSession(null);

        policy.performPolicy(queue);

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

        return queues;
    }

    private AMQQueue createTestAMQQueue(final boolean durable)
    {
        return new MockAMQQueue("mockQueue")
        {
            @Override
            public boolean isDurable()
            {
                return durable;
View Full Code Here

    public void testQueuesAreNotProcessed()
    {
        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(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

    public void testNonAutoDeleteTopicIsNotClosed()
    {
        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

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

        queue.setAutoDelete(false);

        policy.performPolicy(queue);

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

    public void testTopicIsClosed()
    {
        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        final MockAMQQueue queue = createOwnedQueue();

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

        setQueueToAutoDelete(queue);

        policy.performPolicy(queue);

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

    public void testNonAutoDeleteTopicIsClosedNotDeleted()
    {
        TopicDeletePolicy policy = new TopicDeletePolicy();
        policy.configure(_config);

        MockAMQQueue queue = createOwnedQueue();

        queue.addBinding(new Binding(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

TOP

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

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.