Package org.jacorb.notification.queue

Examples of org.jacorb.notification.queue.BoundedFifoEventQueue


public class BoundedFifoEventQueueTest extends TestCase
{
    private void addEventsToEventQueue(EventQueueOverflowStrategy strategy, List events)
    {
        BoundedFifoEventQueue queue = new BoundedFifoEventQueue(4, strategy);

        Iterator i = events.iterator();

        while (i.hasNext())
        {
            queue.put((Message) i.next());
        }
    }
View Full Code Here


        assertTrue(strategy.getRemovedElements().contains(e2));
    }

    public void testGetAllClearsQueue() throws Exception
    {
        BoundedFifoEventQueue queue = new BoundedFifoEventQueue(10, EventQueueOverflowStrategy.LIFO);
       
        assertEquals(0, queue.getAllMessages(false).length );
       
        Message m = newMessage();
        queue.put(m);
       
        Message[] mesgs = queue.getAllMessages(false);
       
        assertEquals(1, mesgs.length);
        assertEquals(m, mesgs[0]);
       
        assertEquals(0, queue.getAllMessages(false).length);
    }
View Full Code Here

    protected void setUp() throws Exception
    {
        lock_ = new Object();

        MessageQueue queue = new BoundedFifoEventQueue(4, EventQueueOverflowStrategy.FIFO, lock_);

        objectUnderTest_ = new RWLockEventQueueDecorator(new DefaultMessageQueueAdapter(queue));
    }
View Full Code Here

    protected void setUp() throws Exception
    {
        lock_ = new Object();

        MessageQueue queue = new BoundedFifoEventQueue(4, EventQueueOverflowStrategy.FIFO, lock_);

        objectUnderTest_ = new RWLockEventQueueDecorator(new DefaultMessageQueueAdapter(queue));
    }
View Full Code Here

    @Before
    public void setUp() throws Exception
    {
        lock_ = new Object();

        MessageQueue queue = new BoundedFifoEventQueue(4, EventQueueOverflowStrategy.FIFO, lock_);

        objectUnderTest_ = new RWLockEventQueueDecorator(new DefaultMessageQueueAdapter(queue));
    }
View Full Code Here

public class BoundedFifoEventQueueTest
{
    private void addEventsToEventQueue(EventQueueOverflowStrategy strategy, List events)
    {
        BoundedFifoEventQueue queue = new BoundedFifoEventQueue(4, strategy);

        Iterator i = events.iterator();

        while (i.hasNext())
        {
            queue.put((Message) i.next());
        }
    }
View Full Code Here

    }

    @Test
    public void testGetAllClearsQueue() throws Exception
    {
        BoundedFifoEventQueue queue = new BoundedFifoEventQueue(10, EventQueueOverflowStrategy.LIFO);
       
        assertEquals(0, queue.getAllMessages(false).length );
       
        Message m = newMessage();
        queue.put(m);
       
        Message[] mesgs = queue.getAllMessages(false);
       
        assertEquals(1, mesgs.length);
        assertEquals(m, mesgs[0]);
       
        assertEquals(0, queue.getAllMessages(false).length);
    }
View Full Code Here

TOP

Related Classes of org.jacorb.notification.queue.BoundedFifoEventQueue

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.