Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extensive tests for UnifiedJedis #3788

Merged
merged 11 commits into from
Apr 3, 2024
15 changes: 15 additions & 0 deletions src/main/java/redis/clients/jedis/PipeliningBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1606,11 +1606,21 @@ public Response<List<Boolean>> scriptExists(String sampleKey, String... sha1) {
return appendCommand(commandObjects.scriptExists(sampleKey, sha1));
}

@Override
public Response<String> scriptLoad(String script) {
return appendCommand(commandObjects.scriptLoad(script));
}

@Override
public Response<String> scriptLoad(String script, String sampleKey) {
return appendCommand(commandObjects.scriptLoad(script, sampleKey));
}

@Override
public Response<String> scriptFlush() {
return appendCommand(commandObjects.scriptFlush());
}

@Override
public Response<String> scriptFlush(String sampleKey) {
return appendCommand(commandObjects.scriptFlush(sampleKey));
Expand All @@ -1621,6 +1631,11 @@ public Response<String> scriptFlush(String sampleKey, FlushMode flushMode) {
return appendCommand(commandObjects.scriptFlush(sampleKey, flushMode));
}

@Override
public Response<String> scriptKill() {
return appendCommand(commandObjects.scriptKill());
}

@Override
public Response<String> scriptKill(String sampleKey) {
return appendCommand(commandObjects.scriptKill(sampleKey));
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,17 @@ private UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, Comm
this.graphCommandObjects.setBaseCommandArgumentsCreator((comm) -> this.commandObjects.commandArguments(comm));
}

/**
* Needed for unit tests.
*/
public UnifiedJedis(CommandObjects commandObjects, GraphCommandObjects graphCommandObjects,
CommandExecutor executor, ConnectionProvider provider) {
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
this.provider = provider;
this.executor = executor;
this.commandObjects = commandObjects;
this.graphCommandObjects = graphCommandObjects;
}

@Override
public void close() {
IOUtils.closeQuietly(this.executor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ public interface SampleKeyedPipelineCommands {

Response<List<Boolean>> scriptExists(String sampleKey, String... sha1);

Response<String> scriptLoad(String script);

Response<String> scriptLoad(String script, String sampleKey);

Response<String> scriptFlush();

Response<String> scriptFlush(String sampleKey);

Response<String> scriptFlush(String sampleKey, FlushMode flushMode);

Response<String> scriptKill();

Response<String> scriptKill(String sampleKey);
}
Loading
Loading