use of redis.clients.jedis.BinaryJedis in project cachecloud by sohutv.
the class ScriptingCommandsTest method evalMultiBulkWithBinaryJedis.
@SuppressWarnings("unchecked")
@Test
public void evalMultiBulkWithBinaryJedis() {
String script = "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2],ARGV[3]}";
List<byte[]> keys = new ArrayList<byte[]>();
keys.add("key1".getBytes());
keys.add("key2".getBytes());
List<byte[]> args = new ArrayList<byte[]>();
args.add("first".getBytes());
args.add("second".getBytes());
args.add("third".getBytes());
BinaryJedis binaryJedis = new BinaryJedis(hnp.getHost(), hnp.getPort(), 500);
binaryJedis.connect();
binaryJedis.auth("foobared");
List<byte[]> responses = (List<byte[]>) binaryJedis.eval(script.getBytes(), keys, args);
assertEquals(5, responses.size());
assertEquals("key1", new String(responses.get(0)));
assertEquals("key2", new String(responses.get(1)));
assertEquals("first", new String(responses.get(2)));
assertEquals("second", new String(responses.get(3)));
assertEquals("third", new String(responses.get(4)));
binaryJedis.close();
}
use of redis.clients.jedis.BinaryJedis in project cachecloud by sohutv.
the class JedisTest method checkCloseable.
@Test
public void checkCloseable() {
jedis.close();
BinaryJedis bj = new BinaryJedis("localhost");
bj.connect();
bj.close();
}
use of redis.clients.jedis.BinaryJedis in project cachecloud by sohutv.
the class ConnectionHandlingCommandsTest method binary_quit.
@Test
public void binary_quit() {
BinaryJedis bj = new BinaryJedis(hnp.getHost());
assertEquals("OK", bj.quit());
}
use of redis.clients.jedis.BinaryJedis in project jedis by xetorthio.
the class ConnectionHandlingCommandsTest method binary_quit.
@Test
public void binary_quit() {
BinaryJedis bj = new BinaryJedis(hnp.getHost());
assertEquals("OK", bj.quit());
}
use of redis.clients.jedis.BinaryJedis in project jedis by xetorthio.
the class ScriptingCommandsTest method evalMultiBulkWithBinaryJedis.
@SuppressWarnings("unchecked")
@Test
public void evalMultiBulkWithBinaryJedis() {
String script = "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2],ARGV[3]}";
List<byte[]> keys = new ArrayList<byte[]>();
keys.add("key1".getBytes());
keys.add("key2".getBytes());
List<byte[]> args = new ArrayList<byte[]>();
args.add("first".getBytes());
args.add("second".getBytes());
args.add("third".getBytes());
BinaryJedis binaryJedis = new BinaryJedis(hnp.getHost(), hnp.getPort(), 500);
binaryJedis.connect();
binaryJedis.auth("foobared");
List<byte[]> responses = (List<byte[]>) binaryJedis.eval(script.getBytes(), keys, args);
assertEquals(5, responses.size());
assertEquals("key1", new String(responses.get(0)));
assertEquals("key2", new String(responses.get(1)));
assertEquals("first", new String(responses.get(2)));
assertEquals("second", new String(responses.get(3)));
assertEquals("third", new String(responses.get(4)));
binaryJedis.close();
}
Aggregations