Skip to content

Commit e98b313

Browse files
committed
add jedis test
1 parent 63ee273 commit e98b313

File tree

14 files changed

+390
-37
lines changed

14 files changed

+390
-37
lines changed

.flattened-pom.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>io.github.ipipman</groupId>
6+
<artifactId>cache-man</artifactId>
7+
<version>2.0.0</version>
8+
<packaging>pom</packaging>
9+
<name>cache-man</name>
10+
<description>cache-man</description>
11+
<url>https://github.com/ipipman/cache-man</url>
12+
<licenses>
13+
<license>
14+
<name>The Apache Software License, Version 2.0</name>
15+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
16+
<distribution>repo</distribution>
17+
</license>
18+
</licenses>
19+
<developers>
20+
<developer>
21+
<name>ipman</name>
22+
<email>[email protected]</email>
23+
<url>https://github.com/ipipman</url>
24+
</developer>
25+
</developers>
26+
<scm>
27+
<connection>scm:git:https://github.com/ipipman/cache-man.git</connection>
28+
<developerConnection>scm:git:https://github.com/ipipman/cache-man.git</developerConnection>
29+
<url>https://github.com/ipipman/cache-man</url>
30+
</scm>
31+
<issueManagement>
32+
<system>github</system>
33+
<url>https://github.com/ipipman/cache-man/issues</url>
34+
</issueManagement>
35+
</project>

cache-core/.flattened-pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>io.github.ipipman</groupId>
6+
<artifactId>cache-core</artifactId>
7+
<version>2.0.0</version>
8+
<name>cache-core</name>
9+
<description>cache-core</description>
10+
<url>https://github.com/ipipman/cache-man/cache-core</url>
11+
<licenses>
12+
<license>
13+
<name>The Apache Software License, Version 2.0</name>
14+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
15+
<distribution>repo</distribution>
16+
</license>
17+
</licenses>
18+
<developers>
19+
<developer>
20+
<name>ipman</name>
21+
<email>[email protected]</email>
22+
<url>https://github.com/ipipman</url>
23+
</developer>
24+
</developers>
25+
<scm>
26+
<connection>scm:git:https://github.com/ipipman/cache-man.git/cache-core</connection>
27+
<developerConnection>scm:git:https://github.com/ipipman/cache-man.git/cache-core</developerConnection>
28+
<url>https://github.com/ipipman/cache-man/cache-core</url>
29+
</scm>
30+
<issueManagement>
31+
<system>github</system>
32+
<url>https://github.com/ipipman/cache-man/issues</url>
33+
</issueManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.projectlombok</groupId>
37+
<artifactId>lombok</artifactId>
38+
<version>1.18.32</version>
39+
<scope>compile</scope>
40+
<optional>true</optional>
41+
</dependency>
42+
</dependencies>
43+
</project>

cache-server/.flattened-pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>io.github.ipipman</groupId>
6+
<artifactId>cache-server</artifactId>
7+
<version>2.0.0</version>
8+
<name>cache-server</name>
9+
<description>cache-server</description>
10+
<url>https://github.com/ipipman/cache-man/cache-server</url>
11+
<licenses>
12+
<license>
13+
<name>The Apache Software License, Version 2.0</name>
14+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
15+
<distribution>repo</distribution>
16+
</license>
17+
</licenses>
18+
<developers>
19+
<developer>
20+
<name>ipman</name>
21+
<email>[email protected]</email>
22+
<url>https://github.com/ipipman</url>
23+
</developer>
24+
</developers>
25+
<scm>
26+
<connection>scm:git:https://github.com/ipipman/cache-man.git/cache-server</connection>
27+
<developerConnection>scm:git:https://github.com/ipipman/cache-man.git/cache-server</developerConnection>
28+
<url>https://github.com/ipipman/cache-man/cache-server</url>
29+
</scm>
30+
<issueManagement>
31+
<system>github</system>
32+
<url>https://github.com/ipipman/cache-man/issues</url>
33+
</issueManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter</artifactId>
38+
<version>3.3.0</version>
39+
<scope>compile</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>io.github.ipipman</groupId>
43+
<artifactId>cache-core</artifactId>
44+
<version>2.0.0</version>
45+
<scope>compile</scope>
46+
</dependency>
47+
<dependency>
48+
<groupId>io.netty</groupId>
49+
<artifactId>netty-all</artifactId>
50+
<version>4.1.104.Final</version>
51+
<scope>compile</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.projectlombok</groupId>
55+
<artifactId>lombok</artifactId>
56+
<version>1.18.32</version>
57+
<scope>compile</scope>
58+
<optional>true</optional>
59+
</dependency>
60+
</dependencies>
61+
</project>

