-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test JedisURIHelper#getClientSideCache(URI) (#3835)
- Loading branch information
Showing
6 changed files
with
138 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/test/java/redis/clients/jedis/csc/ClientSideCacheTestBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package redis.clients.jedis.csc; | ||
|
||
import java.util.function.Supplier; | ||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
|
||
import redis.clients.jedis.Connection; | ||
import redis.clients.jedis.ConnectionPoolConfig; | ||
import redis.clients.jedis.DefaultJedisClientConfig; | ||
import redis.clients.jedis.HostAndPort; | ||
import redis.clients.jedis.HostAndPorts; | ||
import redis.clients.jedis.Jedis; | ||
import redis.clients.jedis.JedisClientConfig; | ||
|
||
abstract class ClientSideCacheTestBase { | ||
|
||
protected static final HostAndPort hnp = HostAndPorts.getRedisServers().get(1); | ||
|
||
protected static final String baseUrl = "redis://:foobared@" + hnp.toString() + "/"; | ||
|
||
protected Jedis control; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
control = new Jedis(hnp, DefaultJedisClientConfig.builder().password("foobared").build()); | ||
control.flushAll(); | ||
} | ||
|
||
@After | ||
public void tearDown() throws Exception { | ||
control.close(); | ||
} | ||
|
||
protected static final Supplier<JedisClientConfig> clientConfig | ||
= () -> DefaultJedisClientConfig.builder().resp3().password("foobared").build(); | ||
|
||
protected static final Supplier<GenericObjectPoolConfig<Connection>> singleConnectionPoolConfig | ||
= () -> { | ||
ConnectionPoolConfig poolConfig = new ConnectionPoolConfig(); | ||
poolConfig.setMaxTotal(1); | ||
return poolConfig; | ||
}; | ||
|
||
} |
Oops, something went wrong.