-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Test with 8.0-M04-pre #4069
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
Merged
Merged
Test with 8.0-M04-pre #4069
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ffa88fc
Test with 8.0-M03-pre
ggivo 03865e9
Test with 8.0-M03-pre
ggivo 0eb02ee
Test with 8.0-M03
ggivo f402d1a
Test with 8.0-M04-pre
ggivo e5dbee4
SearchDefaultDialectTest.testDialectsWithFTExplain
ggivo a1ce664
Update testAggregationBuilderAddScores test to match change in SEARCH…
ggivo 7b5eb1d
Apply suggestions from code review
ggivo 0350c2f
Address review comments
ggivo 283bd1a
Update SearchDefaultDialectTest.java
sazzad16 1122790
Output of ft.explain has changed in Redis 8.0.
ggivo d2088e0
Merge branch 'master' into test-M03-pre
ggivo ece9a08
minor changes: format, private, unused variable, etc.
sazzad16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
77 changes: 77 additions & 0 deletions
77
src/test/java/redis/clients/jedis/util/RedisConditions.java
This file contains hidden or 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,77 @@ | ||
| package redis.clients.jedis.util; | ||
|
|
||
| import io.redis.test.utils.RedisVersion; | ||
| import redis.clients.jedis.CommandArguments; | ||
| import redis.clients.jedis.CommandObject; | ||
| import redis.clients.jedis.Module; | ||
| import redis.clients.jedis.UnifiedJedis; | ||
| import redis.clients.jedis.resps.CommandInfo; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| import static redis.clients.jedis.BuilderFactory.MODULE_LIST; | ||
| import static redis.clients.jedis.Protocol.Command.COMMAND; | ||
| import static redis.clients.jedis.Protocol.Command.MODULE; | ||
| import static redis.clients.jedis.Protocol.Keyword.LIST; | ||
|
|
||
| public class RedisConditions { | ||
|
|
||
| private final RedisVersion version; | ||
| private final Map<String, Integer> modules; | ||
| private final Map<String, CommandInfo> commands; | ||
|
|
||
| private RedisConditions(RedisVersion version, Map< String, CommandInfo> commands, Map<String, Integer> modules) { | ||
| this.version = version; | ||
| this.commands = commands; | ||
| this.modules = modules; | ||
| } | ||
|
|
||
| public static RedisConditions of(UnifiedJedis jedis) { | ||
| RedisVersion version = RedisVersionUtil.getRedisVersion(jedis); | ||
|
|
||
| CommandObject<Map<String, CommandInfo>> commandInfoCmd | ||
| = new CommandObject<>(new CommandArguments(COMMAND), CommandInfo.COMMAND_INFO_RESPONSE); | ||
| Map<String, CommandInfo> commands = jedis.executeCommand(commandInfoCmd); | ||
|
|
||
| CommandObject<List<Module>> moduleListCmd | ||
| = new CommandObject<>(new CommandArguments(MODULE).add(LIST), MODULE_LIST); | ||
|
|
||
| Map<String, Integer> modules = jedis.executeCommand(moduleListCmd) | ||
| .stream() | ||
| .collect(Collectors.toMap((m) -> m.getName().toUpperCase(), Module::getVersion)); | ||
|
|
||
| return new RedisConditions(version, commands, modules); | ||
| } | ||
|
|
||
| public RedisVersion getVersion() { | ||
| return version; | ||
| } | ||
|
|
||
| /** | ||
| * @param command | ||
| * @return {@code true} if the command is present. | ||
| */ | ||
| public boolean hasCommand(String command) { | ||
| return commands.containsKey(command.toUpperCase()); | ||
| } | ||
|
|
||
| /** | ||
| * @param module | ||
| * @return {@code true} if the module is present. | ||
| */ | ||
| public boolean hasModule(String module) { | ||
| return modules.containsKey(module.toUpperCase()); | ||
| } | ||
|
|
||
| /** | ||
| * @param module | ||
| * @param version | ||
| * @return {@code true} if the module is present. | ||
| */ | ||
| public boolean moduleVersionIsGreatherThan(String module, int version) { | ||
| Integer moduleVersion = modules.get(module.toUpperCase()); | ||
| return moduleVersion != null && moduleVersion > version; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.