edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/TestNovatelAsset.java
@Test
    public void testUpdateStartProcException() throws InterruptedException, AssetException, IllegalArgumentException, 
           IllegalStateException, FactoryException
    {       
        //activate the asset so that start processing is called
        m_SUT.onActivate();
        
        doThrow(new AssetException("Asset")).when(m_ConnectionManager).
                startProcessing(DEFAULT_NOVATEL_PHYS_PORT, DEFAULT_NOVATEL_BAUD_RATE);

        m_SUT.updated(createConfigProps());

        //verify no further dep interaction, should be once since the asset was activated
        verify(m_MessageReader, times(1)).startRetreiving(m_SUT);
        
        ArgumentCaptor<ComponentStatus> statusCap = ArgumentCaptor.forClass(ComponentStatus.class);
        //once for activation once for status update
        verify(m_NovatelStatusService, times(4)).getStatus(Mockito.any(Observation.class), statusCap.capture());
        
        //get the message readers component status
        ComponentStatus capStatus = statusCap.getValue();
        assertThat(capStatus.getStatus().getSummary(), is(SummaryStatusEnum.BAD));
    }
/**
     * Test update with start processing asset exception
     */
Test update with start processing asset exception
Test update with start processing asset exception
@Test
    public void testUpdateStartProcException() throws InterruptedException, AssetException, IllegalArgumentException, 
           IllegalStateException, FactoryException
    {       
        m_SUT.onActivate();
        doThrow(new AssetException("Asset")).when(m_ConnectionManager).
                startProcessing(DEFAULT_NOVATEL_PHYS_PORT, DEFAULT_NOVATEL_BAUD_RATE);
        m_SUT.updated(createConfigProps());
        verify(m_MessageReader, times(1)).startRetreiving(m_SUT);
        ArgumentCaptor<ComponentStatus> statusCap = ArgumentCaptor.forClass(ComponentStatus.class);
        verify(m_NovatelStatusService, times(4)).getStatus(Mockito.any(Observation.class), statusCap.capture());
        ComponentStatus capStatus = statusCap.getValue();
        assertThat(capStatus.getStatus().getSummary(), is(SummaryStatusEnum.BAD));
    }
@ Test public void testUpdateStartProcException ( ) throws InterruptedException , AssetException , IllegalArgumentException , IllegalStateException , FactoryException { m_SUT . onActivate ( ) ; doThrow ( new AssetException ( "Asset" ) ) . when ( m_ConnectionManager ) . startProcessing ( DEFAULT_NOVATEL_PHYS_PORT , DEFAULT_NOVATEL_BAUD_RATE ) ; m_SUT . updated ( createConfigProps ( ) ) ; verify ( m_MessageReader , times ( 1 ) ) . startRetreiving ( m_SUT ) ; ArgumentCaptor < ComponentStatus > statusCap = ArgumentCaptor . forClass ( ComponentStatus . class ) ; verify ( m_NovatelStatusService , times ( 4 ) ) . getStatus ( Mockito . any ( Observation . class ) , statusCap . capture ( ) ) ; ComponentStatus capStatus = statusCap . getValue ( ) ; assertThat ( capStatus . getStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . BAD ) ) ; }
Test update with start processing asset exception
Test update with start processing asset exception
//activate the asset so that start processing is called //verify no further dep interaction, should be once since the asset was activated //once for activation once for status update //get the message readers component status