public void testTimeoutDontwrite() {
    Operation op = new ExtensibleOperationImpl(new OperationCallback() {
      public void complete() {
        System.err.println("Complete.");
      }

      public void receivedStatus(OperationStatus s) {
        System.err.println("Received a line.");
      }
    }) {

      @Override
      public void handleLine(String line) {
        System.out.println("Woo! A line!");
      }

      @Override
      public void initialize() {
        setBuffer(ByteBuffer.wrap("garbage\r\n".getBytes()));
      }

    };
    try {
      Thread.sleep(1100);
    } catch (InterruptedException ex) {
      System.err.println("Interrupted when sleeping for timeout nowrite");
    }

    client.mconn.enqueueOperation("x", op);
    System.err.println("Operation attempted:");
    System.err.println(op);
    System.err.println("Trying to get:");
    try {
      client.get("x");
      String retValString = new String();
      System.err.println(retValString);
    } catch (net.spy.memcached.OperationTimeoutException ex) {
      System.err.println("Timed out successfully: " + ex.getMessage());
    }

    System.err.println("Op timed out is " + op.isTimedOut());
    assert op.isTimedOut();
  }
@author Matt Ingenthron <ingenthr@cep.net>
src/test/java/net/spy/memcached/TimeoutNowriteTest.java