From 65afe475c987bd650b491a745969f3d2002a34dd Mon Sep 17 00:00:00 2001 From: "Huynh, Tu | RASIA" Date: Fri, 24 Dec 2021 01:23:15 +0800 Subject: [PATCH] update docs --- .../java/com/keva/config/ArgsParserTest.java | 5 +- .../keva/core/server/AbstractServerTest.java | 65 +++++++++---------- docs/src/.vuepress/config.js | 3 +- docs/src/guide/developer-guide.md | 10 +++ docs/src/guide/insight/release-notes.md | 3 + docs/src/guide/roadmap.md | 5 +- 6 files changed, 48 insertions(+), 43 deletions(-) create mode 100644 docs/src/guide/insight/release-notes.md diff --git a/config/src/test/java/com/keva/config/ArgsParserTest.java b/config/src/test/java/com/keva/config/ArgsParserTest.java index bbb7bab6..93dc9f7b 100644 --- a/config/src/test/java/com/keva/config/ArgsParserTest.java +++ b/config/src/test/java/com/keva/config/ArgsParserTest.java @@ -1,13 +1,12 @@ package com.keva.config; +import com.keva.config.util.ArgsHolder; import com.keva.config.util.ArgsParser; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import lombok.var; - class ArgsParserTest { @Test @@ -15,7 +14,7 @@ void parse() { String[] args = { "--p", "123123", "--a", "--b" }; - var parse = ArgsParser.parse(args); + ArgsHolder parse = ArgsParser.parse(args); assertEquals("true", parse.getFlag("a")); assertEquals("true", parse.getFlag("b")); assertEquals("123123", parse.getArgVal("p")); diff --git a/core/src/test/java/dev/keva/core/server/AbstractServerTest.java b/core/src/test/java/dev/keva/core/server/AbstractServerTest.java index 5beb8437..74563aae 100644 --- a/core/src/test/java/dev/keva/core/server/AbstractServerTest.java +++ b/core/src/test/java/dev/keva/core/server/AbstractServerTest.java @@ -14,7 +14,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import lombok.var; import redis.clients.jedis.params.ZAddParams; import static org.junit.jupiter.api.Assertions.*; @@ -96,7 +95,7 @@ void getSetEmptyString() { @Test void del() { try { - var setAbc = jedis.set("abc", "123"); + String setAbc = jedis.set("abc", "123"); val getAbc = jedis.get("abc"); val delAbc = jedis.del("abc"); val getAbcNull = jedis.get("abc"); @@ -187,7 +186,7 @@ void transactionWatch() { void getSetExpire() { try { val setAbc = jedis.set("abc", "123"); - var getAbc = jedis.get("abc"); + String getAbc = jedis.get("abc"); val expireAbc = jedis.expire("abc", 1L); assertEquals("OK", setAbc); @@ -208,8 +207,8 @@ void getSetExpire() { void updateExpire() { try { val setAbc = jedis.set("abc", "123"); - var getAbc = jedis.get("abc"); - var expireAbc = jedis.expire("abc", 1L); + String getAbc = jedis.get("abc"); + Long expireAbc = jedis.expire("abc", 1L); assertEquals("OK", setAbc); assertEquals("123", getAbc); @@ -237,7 +236,7 @@ void updateExpire() { void getSetExpireAt() { try { val setAbc = jedis.set("abc", "123"); - var getAbc = jedis.get("abc"); + String getAbc = jedis.get("abc"); val oneSecondLaterTime = System.currentTimeMillis() + 1000; val expireAbc = jedis.expireAt("abc", oneSecondLaterTime); @@ -258,8 +257,8 @@ void getSetExpireAt() { @Test void setAfterExpireAt() { try { - var setAbc = jedis.set("abc", "123"); - var getAbc = jedis.get("abc"); + String setAbc = jedis.set("abc", "123"); + String getAbc = jedis.get("abc"); val oneSecondLaterTime = System.currentTimeMillis() + 1000; val expireAbc = jedis.expireAt("abc", oneSecondLaterTime); @@ -313,19 +312,17 @@ void getSetLongKeyString() { @Timeout(30) void pubsub() throws ExecutionException, InterruptedException { CompletableFuture future = new CompletableFuture<>(); - new Thread(() -> { - subscriber.subscribe(new JedisPubSub() { - @Override - public void onMessage(String channel, String message) { - future.complete(message); - } - - @Override - public void onSubscribe(String channel, int subscribedChannels) { - jedis.publish("test", "Test message"); - } - }, "test"); - }).start(); + new Thread(() -> subscriber.subscribe(new JedisPubSub() { + @Override + public void onMessage(String channel, String message) { + future.complete(message); + } + + @Override + public void onSubscribe(String channel, int subscribedChannels) { + jedis.publish("test", "Test message"); + } + }, "test")).start(); val message = future.get(); assertEquals("Test message", message); } @@ -832,36 +829,32 @@ void setrange() { @Test void zaddWithXXAndNXErrs() { - assertThrows(JedisDataException.class, () -> { - jedis.zadd("zset", 1.0, "val", new ZAddParams().xx().nx()); - }); + assertThrows(JedisDataException.class, () -> + jedis.zadd("zset", 1.0, "val", new ZAddParams().xx().nx())); } @Test void zaddSingleWithNxAndGtErrs() { - assertThrows(JedisDataException.class, () -> { - jedis.zadd("zset", 1.0, "val", new ZAddParams().gt().nx()); - }); + assertThrows(JedisDataException.class, () -> + jedis.zadd("zset", 1.0, "val", new ZAddParams().gt().nx())); } @Test void zaddSingleWithNxAndLtErrs() { - assertThrows(JedisDataException.class, () -> { - jedis.zadd("zset", 1.0, "val", new ZAddParams().lt().nx()); - }); + assertThrows(JedisDataException.class, () -> + jedis.zadd("zset", 1.0, "val", new ZAddParams().lt().nx())); } @Test void zaddSingleWithGtAndLtErrs() { - assertThrows(JedisDataException.class, () -> { - jedis.zadd("zset", 1.0, "val", new ZAddParams().lt().gt()); - }); + assertThrows(JedisDataException.class, () -> + jedis.zadd("zset", 1.0, "val", new ZAddParams().lt().gt())); } @Test void zaddSingleWithoutOptions() { try { - var result = jedis.zadd("zset", 1.0, "val"); + Long result = jedis.zadd("zset", 1.0, "val"); assertEquals(1, result); result = jedis.zadd("zset", 1.0, "val"); @@ -879,7 +872,7 @@ void zaddMultipleWithoutOptions() { for(int i=0; i