}
}
public void testClosedCondition() throws Exception {
HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup();
HttpDataOutputStream outstream = new HttpDataOutputStream(transmitter);
outstream.close();
outstream.close();
try {
byte[] tmp = new byte[2];
outstream.write(tmp, 0, tmp.length);
fail("IllegalStateException should have been thrown");
} catch (IllegalStateException e) {
//expected
}
try {
outstream.write('a');
fail("IllegalStateException should have been thrown");
} catch (IllegalStateException e) {
//expected
}
try {
outstream.flush();
fail("IllegalStateException should have been thrown");
} catch (IllegalStateException e) {
//expected
}
}