tkCtrl.replay();
LoggingRedirector redirector = new LoggingRedirector(task);
redirector.enableLogging(buffer, 1, 2);
ExecuteStreamHandler handler = redirector.createHandler();
handler.setProcessOutputStream(new ByteArrayInputStream("\nfoo\n\nbar\n".getBytes()));
handler.setProcessErrorStream(new ByteArrayInputStream("\nspam\n\neggs\n".getBytes()));
ByteArrayOutputStream os = new ByteArrayOutputStream();
handler.setProcessInputStream(os);
assertEquals("Wrong log", "", buffer.toString(1));
assertEquals("Wrong log", "", buffer.toString(2));
assertEquals("Wrong log", "", os.toString());
handler.start();
handler.stop();
assertEquals("Wrong log", "foo\nbar", buffer.toString(1));
assertEquals("Wrong log", "spam\neggs", buffer.toString(2));
assertEquals("Wrong log", "", os.toString());