Skip to content

Commit

Permalink
Update ACL tests and modify JedisPool tests (#2325)
Browse files Browse the repository at this point in the history
- Test ACL with non-default user for standalone Redis instance (Jedis, Jedis with SSL, JedisPool)
- Removed Jedis with ACL tests where ACL feature was not being used and will not bring anything new even if used
- Removed JedisPool with ACL tests where ACL feature was not being used and will not bring anything new even if used
- Modify JedisPool (with/without ACL) tests
- Used try-with-resources in JedisPool (with/without ACL) tests
- Added a test related to issue #2318 and PR #2319 
- Added two minimal JedisPool constructor with user and password params (also testing those)
  • Loading branch information
sazzad16 authored Dec 24, 2020
1 parent bdf89da commit 1a9de79
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 840 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ daemonize yes
protected-mode no
port 6379
requirepass foobared
user acljedis on allcommands allkeys >fizzbuzz
pidfile /tmp/redis1.pid
logfile /tmp/redis1.log
save ""
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/redis/clients/jedis/JedisPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ public JedisPool(final GenericObjectPoolConfig poolConfig, final String host, in
this(poolConfig, host, port, timeout, password, Protocol.DEFAULT_DATABASE);
}

public JedisPool(final String host, int port, String user, final String password) {
this(new GenericObjectPoolConfig(), host, port, user, password);
}

public JedisPool(final GenericObjectPoolConfig poolConfig, final String host, int port,
String user, final String password) {
this(poolConfig, host, port, Protocol.DEFAULT_TIMEOUT, user, password, Protocol.DEFAULT_DATABASE);
}

public JedisPool(final GenericObjectPoolConfig poolConfig, final String host, int port,
int timeout, final String user, final String password) {
this(poolConfig, host, port, timeout, user, password, Protocol.DEFAULT_DATABASE);
Expand Down
Loading

0 comments on commit 1a9de79

Please sign in to comment.