Java 类redis.clients.jedis.Connection 实例源码

项目:JRediClients    文件:ConnectionTest.java   
@Test
public void getErrorAfterConnectionReset() throws Exception {
  class TestConnection extends Connection {
    public TestConnection() {
      super("localhost", 6379);
    }

    protected boolean sendCommand(Command cmd, byte[]... args) {
      return super.sendCommand(cmd, args);
    }
  }

  TestConnection conn = new TestConnection();

  try {
    conn.sendCommand(Command.HMSET, new byte[1024 * 1024 + 1][0]);
    fail("Should throw exception");
  } catch (JedisConnectionException jce) {
    assertEquals("ERR Protocol error: invalid multibulk length", jce.getMessage());
  }
}
项目:cachecloud    文件:ConnectionTest.java   
@Test
public void getErrorAfterConnectionReset() throws Exception {
  class TestConnection extends Connection {
    public TestConnection() {
      super("localhost", 6379);
    }

    @Override
    protected Connection sendCommand(ProtocolCommand cmd, byte[]... args) {
      return super.sendCommand(cmd, args);
    }
  }

  TestConnection conn = new TestConnection();

  try {
    conn.sendCommand(Command.HMSET, new byte[1024 * 1024 + 1][0]);
    fail("Should throw exception");
  } catch (JedisConnectionException jce) {
    assertEquals("ERR Protocol error: invalid multibulk length", jce.getMessage());
  }
}
项目:Jedis    文件:ConnectionTest.java   
@Test
public void getErrorAfterConnectionReset() throws Exception {
  class TestConnection extends Connection {
    public TestConnection() {
      super("localhost", 6379);
    }

    @Override
    protected Connection sendCommand(ProtocolCommand cmd, byte[]... args) {
      return super.sendCommand(cmd, args);
    }
  }

  TestConnection conn = new TestConnection();

  try {
    conn.sendCommand(Command.HMSET, new byte[1024 * 1024 + 1][0]);
    fail("Should throw exception");
  } catch (JedisConnectionException jce) {
    assertEquals("ERR Protocol error: invalid multibulk length", jce.getMessage());
  }
}
项目:JRediClients    文件:ConnectionTest.java   
@Before
public void setUp() throws Exception {
  client = new Connection();
}
项目:JRediClients    文件:ConnectionCloseTest.java   
@Before
public void setUp() throws Exception {
  client = new Connection();
}
项目:cachecloud    文件:ConnectionTest.java   
@Before
public void setUp() throws Exception {
  client = new Connection();
}
项目:cachecloud    文件:ConnectionCloseTest.java   
@Before
public void setUp() throws Exception {
  client = new Connection();
}
项目:redis-replicator    文件:MigrationExample.java   
public Connection sendCommand(final Protocol.Command cmd, final byte[]... args) {
    return super.sendCommand(cmd, args);
}
项目:Jedis    文件:ConnectionTest.java   
@Before
public void setUp() throws Exception {
  client = new Connection();
}
项目:Jedis    文件:ConnectionCloseTest.java   
@Before
public void setUp() throws Exception {
  client = new Connection();
}