Examples of MockSubscription


Examples of org.apache.qpid.server.subscription.MockSubscription

    {
        final SimpleAMQQueue queue = new SimpleAMQQueue(new AMQShortString("testActiveConsumerCount"), false, new AMQShortString("testOwner"),
                false, false, _virtualHost, new SimpleQueueEntryList.Factory(), null);

        //verify adding an active subscription increases the count
        final MockSubscription subscription1 = new MockSubscription();
        subscription1.setActive(true);
        assertEquals("Unexpected active consumer count", 0, queue.getActiveConsumerCount());
        queue.registerSubscription(subscription1, false);
        assertEquals("Unexpected active consumer count", 1, queue.getActiveConsumerCount());

        //verify adding an inactive subscription doesn't increase the count
        final MockSubscription subscription2 = new MockSubscription();
        subscription2.setActive(false);
        assertEquals("Unexpected active consumer count", 1, queue.getActiveConsumerCount());
        queue.registerSubscription(subscription2, false);
        assertEquals("Unexpected active consumer count", 1, queue.getActiveConsumerCount());

        //verify behaviour in face of expected state changes:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.