mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/physical/TestSerialPortImpl.java
@Test
    public final void testSetSerialPortProperties() 
        throws PhysicalLinkException, IOException, InterruptedException, IllegalArgumentException, 
            IllegalStateException, ConfigurationException, FactoryException
    {
        m_SUT.setSerialPortProperties(57600, 8, ParityEnum.NONE, StopBitsEnum.ONE_STOP_BIT, FlowControlEnum.NONE);
        
        //verify
        assertThat(m_SUT.getConfig().baudRate(), is(57600));
        assertThat(m_SUT.getConfig().dataBits(), is(8));
        assertThat(m_SUT.getConfig().parity(), is(ParityEnum.NONE));
        assertThat(m_SUT.getConfig().stopBits(), is(StopBitsEnum.ONE_STOP_BIT));
        assertThat(m_SUT.getConfig().flowControl(), is(FlowControlEnum.NONE));
        
        //replay
        m_SUT.setSerialPortProperties(9600, 7, ParityEnum.EVEN, StopBitsEnum.TWO_STOP_BITS, 
                FlowControlEnum.XON_XOFF);
        
        //verify
        assertThat(m_SUT.getConfig().baudRate(), is(9600));
        assertThat(m_SUT.getConfig().dataBits(), is(7));
        assertThat(m_SUT.getConfig().parity(), is(ParityEnum.EVEN));
        assertThat(m_SUT.getConfig().stopBits(), is(StopBitsEnum.TWO_STOP_BITS));
        assertThat(m_SUT.getConfig().flowControl(), is(FlowControlEnum.XON_XOFF));
    }
/**
     * Verify that a serial port's properties can be set and retrieved.
     */
Verify that a serial port's properties can be set and retrieved.
Verify that a serial port ' s properties can be set and retrieved .
@Test
    public final void testSetSerialPortProperties() 
        throws PhysicalLinkException, IOException, InterruptedException, IllegalArgumentException, 
            IllegalStateException, ConfigurationException, FactoryException
    {
        m_SUT.setSerialPortProperties(57600, 8, ParityEnum.NONE, StopBitsEnum.ONE_STOP_BIT, FlowControlEnum.NONE);
        assertThat(m_SUT.getConfig().baudRate(), is(57600));
        assertThat(m_SUT.getConfig().dataBits(), is(8));
        assertThat(m_SUT.getConfig().parity(), is(ParityEnum.NONE));
        assertThat(m_SUT.getConfig().stopBits(), is(StopBitsEnum.ONE_STOP_BIT));
        assertThat(m_SUT.getConfig().flowControl(), is(FlowControlEnum.NONE));
        m_SUT.setSerialPortProperties(9600, 7, ParityEnum.EVEN, StopBitsEnum.TWO_STOP_BITS, 
                FlowControlEnum.XON_XOFF);
        assertThat(m_SUT.getConfig().baudRate(), is(9600));
        assertThat(m_SUT.getConfig().dataBits(), is(7));
        assertThat(m_SUT.getConfig().parity(), is(ParityEnum.EVEN));
        assertThat(m_SUT.getConfig().stopBits(), is(StopBitsEnum.TWO_STOP_BITS));
        assertThat(m_SUT.getConfig().flowControl(), is(FlowControlEnum.XON_XOFF));
    }
@ Test public final void testSetSerialPortProperties ( ) throws PhysicalLinkException , IOException , InterruptedException , IllegalArgumentException , IllegalStateException , ConfigurationException , FactoryException { m_SUT . setSerialPortProperties ( 57600 , 8 , ParityEnum . NONE , StopBitsEnum . ONE_STOP_BIT , FlowControlEnum . NONE ) ; assertThat ( m_SUT . getConfig ( ) . baudRate ( ) , is ( 57600 ) ) ; assertThat ( m_SUT . getConfig ( ) . dataBits ( ) , is ( 8 ) ) ; assertThat ( m_SUT . getConfig ( ) . parity ( ) , is ( ParityEnum . NONE ) ) ; assertThat ( m_SUT . getConfig ( ) . stopBits ( ) , is ( StopBitsEnum . ONE_STOP_BIT ) ) ; assertThat ( m_SUT . getConfig ( ) . flowControl ( ) , is ( FlowControlEnum . NONE ) ) ; m_SUT . setSerialPortProperties ( 9600 , 7 , ParityEnum . EVEN , StopBitsEnum . TWO_STOP_BITS , FlowControlEnum . XON_XOFF ) ; assertThat ( m_SUT . getConfig ( ) . baudRate ( ) , is ( 9600 ) ) ; assertThat ( m_SUT . getConfig ( ) . dataBits ( ) , is ( 7 ) ) ; assertThat ( m_SUT . getConfig ( ) . parity ( ) , is ( ParityEnum . EVEN ) ) ; assertThat ( m_SUT . getConfig ( ) . stopBits ( ) , is ( StopBitsEnum . TWO_STOP_BITS ) ) ; assertThat ( m_SUT . getConfig ( ) . flowControl ( ) , is ( FlowControlEnum . XON_XOFF ) ) ; }
Verify that a serial port's properties can be set and retrieved.
Verify that a serial port ' s properties can be set and retrieved .
//verify //replay //verify