mil.dod.th.remote.client/test/mil/dod/th/remote/client/impl/TestMessageListenerServiceImpl.java
@Test
    public void testRemoveRemoteChannelFromErrorNullCallback() throws IOException, InterruptedException
    {
        // replay
        m_SUT.addRemoteChannel(SRC_ID, m_InputStream, null);

        // Force channel to throw exception
        m_InputStream.close();

        Thread.sleep(100);

        // Should not be able to remove channel after being removed from error
        try
        {
            m_SUT.removeRemoteChannel(SRC_ID);
            fail("removeRemoteChannel should throw IllegalArgumentException");
        }
        catch (IllegalArgumentException e)
        {
            // Expected
        }
    }
/**
     * Verify that a remote channel is removed when there is an error with the input stream and callback is null.
     */
Verify that a remote channel is removed when there is an error with the input stream and callback is null.
Verify that a remote channel is removed when there is an error with the input stream and callback is null .
@Test
    public void testRemoveRemoteChannelFromErrorNullCallback() throws IOException, InterruptedException
    {
        m_SUT.addRemoteChannel(SRC_ID, m_InputStream, null);
        m_InputStream.close();
        Thread.sleep(100);
        try
        {
            m_SUT.removeRemoteChannel(SRC_ID);
            fail("removeRemoteChannel should throw IllegalArgumentException");
        }
        catch (IllegalArgumentException e)
        {
        }
    }
@ Test public void testRemoveRemoteChannelFromErrorNullCallback ( ) throws IOException , InterruptedException { m_SUT . addRemoteChannel ( SRC_ID , m_InputStream , null ) ; m_InputStream . close ( ) ; Thread . sleep ( 100 ) ; try { m_SUT . removeRemoteChannel ( SRC_ID ) ; fail ( "removeRemoteChannel should throw IllegalArgumentException" ) ; } catch ( IllegalArgumentException e ) { } }
Verify that a remote channel is removed when there is an error with the input stream and callback is null.
Verify that a remote channel is removed when there is an error with the input stream and callback is null .
// replay // Force channel to throw exception // Should not be able to remove channel after being removed from error // Expected