int oldActive = Thread.activeCount();
TelnetAppender ta = new TelnetAppender();
ta.setName("ta");
ta.setPort(port);
ta.setLayout(new PatternLayout("%p - %m"));
ta.activateOptions();
Logger l = Logger.getLogger("x");
l.addAppender(ta);
Thread t = new ReadThread();
t.start();
Thread.sleep(200);
l.info("hi");
Thread.sleep(1000);
ta.close();
Thread.sleep(200);
t.interrupt();
t.join();
String s = bo.toString();
assertTrue(s.endsWith("INFO - hi"));
assertEquals(oldActive, Thread.activeCount());