示例#1
0
  @Test
  public void testIOException() {
    InputStream in =
        new InputStream() {

          @Override
          public int read() throws IOException {
            throw new IOException();
          }
        };
    Reader r = new Reader(in, 1024);
    try {
      r.nextReply(null, false);
      Assert.fail("expect io exception");
    } catch (ProtocolIOException e) {
    }
  }
示例#2
0
 private Reply readReply(String s) {
   ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes());
   Reader r = new Reader(in, 1024);
   return r.nextReply(null, false);
 }