cache-server/pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@
6868
<scope>test</scope>
6969
</dependency>
7070

71-
<dependency>
72-
<groupId>redis.clients</groupId>
73-
<artifactId>jedis</artifactId>
74-
<version>2.6.2</version>
75-
</dependency>
76-
77-
<dependency>
78-
<groupId>org.apache.commons</groupId>
79-
<artifactId>commons-pool2</artifactId>
80-
<version>2.6.2</version>
81-
</dependency>
82-
8371
</dependencies>
8472

8573
<build>
@@ -89,6 +77,7 @@
8977
<artifactId>spring-boot-maven-plugin</artifactId>
9078
<version>3.2.3</version>
9179
<configuration>
80+
<classifier>boot</classifier>
9281
<mainClass>cn.ipman.cache.server.CacheServerApplication</mainClass> <!-- 正确填写你的主类全限定名 -->
9382
<excludes>
9483
<exclude>

cache-server/src/main/java/cn/ipman/cache/server/config/IMApplicationListener.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package cn.ipman.cache.server.config;
22

3-
import cn.ipman.cache.server.jedis.JedisUtil;
43
import cn.ipman.cache.server.server.IMServerPlugin;
54
import lombok.NonNull;
65
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,10 +26,6 @@ public class IMApplicationListener implements ApplicationListener<ApplicationEve
2726
@Autowired
2827
List<IMServerPlugin> plugins;
2928

30-
31-
@Autowired
32-
JedisUtil jedisUtil;
33-
3429
@Override
3530
public void onApplicationEvent(@NonNull ApplicationEvent event) {
3631

@@ -53,10 +48,6 @@ public void onApplicationEvent(@NonNull ApplicationEvent event) {
5348
System.out.println("Netty redis起动后, 定时任务进程ID为 "
5449
+ Thread.currentThread().getId() + ", 父线程ID为 " + inheritableThreadLocal.get());
5550

56-
System.out.println(jedisUtil.set("a", "1", 0));
57-
System.out.println(jedisUtil.get("a", 0));
58-
59-
6051
}, 2, 2, TimeUnit.SECONDS);
6152

6253

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
spring.application.name=cache-server
2-
3-
4-
# jedis test
5-
spring.data.redis.database=0
6-
spring.data.redis.host=127.0.0.1
7-
spring.data.redis.port=6379
8-
spring.data.redis.password=
9-
spring.data.redis.jedis.pool.max-active=20
10-
spring.data.redis.jedis.pool.max-wait=1000
11-
spring.data.redis.jedis.pool.max-idle=5
12-
spring.data.redis.jedis.pool.min-idle=0
13-
spring.data.redis.timeout=10000
1+
spring.application.name=cache-server

