Package org.apache.qpid.server.queue

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


        super.setUp();

        _testVhost = BrokerTestHelper.createVirtualHost("test");
        _routingKey = "RoutingKey";
        _exchange = _testVhost.getExchange("amq.direct");
        _queue = new MockAMQQueue("BindingLogSubjectTest");
        ((MockAMQQueue) _queue).setVirtualHost(_testVhost);

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


    {
        super.setUp();

        _testVhost = BrokerTestHelper.createVirtualHost("test");

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

        _subscription = mock(Subscription.class);
        when(_subscription.getQueue()).thenReturn(_queue);
        when(_subscription.getSubscriptionID()).thenReturn(SUBSCRIPTION_ID);
View Full Code Here

    private MockAMQQueue _queue;

    protected void setUp()
    {
        _count++;
        _queue = new MockAMQQueue(getQueueName());
    }
View Full Code Here

        _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

    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

    public void testQueuesAreNotProcessed()
    {
        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

    public void testNonAutoDeleteTopicIsNotClosed()
    {
        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);

        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, 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, 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

        policy.configure(_config);

        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

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.