369121 simplified test

This commit is contained in:
Greg Wilkins 2012-01-31 15:35:35 +11:00
parent 8c34d05516
commit 2197854308
1 changed files with 9 additions and 11 deletions

View File

@ -48,7 +48,7 @@ public class IOTest
IO.copyThread(in,out); IO.copyThread(in,out);
Thread.sleep(1500); Thread.sleep(1500);
System.err.println(out); // System.err.println(out);
assertEquals( "copyThread", assertEquals( "copyThread",
out.toString(), out.toString(),
@ -157,7 +157,7 @@ public class IOTest
// Write from server to client with oshut // Write from server to client with oshut
server.getOutputStream().write(1); server.getOutputStream().write(1);
System.err.println("OSHUT "+server); // System.err.println("OSHUT "+server);
server.shutdownOutput(); server.shutdownOutput();
// Client reads response // Client reads response
@ -168,19 +168,19 @@ public class IOTest
// Client reads -1 and does ishut // Client reads -1 and does ishut
assertEquals(-1,client.getInputStream().read()); assertEquals(-1,client.getInputStream().read());
assertFalse(client.isInputShutdown()); assertFalse(client.isInputShutdown());
System.err.println("ISHUT "+client); //System.err.println("ISHUT "+client);
client.shutdownInput(); client.shutdownInput();
// Client ??? // Client ???
System.err.println("OSHUT "+client); //System.err.println("OSHUT "+client);
client.shutdownOutput(); client.shutdownOutput();
System.err.println("CLOSE "+client); //System.err.println("CLOSE "+client);
client.close(); client.close();
// Server reads -1, does ishut and then close // Server reads -1, does ishut and then close
assertEquals(-1,server.getInputStream().read()); assertEquals(-1,server.getInputStream().read());
assertFalse(server.isInputShutdown()); assertFalse(server.isInputShutdown());
System.err.println("ISHUT "+server); //System.err.println("ISHUT "+server);
try try
{ {
@ -188,9 +188,9 @@ public class IOTest
} }
catch(SocketException e) catch(SocketException e)
{ {
System.err.println(e); // System.err.println(e);
} }
System.err.println("CLOSE "+server); //System.err.println("CLOSE "+server);
server.close(); server.close();
} }
@ -222,7 +222,7 @@ public class IOTest
// Write from server to client with oshut // Write from server to client with oshut
server.getOutputStream().write(1); server.getOutputStream().write(1);
System.err.println("OSHUT "+server); //System.err.println("OSHUT "+server);
server.shutdownOutput(); server.shutdownOutput();
try try
@ -255,8 +255,6 @@ public class IOTest
// Client can still write data even though server is closed??? // Client can still write data even though server is closed???
client.getOutputStream().write(1); client.getOutputStream().write(1);
Thread.sleep(100);
client.getOutputStream().write(1);
// Client eventually sees Broken Pipe // Client eventually sees Broken Pipe
int i=0; int i=0;