cache-test-jedis/.flattened-pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>io.github.ipipman</groupId>
6+
<artifactId>cache-test-jedis</artifactId>
7+
<version>2.0.0</version>
8+
<name>cache-test-jedis</name>
9+
<description>cache-test-jedis</description>
10+
<url>https://github.com/ipipman/cache-man/cache-test-jedis</url>
11+
<licenses>
12+
<license>
13+
<name>The Apache Software License, Version 2.0</name>
14+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
15+
<distribution>repo</distribution>
16+
</license>
17+
</licenses>
18+
<developers>
19+
<developer>
20+
<name>ipman</name>
21+
<email>[email protected]</email>
22+
<url>https://github.com/ipipman</url>
23+
</developer>
24+
</developers>
25+
<scm>
26+
<connection>scm:git:https://github.com/ipipman/cache-man.git/cache-test-jedis</connection>
27+
<developerConnection>scm:git:https://github.com/ipipman/cache-man.git/cache-test-jedis</developerConnection>
28+
<url>https://github.com/ipipman/cache-man/cache-test-jedis</url>
29+
</scm>
30+
<issueManagement>
31+
<system>github</system>
32+
<url>https://github.com/ipipman/cache-man/issues</url>
33+
</issueManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter</artifactId>
38+
<version>3.3.0</version>
39+
<scope>compile</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.projectlombok</groupId>
43+
<artifactId>lombok</artifactId>
44+
<version>1.18.32</version>
45+
<scope>compile</scope>
46+
<optional>true</optional>
47+
</dependency>
48+
<dependency>
49+
<groupId>redis.clients</groupId>
50+
<artifactId>jedis</artifactId>
51+
<version>2.6.2</version>
52+
<scope>compile</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.apache.commons</groupId>
56+
<artifactId>commons-pool2</artifactId>
57+
<version>2.6.2</version>
58+
<scope>compile</scope>
59+
</dependency>
60+
</dependencies>
61+
</project>

cache-test-jedis/pom.xml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>io.github.ipipman</groupId>
7+
<artifactId>cache-man</artifactId>
8+
<version>${cache.version}</version>
9+
<relativePath>../pom.xml</relativePath>
10+
</parent>
11+
12+
<artifactId>cache-test-jedis</artifactId>
13+
<version>${cache.version}</version>
14+
15+
<name>cache-test-jedis</name>
16+
<description>cache-test-jedis</description>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter</artifactId>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.projectlombok</groupId>
26+
<artifactId>lombok</artifactId>
27+
<optional>true</optional>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>io.github.ipipman</groupId>
32+
<artifactId>cache-server</artifactId>
33+
<version>${cache.version}</version>
34+
<scope>test</scope>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>org.springframework.boot</groupId>
39+
<artifactId>spring-boot-starter-test</artifactId>
40+
<scope>test</scope>
41+
</dependency>
42+
43+
<dependency>
44+
<groupId>junit</groupId>
45+
<artifactId>junit</artifactId>
46+
<version>4.13.2</version>
47+
<scope>test</scope>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>redis.clients</groupId>
52+
<artifactId>jedis</artifactId>
53+
<version>2.6.2</version>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.apache.commons</groupId>
58+
<artifactId>commons-pool2</artifactId>
59+
<version>2.6.2</version>
60+
</dependency>
61+
</dependencies>
62+
63+
<build>
64+
<plugins>
65+
<plugin>
66+
<groupId>org.springframework.boot</groupId>
67+
<artifactId>spring-boot-maven-plugin</artifactId>
68+
<version>3.2.3</version>
69+
<configuration>
70+
<mainClass>cn.ipman.cache.test.jedis.CacheTestJedisApplication</mainClass>
71+
<excludes>
72+
<exclude>
73+
<groupId>org.projectlombok</groupId>
74+
<artifactId>lombok</artifactId>
75+
</exclude>
76+
</excludes>
77+
</configuration>
78+
<executions>
79+
<execution>
80+
<goals>
81+
<goal>repackage</goal>
82+
</goals>
83+
</execution>
84+
</executions>
85+
</plugin>
86+
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-surefire-plugin</artifactId>
90+
<version>3.2.3</version>
91+
<dependencies>
92+
<dependency>
93+
<groupId>org.apache.maven.surefire</groupId>
94+
<artifactId>surefire-junit-platform</artifactId>
95+
<version>3.2.3</version>
96+
</dependency>
97+
</dependencies>
98+
</plugin>
99+
</plugins>
100+
</build>
101+
102+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package cn.ipman.cache.test.jedis;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class CacheTestJedisApplication {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(CacheTestJedisApplication.class, args);
11+
}
12+
13+
}

cache-server/src/main/java/cn/ipman/cache/server/config/JedisConfig.java renamed to cache-test-jedis/src/main/java/cn/ipman/cache/test/jedis/config/JedisConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cn.ipman.cache.server.config;
1+
package cn.ipman.cache.test.jedis.config;
22

33
import org.springframework.beans.factory.annotation.Value;
44
import org.springframework.boot.context.properties.ConfigurationProperties;

0 commit comments

Comments
 (0)