@Test
    public void testRead() throws GuacamoleException {
        // Test string containing multiple instructions
        final String test = "3.foo,3.bar;2.az,4.bazz;";

        ReaderGuacamoleReader reader = new ReaderGuacamoleReader(new StringReader(test));

        // Expected character arrays for the instructions
        char[] expectedFirstInstruction = "3.foo,3.bar;".toCharArray();
        char[] expectedSecondInstruction = "2.az,4.bazz;".toCharArray();

        // Read first instruction and verify
        char[] firstInstructionChars = reader.read();
        assertNotNull(firstInstructionChars);
        assertArrayEquals(expectedFirstInstruction, firstInstructionChars);

        // Read second instruction and verify
        char[] secondInstructionChars = reader.read();
        assertNotNull(secondInstructionChars);
        assertArrayEquals(expectedSecondInstruction, secondInstructionChars);

        // Verify that there are no more instructions
        assertNull(reader.read());
    }
Test of ReaderGuacamoleReader's read method.

@throws GuacamoleException If an error occurs while reading the instructions.
guacamole-common/src/test/java/org/apache/guacamole/io/ReaderGuacamoleReaderTest.java