Skip to content

Commit

Permalink
Enable test on jdk 21 (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Oct 10, 2023
1 parent 74048d7 commit 4387d2f
Show file tree
Hide file tree
Showing 127 changed files with 277 additions and 166 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/dubbo-3_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ env:
VERSIONS_LIMIT: 4
#candidate versions (the dubbo snapshot version will be extracted from pom.xml and appended before CANDIDATE_VERSIONS )
CANDIDATE_VERSIONS: '
spring.version:4.3.30.RELEASE;
spring-boot.version:1.5.22.RELEASE;
spring-boot.version:2.4.1;
spring.version:5.3.24;
spring-boot.version:2.7.6;
'
DUBBO_REF: '3.3'

Expand Down
2 changes: 1 addition & 1 deletion 1-basic/dubbo-samples-spring-boot/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 17]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring-boot.version=1.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-attachment/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=[>= 3.1.0]
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-autowire/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-cache/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-callback/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring-boot.version=2.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-chain/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-compatible/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-context/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-direct/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-docker/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# SpringBoot app
dubbo.version=2.7*, 3.*
spring-boot.version=1.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-echo/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-group/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-local/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
24 changes: 17 additions & 7 deletions 2-advanced/dubbo-samples-local/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>3.2.6</dubbo.version>
<spring.version>4.3.30.RELEASE</spring.version>
<junit.version>4.13.1</junit.version>
<spring.version>5.3.25</spring.version>
<junit5.version>5.9.2</junit5.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down Expand Up @@ -74,14 +74,24 @@
<artifactId>dubbo-dependencies-zookeeper-curator5</artifactId>
<type>pom</type>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,50 @@

import org.apache.dubbo.samples.local.api.DemoService;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@RunWith(SpringJUnit4ClassRunner.class)
@ExtendWith(SpringExtension.class)
@ContextConfiguration(locations = {"classpath:/spring/dubbo-demo.xml"})
public class DemoServiceIT {
@Autowired
private DemoService demoService;

@BeforeClass
@BeforeAll
public static void setUp() throws Exception {
new EmbeddedZooKeeper(2181, false).start();
}

@Test
public void test() throws Exception {
@DisabledForJreRange(min = JRE.JAVA_15)
public void testZk() throws Exception {
// see also: org.apache.dubbo.rpc.protocol.injvm.InjvmInvoker.doInvoke
// InjvmInvoker set remote address to 127.0.0.1:0
String result = demoService.sayHello("world");
Assert.assertEquals(result, "Hello world, response from provider: 127.0.0.1:0");
Assertions.assertEquals(result, "Hello world, response from provider: 127.0.0.1:0");

result = demoService.sayHelloAsync("world");
Assert.assertEquals(result, "Hello world, response from provider: 127.0.0.1:0");
Assertions.assertEquals(result, "Hello world, response from provider: 127.0.0.1:0");
}

@Test
@EnabledForJreRange(min = JRE.JAVA_15)
public void testZkHigh() throws Exception {
// see also: org.apache.dubbo.rpc.protocol.injvm.InjvmInvoker.doInvoke
// InjvmInvoker set remote address to 127.0.0.1:0
String result = demoService.sayHello("world");
Assertions.assertEquals(result, "Hello world, response from provider: 127.0.0.1/<unresolved>:0");

result = demoService.sayHelloAsync("world");
Assertions.assertEquals(result, "Hello world, response from provider: 127.0.0.1/<unresolved>:0");
}

}
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-merge/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-mock/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-notify/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-scala/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version= [>=3.2.0]
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.1*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-spi-compatible/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# SpringBoot/SpringCloud app
dubbo.version=3.3.*
spring-boot.version=2.7.*
java.version= [ <= 11]
java.version= [ >= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# SpringBoot/SpringCloud app
dubbo.version=3.3.*
spring-boot.version=2.7.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-stub/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-tengine/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# SpringBoot app
dubbo.version=2.7*, 3.*
spring-boot.version=2.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-validation/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
2 changes: 1 addition & 1 deletion 2-advanced/dubbo-samples-version/case-versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Spring app
dubbo.version=2.7*, 3.*
spring.version=4.*, 5.*
java.version= [<= 11]
java.version= [>= 8]
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<target.level>1.8</target.level>
<dubbo.version>3.2.6</dubbo.version>
<spring-boot.version>1.5.21.RELEASE</spring-boot.version>
<javassist.version>3.29.2-GA</javassist.version>
<junit.version>4.13.1</junit.version>
<zookeeper_version>3.8.1</zookeeper_version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
Expand Down Expand Up @@ -107,6 +108,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>${javassist.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
Loading

0 comments on commit 4387d2f

Please sign in to comment.