edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/message/TestMessageReaderImpl.java
@Test
    public void testStartReadIllegalState() throws InterruptedException, AssetException, 
        IOException
    {
        when(m_ConnectionManager.readMessage()).thenReturn(m_InsData);
        
        m_SUT.startRetreiving(m_Receiver);
        
        //try connecting again
        try
        {
            m_SUT.startRetreiving(m_Receiver);
            fail("Can't call start if thread is already started.");
        }
        catch (IllegalStateException e)
        {
            //expected exception
        }
    }
/**
     * Test start read illegal state if read has already been called.
     */
Test start read illegal state if read has already been called.
Test start read illegal state if read has already been called .
@Test
    public void testStartReadIllegalState() throws InterruptedException, AssetException, 
        IOException
    {
        when(m_ConnectionManager.readMessage()).thenReturn(m_InsData);
        m_SUT.startRetreiving(m_Receiver);
        try
        {
            m_SUT.startRetreiving(m_Receiver);
            fail("Can't call start if thread is already started.");
        }
        catch (IllegalStateException e)
        {
        }
    }
@ Test public void testStartReadIllegalState ( ) throws InterruptedException , AssetException , IOException { when ( m_ConnectionManager . readMessage ( ) ) . thenReturn ( m_InsData ) ; m_SUT . startRetreiving ( m_Receiver ) ; try { m_SUT . startRetreiving ( m_Receiver ) ; fail ( "Can't call start if thread is already started." ) ; } catch ( IllegalStateException e ) { } }
Test start read illegal state if read has already been called.
Test start read illegal state if read has already been called .
//try connecting again //expected exception