mil.dod.th.ose.linux.serial/test/mil/dod/th/ose/linux/physical/TestSerialPortOutputStream.java
@Test
    public void testWriteBuffer() throws IOException, FactoryException
    {
        // mock to write out 5 bytes at a time
        when(FileOperations.writeBuffer(anyInt(), Mockito.any(byte[].class), anyInt(), anyInt())).thenReturn(5);

        byte[] buffer = new byte[10];
        m_SUT.write(buffer, 5, 20);
        
        PowerMockito.verifyStatic(); // should take 4 writeBuffer calls, 5 bytes each
        FileOperations.writeBuffer(10, buffer, 5, 20);
        FileOperations.writeBuffer(10, buffer, 10, 15);
        FileOperations.writeBuffer(10, buffer, 15, 10);
        FileOperations.writeBuffer(10, buffer, 20, 5);
    }
/**
     * Verify write calls on {@link FileOperations} properly.
     */
Verify write calls on  FileOperations properly.
Verify write calls on FileOperations properly .
@Test
    public void testWriteBuffer() throws IOException, FactoryException
    {
        when(FileOperations.writeBuffer(anyInt(), Mockito.any(byte[].class), anyInt(), anyInt())).thenReturn(5);
        byte[] buffer = new byte[10];
        m_SUT.write(buffer, 5, 20);
        PowerMockito.verifyStatic(); 
        FileOperations.writeBuffer(10, buffer, 5, 20);
        FileOperations.writeBuffer(10, buffer, 10, 15);
        FileOperations.writeBuffer(10, buffer, 15, 10);
        FileOperations.writeBuffer(10, buffer, 20, 5);
    }
@ Test public void testWriteBuffer ( ) throws IOException , FactoryException { when ( FileOperations . writeBuffer ( anyInt ( ) , Mockito . any ( byte [ ] . class ) , anyInt ( ) , anyInt ( ) ) ) . thenReturn ( 5 ) ; byte [ ] buffer = new byte [ 10 ] ; m_SUT . write ( buffer , 5 , 20 ) ; PowerMockito . verifyStatic ( ) ; FileOperations . writeBuffer ( 10 , buffer , 5 , 20 ) ; FileOperations . writeBuffer ( 10 , buffer , 10 , 15 ) ; FileOperations . writeBuffer ( 10 , buffer , 15 , 10 ) ; FileOperations . writeBuffer ( 10 , buffer , 20 , 5 ) ; }
Verify write calls on {@link FileOperations} properly.
Verify write calls on { @link FileOperations } properly .
// mock to write out 5 bytes at a time // should take 4 writeBuffer calls, 5 bytes each