mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestQueuedMessageSender.java
@Test
    public void testEmptyQueue() throws InterruptedException
    {
        // have send fail to make queue fill up
        when(m_Channel.trySendMessage(Mockito.any(TerraHarvestMessage.class))).thenReturn(false);
        
        assertThat("queue is empty initially", m_SUT.getQueuedMessageCount(), is(0));
        
        boolean result;
        for (int i=1; i < 10; i++)
        {
            TerraHarvestMessage message = constructMessage(i);
            result = m_SUT.queue(message);
            assertThat("able to queue up to capacity limit", result, is(true));
            
            assertThat("queue size equals number of messages still queued", m_SUT.getQueuedMessageCount(), is(i));
        }
        
        //empty the queue.
        m_SUT.clearQueue();
        
        //verify
        assertThat("queue was emptied", m_SUT.getQueuedMessageCount(), is(0));
    }
/**
     * Verify the queue can be emptied for a particular channel. 
     * 
     * Verify queue count returns to 0.
     */
Verify the queue can be emptied for a particular channel.

Verify queue count returns to 0.
Verify the queue can be emptied for a particular channel . Verify queue count returns to 0 .
@Test
    public void testEmptyQueue() throws InterruptedException
    {
        when(m_Channel.trySendMessage(Mockito.any(TerraHarvestMessage.class))).thenReturn(false);
        assertThat("queue is empty initially", m_SUT.getQueuedMessageCount(), is(0));
        boolean result;
        for (int i=1; i < 10; i++)
        {
            TerraHarvestMessage message = constructMessage(i);
            result = m_SUT.queue(message);
            assertThat("able to queue up to capacity limit", result, is(true));
            assertThat("queue size equals number of messages still queued", m_SUT.getQueuedMessageCount(), is(i));
        }
        m_SUT.clearQueue();
        assertThat("queue was emptied", m_SUT.getQueuedMessageCount(), is(0));
    }
@ Test public void testEmptyQueue ( ) throws InterruptedException { when ( m_Channel . trySendMessage ( Mockito . any ( TerraHarvestMessage . class ) ) ) . thenReturn ( false ) ; assertThat ( "queue is empty initially" , m_SUT . getQueuedMessageCount ( ) , is ( 0 ) ) ; boolean result ; for ( int i = 1 ; i < 10 ; i ++ ) { TerraHarvestMessage message = constructMessage ( i ) ; result = m_SUT . queue ( message ) ; assertThat ( "able to queue up to capacity limit" , result , is ( true ) ) ; assertThat ( "queue size equals number of messages still queued" , m_SUT . getQueuedMessageCount ( ) , is ( i ) ) ; } m_SUT . clearQueue ( ) ; assertThat ( "queue was emptied" , m_SUT . getQueuedMessageCount ( ) , is ( 0 ) ) ; }
Verify the queue can be emptied for a particular channel.
Verify the queue can be emptied for a particular channel .
// have send fail to make queue fill up //empty the queue. //verify