public void testNegativeTimeout() throws Exception {
    try {
      client = new MemcachedClient(new DefaultConnectionFactory() {
        @Override
        public long getOperationTimeout() {
          return -1;
        }
      }, AddrUtil.getAddresses(TestConfig.IPV4_ADDR
              +":" + TestConfig.PORT_NUMBER));
      fail("Expected null pointer exception, got " + client);
    } catch (IllegalArgumentException e) {
      assertEquals("Operation timeout must be positive.", e.getMessage());
    }
  }
Test the various memcached client constructors.
src/test/java/net/spy/memcached/MemcachedClientConstructorTest.java