Examples of auth()


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

public class JedisTest extends JedisCommandTestBase {
    @Test
    public void useWithoutConnecting() {
  Jedis jedis = new Jedis("localhost");
  jedis.auth("foobared");
  jedis.dbSize();
    }

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

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

    }

    @Test
    public void startWithUrlString() {
  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"));
View Full Code Here

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

    }

    @Test
    public void startWithUrl() throws URISyntaxException {
  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"));
View Full Code Here

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

    }

    @Test
    public void allowUrlWithNoDBAndNoPassword() {
  Jedis jedis = new Jedis("redis://localhost:6380");
  jedis.auth("foobared");
  assertEquals(jedis.getClient().getHost(), "localhost");
  assertEquals(jedis.getClient().getPort(), 6380);
  assertEquals(jedis.getDB(), (Long) 0L);

  jedis = new Jedis("redis://localhost:6380/");
View Full Code Here

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

  assertEquals(jedis.getClient().getHost(), "localhost");
  assertEquals(jedis.getClient().getPort(), 6380);
  assertEquals(jedis.getDB(), (Long) 0L);

  jedis = new Jedis("redis://localhost:6380/");
  jedis.auth("foobared");
  assertEquals(jedis.getClient().getHost(), "localhost");
  assertEquals(jedis.getClient().getPort(), 6380);
  assertEquals(jedis.getDB(), (Long) 0L);
    }
View Full Code Here

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

    private static final int TOTAL_OPERATIONS = 100000;

    public static void main(String[] args) throws Exception {
  Jedis j = new Jedis(hnp.getHost(), hnp.getPort());
  j.connect();
  j.auth("foobared");
  j.flushAll();
  j.quit();
  j.disconnect();
  long t = System.currentTimeMillis();
  // withoutPool();
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.