edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/connection/TestNovatelConnectionMgrImpl.java
@SuppressWarnings("unchecked")
    @Test
    public void testStartProcessingFailGetInputStream() throws IllegalArgumentException, CCommException, 
        PhysicalLinkException
    {
        when(m_CustomCommService.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, m_PhysPort)).
            thenReturn(m_UUID);
        when(m_CustomCommService.requestPhysicalLink(m_UUID)).thenReturn(m_SerialPort);
        when(m_SerialPort.getName()).thenReturn(m_PhysPort);
        when(m_SerialPort.getInputStream()).thenThrow(PhysicalLinkException.class);
        
        try
        {
            m_SUT.startProcessing(m_PhysPort, m_BaudRate);
            fail("Read thread should throw a physical link exception that will be caught and throw as an asset " 
                + "exception.");
        }
        catch (final AssetException exception)
        {
            //expected exception
        }
        verify(m_SerialPort).close();
        verify(m_SerialPort).release();
    }
/**
     * Verify that the start processing method throws an asset exception if input stream cannot be retrieved from the
     * serial port.
     */
Verify that the start processing method throws an asset exception if input stream cannot be retrieved from the
serial port.
Verify that the start processing method throws an asset exception if input stream cannot be retrieved from the serial port .
@SuppressWarnings("unchecked")
    @Test
    public void testStartProcessingFailGetInputStream() throws IllegalArgumentException, CCommException, 
        PhysicalLinkException
    {
        when(m_CustomCommService.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, m_PhysPort)).
            thenReturn(m_UUID);
        when(m_CustomCommService.requestPhysicalLink(m_UUID)).thenReturn(m_SerialPort);
        when(m_SerialPort.getName()).thenReturn(m_PhysPort);
        when(m_SerialPort.getInputStream()).thenThrow(PhysicalLinkException.class);
        try
        {
            m_SUT.startProcessing(m_PhysPort, m_BaudRate);
            fail("Read thread should throw a physical link exception that will be caught and throw as an asset " 
                + "exception.");
        }
        catch (final AssetException exception)
        {
        }
        verify(m_SerialPort).close();
        verify(m_SerialPort).release();
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testStartProcessingFailGetInputStream ( ) throws IllegalArgumentException , CCommException , PhysicalLinkException { when ( m_CustomCommService . tryCreatePhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , m_PhysPort ) ) . thenReturn ( m_UUID ) ; when ( m_CustomCommService . requestPhysicalLink ( m_UUID ) ) . thenReturn ( m_SerialPort ) ; when ( m_SerialPort . getName ( ) ) . thenReturn ( m_PhysPort ) ; when ( m_SerialPort . getInputStream ( ) ) . thenThrow ( PhysicalLinkException . class ) ; try { m_SUT . startProcessing ( m_PhysPort , m_BaudRate ) ; fail ( "Read thread should throw a physical link exception that will be caught and throw as an asset " + "exception." ) ; } catch ( final AssetException exception ) { } verify ( m_SerialPort ) . close ( ) ; verify ( m_SerialPort ) . release ( ) ; }
Verify that the start processing method throws an asset exception if input stream cannot be retrieved from the
 serial port.
Verify that the start processing method throws an asset exception if input stream cannot be retrieved from the serial port .
//expected exception