edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/connection/TestNovatelConnectionMgrImpl.java
@Test
    public void testIsProcessing() throws IllegalArgumentException, CCommException, AssetException, 
        PhysicalLinkException
    {
        //Not activated therefore should return false.
        assertThat(m_SUT.isProcessing(), is(false));
        
        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.isOpen()).thenReturn(false);
        m_SUT.startProcessing(m_PhysPort, m_BaudRate);
        
        //Activated but serial is not open therefore should return false.
        assertThat(m_SUT.isProcessing(), is(false));
        
        when(m_SerialPort.isOpen()).thenReturn(true);
        
        //Activated but serial is open therefore should return true.
        assertThat(m_SUT.isProcessing(), is(true));
    }
/**
     * Test the is processing method.
     * Verify the correct boolean value is returned for the various states.
     */
Test the is processing method.
Verify the correct boolean value is returned for the various states.
Test the is processing method . Verify the correct boolean value is returned for the various states .
@Test
    public void testIsProcessing() throws IllegalArgumentException, CCommException, AssetException, 
        PhysicalLinkException
    {
        assertThat(m_SUT.isProcessing(), is(false));
        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.isOpen()).thenReturn(false);
        m_SUT.startProcessing(m_PhysPort, m_BaudRate);
        assertThat(m_SUT.isProcessing(), is(false));
        when(m_SerialPort.isOpen()).thenReturn(true);
        assertThat(m_SUT.isProcessing(), is(true));
    }
@ Test public void testIsProcessing ( ) throws IllegalArgumentException , CCommException , AssetException , PhysicalLinkException { assertThat ( m_SUT . isProcessing ( ) , is ( false ) ) ; 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 . isOpen ( ) ) . thenReturn ( false ) ; m_SUT . startProcessing ( m_PhysPort , m_BaudRate ) ; assertThat ( m_SUT . isProcessing ( ) , is ( false ) ) ; when ( m_SerialPort . isOpen ( ) ) . thenReturn ( true ) ; assertThat ( m_SUT . isProcessing ( ) , is ( true ) ) ; }
Test the is processing method.
Test the is processing method .
//Not activated therefore should return false. //Activated but serial is not open therefore should return false. //Activated but serial is open therefore should return true.