Package org.apache.tomcat.dbcp.pool2.impl

Examples of org.apache.tomcat.dbcp.pool2.impl.GenericObjectPoolConfig


  shards.add(new JedisShardInfo(new URI(
    "redis://:foobared@localhost:6380")));
  shards.add(new JedisShardInfo(new URI(
    "redis://:foobared@localhost:6379")));

  GenericObjectPoolConfig redisConfig = new GenericObjectPoolConfig();
  ShardedJedisPool pool = new ShardedJedisPool(redisConfig, shards);

  Jedis[] jedises = pool.getResource().getAllShards()
    .toArray(new Jedis[2]);
View Full Code Here


  assertEquals("bar", jedis.get("foo"));
    }

    @Test
    public void returnResourceShouldResetState() throws URISyntaxException {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);

  List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
  shards.add(new JedisShardInfo(new URI(
    "redis://:foobared@localhost:6380")));
  shards.add(new JedisShardInfo(new URI(
View Full Code Here

  pool.destroy();
    }

    @Test
    public void checkResourceIsCloseable() throws URISyntaxException {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);

  List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
  shards.add(new JedisShardInfo(new URI(
    "redis://:foobared@localhost:6380")));
  shards.add(new JedisShardInfo(new URI(
View Full Code Here

  this(masterName, sentinels, poolConfig, Protocol.DEFAULT_TIMEOUT, null,
    Protocol.DEFAULT_DATABASE);
    }

    public JedisSentinelPool(String masterName, Set<String> sentinels) {
  this(masterName, sentinels, new GenericObjectPoolConfig(),
    Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE);
    }
View Full Code Here

    Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE);
    }

    public JedisSentinelPool(String masterName, Set<String> sentinels,
      String password) {
  this(masterName, sentinels, new GenericObjectPoolConfig(),
    Protocol.DEFAULT_TIMEOUT, password);
    }
View Full Code Here

  assertTrue(pool.isClosed());
    }

    @Test(expected = JedisConnectionException.class)
    public void checkPoolOverflow() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);
  JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort());
  Jedis jedis = pool.getResource();
  jedis.auth("foobared");
  jedis.set("foo", "0");
View Full Code Here

  assertTrue(pool0.isClosed());
    }

    @Test
    public void returnResourceShouldResetState() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);
  JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort(),
    2000, "foobared");

  Jedis jedis = pool.getResource();
  try {
View Full Code Here

  assertTrue(pool.isClosed());
    }

    @Test
    public void checkResourceIsCloseable() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);
  JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort(),
    2000, "foobared");

  Jedis jedis = pool.getResource();
  try {
View Full Code Here

    public JedisCluster(Set<HostAndPort> nodes) {
  this(nodes, DEFAULT_TIMEOUT);
    }

    public JedisCluster(Set<HostAndPort> nodes, int timeout, int maxRedirections) {
  this(nodes, timeout, maxRedirections, new GenericObjectPoolConfig());
    }
View Full Code Here

  assertEquals("foo", jc.get("51"));
    }

    @Test(expected = JedisConnectionException.class)
    public void testIfPoolConfigAppliesToClusterPools() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(0);
  config.setMaxWaitMillis(2000);
  Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
  jedisClusterNode.add(new HostAndPort("127.0.0.1", 7379));
  JedisCluster jc = new JedisCluster(jedisClusterNode, config);
  jc.set("52", "poolTestValue");
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.dbcp.pool2.impl.GenericObjectPoolConfig

Copyright © 2018 www.massapicom. 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.