Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.ping()


  Jedis[] jedises = pool.getResource().getAllShards()
    .toArray(new Jedis[2]);

  Jedis jedis = jedises[0];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));

  jedis = jedises[1];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
View Full Code Here


  Jedis jedis = jedises[0];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));

  jedis = jedises[1];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void startWithUrl() throws URISyntaxException {
View Full Code Here

  Jedis[] jedises = pool.getResource().getAllShards()
    .toArray(new Jedis[2]);

  Jedis jedis = jedises[0];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));

  jedis = jedises[1];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
View Full Code Here

  Jedis jedis = jedises[0];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));

  jedis = jedises[1];
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void returnResourceShouldResetState() throws URISyntaxException {
View Full Code Here

  j.auth("foobared");
  j.select(2);
  j.set("foo", "bar");
  JedisPool pool = new JedisPool("redis://:foobared@localhost:6380/2");
  Jedis jedis = pool.getResource();
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void startWithUrl() throws URISyntaxException {
View Full Code Here

  j.select(2);
  j.set("foo", "bar");
  JedisPool pool = new JedisPool(new URI(
    "redis://:foobared@localhost:6380/2"));
  Jedis jedis = pool.getResource();
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void allowUrlWithNoDBAndNoPassword() throws URISyntaxException {
View Full Code Here

      throws InterruptedException {
  HostAndPort oldMaster = pool.getCurrentHostMaster();

  // jedis connection should be master
  Jedis beforeFailoverJedis = pool.getResource();
  assertEquals("PONG", beforeFailoverJedis.ping());

  waitForFailover(pool, oldMaster);

  Jedis afterFailoverJedis = pool.getResource();
  assertEquals("PONG", afterFailoverJedis.ping());
View Full Code Here

  assertEquals("PONG", beforeFailoverJedis.ping());

  waitForFailover(pool, oldMaster);

  Jedis afterFailoverJedis = pool.getResource();
  assertEquals("PONG", afterFailoverJedis.ping());
  assertEquals("foobared", afterFailoverJedis.configGet("requirepass")
    .get(1));
  assertEquals(2, afterFailoverJedis.getDB().intValue());

  // returning both connections to the pool should not throw
View Full Code Here

  Jedis j = new Jedis("localhost", 6380);
  j.auth("foobared");
  j.select(2);
  j.set("foo", "bar");
  Jedis jedis = new Jedis("redis://:foobared@localhost:6380/2");
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void startWithUrl() throws URISyntaxException {
View Full Code Here

  Jedis j = new Jedis("localhost", 6380);
  j.auth("foobared");
  j.select(2);
  j.set("foo", "bar");
  Jedis jedis = new Jedis(new URI("redis://:foobared@localhost:6380/2"));
  assertEquals("PONG", jedis.ping());
  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void allowUrlWithNoDBAndNoPassword() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.