edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/connection/TestNovatelConnectionMgrImpl.java
@Test
    public void testStopProcessing() throws IllegalArgumentException, CCommException, PhysicalLinkException, 
        AssetException
    {
        when(m_CustomCommService.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, m_PhysPort)).
            thenReturn(m_UUID);
        when(m_CustomCommService.requestPhysicalLink(m_UUID)).thenReturn(m_SerialPort);
        when(m_SerialPort.getInputStream()).thenReturn(mock(InputStream.class));
        when(m_SerialPort.getName()).thenReturn(m_PhysPort);
        
        //need to call start processing to set up serial port and read thread
        m_SUT.startProcessing(m_PhysPort, m_BaudRate);
        when(m_SerialPort.isOpen()).thenReturn(true);
        
        m_SUT.stopProcessing();
        
        verify(m_SerialPort).close();
        verify(m_SerialPort).release();
    }
/**
     * Verify that the stop processing method calls appropriate methods to close and release the serial port.
     */
Verify that the stop processing method calls appropriate methods to close and release the serial port.
Verify that the stop processing method calls appropriate methods to close and release the serial port .
@Test
    public void testStopProcessing() throws IllegalArgumentException, CCommException, PhysicalLinkException, 
        AssetException
    {
        when(m_CustomCommService.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, m_PhysPort)).
            thenReturn(m_UUID);
        when(m_CustomCommService.requestPhysicalLink(m_UUID)).thenReturn(m_SerialPort);
        when(m_SerialPort.getInputStream()).thenReturn(mock(InputStream.class));
        when(m_SerialPort.getName()).thenReturn(m_PhysPort);
        m_SUT.startProcessing(m_PhysPort, m_BaudRate);
        when(m_SerialPort.isOpen()).thenReturn(true);
        m_SUT.stopProcessing();
        verify(m_SerialPort).close();
        verify(m_SerialPort).release();
    }
@ Test public void testStopProcessing ( ) throws IllegalArgumentException , CCommException , PhysicalLinkException , AssetException { when ( m_CustomCommService . tryCreatePhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , m_PhysPort ) ) . thenReturn ( m_UUID ) ; when ( m_CustomCommService . requestPhysicalLink ( m_UUID ) ) . thenReturn ( m_SerialPort ) ; when ( m_SerialPort . getInputStream ( ) ) . thenReturn ( mock ( InputStream . class ) ) ; when ( m_SerialPort . getName ( ) ) . thenReturn ( m_PhysPort ) ; m_SUT . startProcessing ( m_PhysPort , m_BaudRate ) ; when ( m_SerialPort . isOpen ( ) ) . thenReturn ( true ) ; m_SUT . stopProcessing ( ) ; verify ( m_SerialPort ) . close ( ) ; verify ( m_SerialPort ) . release ( ) ; }
Verify that the stop processing method calls appropriate methods to close and release the serial port.
Verify that the stop processing method calls appropriate methods to close and release the serial port .
//need to call start processing to set up serial port and read thread