edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/TestNovatelAsset.java
@Test
    public void testOnDeactivateWithExceptions() throws AssetException, 
        IllegalStateException, IOException, InterruptedException
    {
        
        doThrow(new IllegalStateException("badstate")).when(m_ConnectionManager).stopProcessing();
        doThrow(new IllegalStateException("badstate")).when(m_MessageReader).stopRetrieving();
        doThrow(new IllegalStateException("badstate")).when(m_TimeChangeService).disconnectTimeService();
        
        m_SUT.onActivate();
        m_SUT.onDeactivate();
        
        //verify dep interaction still happened
        verify(m_ConnectionManager).stopProcessing();
        verify(m_MessageReader).stopRetrieving();
        verify(m_TimeChangeService).disconnectTimeService();
    }
/**
     * Verify that the asset can be deactivated even if processing mechanisms fail due to them never being started.
     */
Verify that the asset can be deactivated even if processing mechanisms fail due to them never being started.
Verify that the asset can be deactivated even if processing mechanisms fail due to them never being started .
@Test
    public void testOnDeactivateWithExceptions() throws AssetException, 
        IllegalStateException, IOException, InterruptedException
    {
        doThrow(new IllegalStateException("badstate")).when(m_ConnectionManager).stopProcessing();
        doThrow(new IllegalStateException("badstate")).when(m_MessageReader).stopRetrieving();
        doThrow(new IllegalStateException("badstate")).when(m_TimeChangeService).disconnectTimeService();
        m_SUT.onActivate();
        m_SUT.onDeactivate();
        verify(m_ConnectionManager).stopProcessing();
        verify(m_MessageReader).stopRetrieving();
        verify(m_TimeChangeService).disconnectTimeService();
    }
@ Test public void testOnDeactivateWithExceptions ( ) throws AssetException , IllegalStateException , IOException , InterruptedException { doThrow ( new IllegalStateException ( "badstate" ) ) . when ( m_ConnectionManager ) . stopProcessing ( ) ; doThrow ( new IllegalStateException ( "badstate" ) ) . when ( m_MessageReader ) . stopRetrieving ( ) ; doThrow ( new IllegalStateException ( "badstate" ) ) . when ( m_TimeChangeService ) . disconnectTimeService ( ) ; m_SUT . onActivate ( ) ; m_SUT . onDeactivate ( ) ; verify ( m_ConnectionManager ) . stopProcessing ( ) ; verify ( m_MessageReader ) . stopRetrieving ( ) ; verify ( m_TimeChangeService ) . disconnectTimeService ( ) ; }
Verify that the asset can be deactivated even if processing mechanisms fail due to them never being started.
Verify that the asset can be deactivated even if processing mechanisms fail due to them never being started .
//verify dep interaction still happened