179180181182183184185186187188189
public void testObjectOutputStreamPropagatesCloseAndFlushEvents() throws IOException { // setup final CallLog log = new CallLog(); Writer loggingWriter = new Writer() { public void close() { log.actual("close"); } public void flush() { log.actual("flush"); }
183184185186187188189190191192193
public void close() { log.actual("close"); } public void flush() { log.actual("flush"); } public void write(char cbuf[], int off, int len) { // don't care about this }
211212213214215216217218219220221
public void testObjectInputStreamPropegatesCloseEvent() throws IOException { // setup final CallLog log = new CallLog(); Reader loggingReader = new StringReader("<int>1</int>") { public void close() { log.actual("close"); } }; // expectations log.expect("close");