{
public void test (TestHarness harness)
{
CharArrayWriter caw = new CharArrayWriter();
FilterWriter tfw = new MyFilterWriter(caw);
try {
tfw.write('A'); // A
harness.check(true, "write(int)");
char[] ba = {'A', 'B', 'C', 'D'};
tfw.write(ba, 1, 2); // ABC
harness.check(true, "write(buf,off,len)");
tfw.write("CDEF", 1, 3); // ABCDEF
harness.check(caw.toString(), "ABCDEF", "wrote all characters okay");
tfw.flush();
harness.check(true, "flush()");
tfw.close();
harness.check(true, "close()");
}
catch (IOException e) {
harness.debug(e);
harness.fail("IOException unexpected");