// Validate the line count. Expects a newline also at end of last line.
assertEquals("Actual line count does not match the specified count",
this.lineCount, this.commandSequence.length() -
this.commandSequence.replaceAll("\n", "").length() -1);
adapter = new ProtocolTestAdapter(createSocket());
Reader cmdStream = new StringReader(this.commandSequence);
try {
processCommands(cmdStream);
} finally {
try {