-
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 SEARCH module CONFIG support * Test according to design doc with Redis 8.0-M03 * Set the version rule * Deprecate FT.CONFIG command and keyworkds * Shorten file name * fix typo * Redis 8.0-M03 image reports the version as 7.9.226 * Redis 8.0-M04-pre restored defaults * Based on RedisModuleCommandsTestBase * close resource
- Loading branch information
Showing
7 changed files
with
102 additions
and
3 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
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
71 changes: 71 additions & 0 deletions
71
src/test/java/redis/clients/jedis/modules/ConsolidatedConfigurationCommandsTest.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,71 @@ | ||
package redis.clients.jedis.modules; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.aMapWithSize; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertThrows; | ||
|
||
import io.redis.test.annotations.SinceRedisVersion; | ||
import java.util.Collections; | ||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import redis.clients.jedis.RedisProtocol; | ||
import redis.clients.jedis.exceptions.JedisDataException; | ||
|
||
@SinceRedisVersion(value = "7.9.0") | ||
@RunWith(Parameterized.class) | ||
public class ConsolidatedConfigurationCommandsTest extends RedisModuleCommandsTestBase { | ||
|
||
public ConsolidatedConfigurationCommandsTest(RedisProtocol redisProtocol) { | ||
super(redisProtocol); | ||
} | ||
|
||
@Test | ||
public void setSearchConfigGloballyTest() { | ||
final String configParam = "search-default-dialect"; | ||
// confirm default | ||
assertEquals(Collections.singletonMap(configParam, "1"), jedis.configGet(configParam)); | ||
|
||
try { | ||
assertEquals("OK", jedis.configSet(configParam, "2")); | ||
assertEquals(Collections.singletonMap(configParam, "2"), jedis.configGet(configParam)); | ||
|
||
} finally { | ||
// restore to default | ||
assertEquals("OK", jedis.configSet(configParam, "1")); | ||
} | ||
} | ||
|
||
@Test | ||
public void setReadOnlySearchConfigTest() { | ||
JedisDataException de = assertThrows(JedisDataException.class, () -> jedis.configSet("search-max-doctablesize", "10")); | ||
assertThat(de.getMessage(), Matchers.not(Matchers.emptyOrNullString())); | ||
} | ||
|
||
@Test | ||
public void getSearchConfigSettingTest() { | ||
assertThat(jedis.configGet("search-timeout"), aMapWithSize(1)); | ||
} | ||
|
||
@Test | ||
public void getTSConfigSettingTest() { | ||
assertThat(jedis.configGet("ts-retention-policy"), aMapWithSize(1)); | ||
} | ||
|
||
@Test | ||
public void getBFConfigSettingTest() { | ||
assertThat(jedis.configGet("bf-error-rate"), aMapWithSize(1)); | ||
} | ||
|
||
@Test | ||
public void getCFConfigSettingTest() { | ||
assertThat(jedis.configGet("cf-initial-size"), aMapWithSize(1)); | ||
} | ||
|
||
@Test | ||
public void getAllConfigSettings() { | ||
assertThat(jedis.configGet("*").size(), Matchers.greaterThan(0)); | ||
} | ||
} |