edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/timechanger/TestTimeChangeImpl.java
@Test
    public void testDisconnectIOException() throws IOException, InterruptedException
    {
        doThrow(IOException.class).when(m_ClientSocket).close();
        
        try
        {
            m_SUT.connectTimeService(m_StatusHandler, PORT);
            Thread.sleep(1000);
            m_SUT.disconnectTimeService();
            fail("Expected io exception");
        }
        catch (IOException exception)
        {
            //exception is expected.
        }
    }
/**
     * Verify proper exceptions are thrown when trying to disconnect.
     */
Verify proper exceptions are thrown when trying to disconnect.
Verify proper exceptions are thrown when trying to disconnect .
@Test
    public void testDisconnectIOException() throws IOException, InterruptedException
    {
        doThrow(IOException.class).when(m_ClientSocket).close();
        try
        {
            m_SUT.connectTimeService(m_StatusHandler, PORT);
            Thread.sleep(1000);
            m_SUT.disconnectTimeService();
            fail("Expected io exception");
        }
        catch (IOException exception)
        {
        }
    }
@ Test public void testDisconnectIOException ( ) throws IOException , InterruptedException { doThrow ( IOException . class ) . when ( m_ClientSocket ) . close ( ) ; try { m_SUT . connectTimeService ( m_StatusHandler , PORT ) ; Thread . sleep ( 1000 ) ; m_SUT . disconnectTimeService ( ) ; fail ( "Expected io exception" ) ; } catch ( IOException exception ) { } }
Verify proper exceptions are thrown when trying to disconnect.
Verify proper exceptions are thrown when trying to disconnect .
//exception is expected.