Skip to content

Commit

Permalink
opt: tostring msg (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes authored Jan 13, 2025
1 parent 38682b8 commit efd1e85
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public RedisResponse<String> getResponse() {

@Override
public String toString() {
return "GetRequest{" + "key='" + key + '\'' + ", response=" + response + '}';
return "DelRequest{" + "key='" + key + '\'' + ", response=" + response + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public RedisResponse<String> getResponse() {

@Override
public String toString() {
return "GetRequest{" + "key='" + command + '\'' + ", response=" + response + '}';
return "NotSupport{" + "key='" + command + '\'' + ", response=" + response + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ public void setError(String errorMsg) {

@Override
public String toString() {
return "HGetRequest{" + "key='" + key + '\'' + ", field='" + field + '\'' + ", response=" + response + '}';
return "HMGetRequest{" + "key='" + key + '\'' + ", field='" + field + '\'' + ", response=" + response + '}';
}
}
18 changes: 14 additions & 4 deletions src/test/java/icu/funkye/redispike/ServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void init() throws ParseException {
}

@Test
@Order(value = Integer.MIN_VALUE)
@Order(1)
public void TestErr() {
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
jedis.aclDelUser("test");
Expand All @@ -74,7 +74,7 @@ public void TestErr() {
}

@Test
@Order(value = Integer.MIN_VALUE)
@Order(2)
public void TestPippline() {
List<String> keys = new ArrayList<>();
String key = String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue));
Expand Down Expand Up @@ -110,6 +110,7 @@ public void TestPippline() {
}

@Test
@Order(3)
public void TestSet() {
List<String> keys = new ArrayList<>();
for (int i = 0; i < 3; i++) {
Expand Down Expand Up @@ -146,14 +147,15 @@ public void TestSet() {

@Test
@DisabledIfSystemProperty(named = "asp-client.version", matches = "4.1.2")
@Order(Integer.MAX_VALUE)
public void testKeys() {
List<String> keys = new ArrayList<>();
for (int i = 0; i < 2; i++) {
keys.add(String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue)));
}
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
for (String key : keys) {
jedis.set(key, "b");
jedis.set(key, "b", SetParams.setParams().ex(5L));
}
Set<String> result = jedis.keys("123");
Assertions.assertEquals(result.size(), 0);
Expand All @@ -168,7 +170,7 @@ public void testKeys() {
}

@Test
@Order(value = Integer.MAX_VALUE)
@Order(5)
public void testhHash() {
String key = String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
Expand Down Expand Up @@ -235,6 +237,7 @@ public void testhHash() {

@Test
@EnabledOnOs(OS.LINUX)
@Order(6)
public void testRedisSet() {
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set("a", "bq");
Expand All @@ -247,6 +250,7 @@ public void testRedisSet() {
}

@Test
@Order(7)
public void testGetSetAsp() {
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set("a", "b");
Expand All @@ -264,6 +268,7 @@ public void testGetSetAsp() {
}

@Test
@Order(8)
public void testGetNilAsp() {
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.get(String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue)));
Expand All @@ -272,6 +277,7 @@ public void testGetNilAsp() {
}

@Test
@Order(9)
public void testSetExAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
Expand All @@ -286,6 +292,7 @@ public void testSetExAsp() {
}

@Test
@Order(10)
public void testSetNxNilAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
Expand All @@ -302,6 +309,7 @@ public void testSetNxNilAsp() {
}

@Test
@Order(11)
public void testSetExNxAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
Expand All @@ -316,6 +324,7 @@ public void testSetExNxAsp() {
}

@Test
@Order(12)
public void testDelAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextLong(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
Expand All @@ -327,6 +336,7 @@ public void testDelAsp() {
}

@Test
@Order(13)
public void testBatchDelAsp() {
List<String> keys = new ArrayList<>();
for (int i = 0; i < 2; i++) {
Expand Down

0 comments on commit efd1e85

Please sign in to comment.