// Test string
final String test = "1.a,2.bc,3.def,10.helloworld;4.test,5.test2;0.;3.foo;";
GuacamoleReader reader = new ReaderGuacamoleReader(new StringReader(test));
GuacamoleInstruction instruction;
// Validate first test instruction
instruction = reader.readInstruction();
assertNotNull(instruction);
assertEquals(3, instruction.getArgs().size());
assertEquals("a", instruction.getOpcode());
assertEquals("bc", instruction.getArgs().get(0));
assertEquals("def", instruction.getArgs().get(1));
assertEquals("helloworld", instruction.getArgs().get(2));
// Validate second test instruction
instruction = reader.readInstruction();
assertNotNull(instruction);
assertEquals(1, instruction.getArgs().size());
assertEquals("test", instruction.getOpcode());
assertEquals("test2", instruction.getArgs().get(0));
// Validate third test instruction
instruction = reader.readInstruction();
assertNotNull(instruction);
assertEquals(0, instruction.getArgs().size());
assertEquals("", instruction.getOpcode());
// Validate fourth test instruction
instruction = reader.readInstruction();
assertNotNull(instruction);
assertEquals(0, instruction.getArgs().size());
assertEquals("foo", instruction.getOpcode());
// There should be no more instructions
instruction = reader.readInstruction();
assertNull(instruction);