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

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

        // Wait for onChannelRemoved with exception
        assertThat(m_CallbackWaitRemEx.tryAcquire(1, TimeUnit.SECONDS), is(true));

        // 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.
     */
Verify that a remote channel is removed when there is an error with the input stream.
Verify that a remote channel is removed when there is an error with the input stream .
@Test
    public void testRemoveRemoteChannelFromError() throws IOException, InterruptedException
    {
        m_SUT.addRemoteChannel(SRC_ID, m_InputStream, m_ChannelCallback);
        m_InputStream.close();
        assertThat(m_CallbackWaitRemEx.tryAcquire(1, TimeUnit.SECONDS), is(true));
        try
        {
            m_SUT.removeRemoteChannel(SRC_ID);
            fail("removeRemoteChannel should throw IllegalArgumentException");
        }
        catch (IllegalArgumentException e)
        {
        }
    }
@ Test public void testRemoveRemoteChannelFromError ( ) throws IOException , InterruptedException { m_SUT . addRemoteChannel ( SRC_ID , m_InputStream , m_ChannelCallback ) ; m_InputStream . close ( ) ; assertThat ( m_CallbackWaitRemEx . tryAcquire ( 1 , TimeUnit . SECONDS ) , is ( true ) ) ; 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.
Verify that a remote channel is removed when there is an error with the input stream .
// replay // Force channel to throw exception // Wait for onChannelRemoved with exception // Should not be able to remove channel after being removed from error // Expected