This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.2 by this push:
new ce38ee2694 Set Fastjson2 as default, support JDK17 native test (#10914)
ce38ee2694 is described below
commit ce38ee2694c399593a4d429a40e0aba2406b9034
Author: Albumen Kevin <[email protected]>
AuthorDate: Sat Nov 12 16:50:50 2022 +0800
Set Fastjson2 as default, support JDK17 native test (#10914)
---
.github/workflows/build-and-test-pr.yml | 11 +++++-
.github/workflows/build-and-test-scheduled-3.1.yml | 16 ++++++++
.github/workflows/build-and-test-scheduled-3.2.yml | 20 +++++++++-
.../dubbo/common/constants/ProviderConstants.java | 2 +-
.../apache/dubbo/config/AbstractConfigTest.java | 44 ++--------------------
.../dubbo-configcenter-apollo/pom.xml | 4 +-
dubbo-dependencies-bom/pom.xml | 2 +-
.../dubbo-spring-boot-compatible/pom.xml | 31 ++++++++++++++-
dubbo-test/dubbo-test-spring3.2/pom.xml | 31 +++++++++++++++
dubbo-test/dubbo-test-spring4.1/pom.xml | 31 +++++++++++++++
dubbo-test/dubbo-test-spring4.2/pom.xml | 31 +++++++++++++++
pom.xml | 25 +++++++++++-
12 files changed, 197 insertions(+), 51 deletions(-)
diff --git a/.github/workflows/build-and-test-pr.yml
b/.github/workflows/build-and-test-pr.yml
index 28c669e39d..e3a77d4c1f 100644
--- a/.github/workflows/build-and-test-pr.yml
+++ b/.github/workflows/build-and-test-pr.yml
@@ -138,6 +138,7 @@ jobs:
env:
DISABLE_FILE_SYSTEM_TEST: true
CURRENT_ROLE: ${{ matrix.case-role }}
+ DUBBO_DEFAULT_SERIALIZATION: fastjson2
steps:
- uses: actions/checkout@v3
- name: "Set up JDK ${{ matrix.jdk }}"
@@ -153,9 +154,17 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
+ - uses: actions/cache@v3
+ name: "Cache zookeeper binary archive"
+ id: "cache-zookeeper"
+ with:
+ path: ${{ github.workspace }}/.tmp/zookeeper
+ key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
+ restore-keys: |
+ zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
- run: ./mvnw --batch-mode --no-snapshot-updates -e
--no-transfer-progress --fail-fast clean test verify -Pjacoco
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false
-DskipIntegrationTests=false -Dcheckstyle.skip=false
-Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
-DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
+ run: ./mvnw --batch-mode --no-snapshot-updates -e
--no-transfer-progress --fail-fast clean test verify
-Pjacoco,jdk15ge-simple,'!jdk15ge'
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false
-DskipIntegrationTests=false -Dcheckstyle.skip=false
-Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
-DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
diff --git a/.github/workflows/build-and-test-scheduled-3.1.yml
b/.github/workflows/build-and-test-scheduled-3.1.yml
index 8b134b168f..c4f4ed8712 100644
--- a/.github/workflows/build-and-test-scheduled-3.1.yml
+++ b/.github/workflows/build-and-test-scheduled-3.1.yml
@@ -162,6 +162,14 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
+ - uses: actions/cache@v3
+ name: "Cache zookeeper binary archive"
+ id: "cache-zookeeper"
+ with:
+ path: ${{ github.workspace }}/.tmp/zookeeper
+ key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
+ restore-keys: |
+ zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
@@ -202,6 +210,14 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
+ - uses: actions/cache@v3
+ name: "Cache zookeeper binary archive"
+ id: "cache-zookeeper"
+ with:
+ path: ${{ github.workspace }}/.tmp/zookeeper
+ key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
+ restore-keys: |
+ zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
diff --git a/.github/workflows/build-and-test-scheduled-3.2.yml
b/.github/workflows/build-and-test-scheduled-3.2.yml
index c7dddc0c1d..ed710eb0d9 100644
--- a/.github/workflows/build-and-test-scheduled-3.2.yml
+++ b/.github/workflows/build-and-test-scheduled-3.2.yml
@@ -162,6 +162,14 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
+ - uses: actions/cache@v3
+ name: "Cache zookeeper binary archive"
+ id: "cache-zookeeper"
+ with:
+ path: ${{ github.workspace }}/.tmp/zookeeper
+ key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
+ restore-keys: |
+ zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
@@ -202,14 +210,22 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
+ - uses: actions/cache@v3
+ name: "Cache zookeeper binary archive"
+ id: "cache-zookeeper"
+ with:
+ path: ${{ github.workspace }}/.tmp/zookeeper
+ key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
+ restore-keys: |
+ zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
- run: ./mvnw --batch-mode --no-snapshot-updates -e
--no-transfer-progress --fail-fast clean test verify -Pjacoco
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false
-DskipIntegrationTests=false -Dcheckstyle.skip=false
-Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
-DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
+ run: ./mvnw --batch-mode --no-snapshot-updates -e
--no-transfer-progress --fail-fast clean test verify
-Pjacoco,jdk15ge-simple,'!jdk15ge'
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false
-DskipIntegrationTests=false -Dcheckstyle.skip=false
-Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
-DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Test with Maven without Integration Tests"
timeout-minutes: 90
if: ${{ startsWith( matrix.os, 'windows') }}
- run: ./mvnw --batch-mode --no-snapshot-updates -e
--no-transfer-progress --fail-fast clean test verify -Pjacoco
-D"http.keepAlive=false" -D"maven.wagon.http.pool=false"
-D"maven.wagon.httpconnectionManager.ttlSeconds=120"
-D"maven.wagon.http.retryHandler.count=5" -DskipTests=false
-DskipIntegrationTests=true -D"checkstyle.skip=false"
-D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true"
-D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
+ run: ./mvnw --batch-mode --no-snapshot-updates -e
--no-transfer-progress --fail-fast clean test verify
-Pjacoco,jdk15ge-simple,'!jdk15ge' -D"http.keepAlive=false"
-D"maven.wagon.http.pool=false"
-D"maven.wagon.httpconnectionManager.ttlSeconds=120"
-D"maven.wagon.http.retryHandler.count=5" -DskipTests=false
-DskipIntegrationTests=true -D"checkstyle.skip=false"
-D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true"
-D"embeddedZookeeperPath=${{ github.workspace [...]
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/ProviderConstants.java
b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/ProviderConstants.java
index 36aa6dff05..e94540d328 100644
---
a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/ProviderConstants.java
+++
b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/ProviderConstants.java
@@ -24,5 +24,5 @@ public interface ProviderConstants {
/**
* Default prefer serialization,multiple separated by commas
*/
- String DEFAULT_PREFER_SERIALIZATION = "hessian2";
+ String DEFAULT_PREFER_SERIALIZATION = "fastjson2,hessian2";
}
diff --git
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
index c6eb0274df..b15ec1d850 100644
---
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
+++
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
@@ -24,9 +24,9 @@ import org.apache.dubbo.config.support.Nested;
import org.apache.dubbo.config.support.Parameter;
import org.apache.dubbo.config.utils.ConfigValidationUtils;
import org.apache.dubbo.rpc.model.ApplicationModel;
-
import org.apache.dubbo.rpc.model.FrameworkModel;
import org.apache.dubbo.rpc.model.ScopeModel;
+
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
@@ -37,7 +37,6 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -586,23 +585,14 @@ public class AbstractConfigTest {
Map<String, String> external = new HashMap<>();
external.put("notConflictKey", "value-from-external");
-
- try {
- Map<String, String> map = new HashMap<>();
- map.put("notConflictKey", "value-from-env");
- map.put("dubbo.override.notConflictKey2", "value-from-env");
- setOsEnv(map);
- } catch (Exception e) {
- // ignore
- e.printStackTrace();
- }
+ external.put("dubbo.override.notConflictKey2",
"value-from-external");
ApplicationModel.defaultModel().getModelEnvironment().setExternalConfigMap(external);
overrideConfig.refresh();
Assertions.assertEquals("value-from-config",
overrideConfig.getNotConflictKey());
- Assertions.assertEquals("value-from-env",
overrideConfig.getNotConflictKey2());
+ Assertions.assertEquals("value-from-external",
overrideConfig.getNotConflictKey2());
} finally {
ApplicationModel.defaultModel().getModelEnvironment().destroy();
@@ -1003,34 +993,6 @@ public class AbstractConfigTest {
}
}
- protected static void setOsEnv(Map<String, String> newenv) throws
Exception {
- try {
- Class<?> processEnvironmentClass =
Class.forName("java.lang.ProcessEnvironment");
- Field theEnvironmentField =
processEnvironmentClass.getDeclaredField("theEnvironment");
- theEnvironmentField.setAccessible(true);
- Map<String, String> env = (Map<String, String>)
theEnvironmentField.get(null);
- env.putAll(newenv);
- Field theCaseInsensitiveEnvironmentField =
processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
- theCaseInsensitiveEnvironmentField.setAccessible(true);
- Map<String, String> cienv = (Map<String, String>)
theCaseInsensitiveEnvironmentField.get(null);
- cienv.putAll(newenv);
- } catch (NoSuchFieldException e) {
- Class[] classes = Collections.class.getDeclaredClasses();
- Map<String, String> env = System.getenv();
- for (Class cl : classes) {
- if
("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Object obj = field.get(env);
- Map<String, String> map = (Map<String, String>) obj;
- map.clear();
- map.putAll(newenv);
- }
- }
- }
- }
-
-
@Test
public void testMetaData() throws Exception {
diff --git a/dubbo-configcenter/dubbo-configcenter-apollo/pom.xml
b/dubbo-configcenter/dubbo-configcenter-apollo/pom.xml
index 3756a95f51..d31dc785be 100644
--- a/dubbo-configcenter/dubbo-configcenter-apollo/pom.xml
+++ b/dubbo-configcenter/dubbo-configcenter-apollo/pom.xml
@@ -29,7 +29,7 @@
<description>The Apollo implementation of the configcenter
api</description>
<properties>
<skip_maven_deploy>false</skip_maven_deploy>
- <apollo_mock_server_version>1.1.1</apollo_mock_server_version>
+ <apollo_mock_server_version>2.0.1</apollo_mock_server_version>
</properties>
<dependencies>
@@ -49,4 +49,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml
index ce33e88365..2695681a77 100644
--- a/dubbo-dependencies-bom/pom.xml
+++ b/dubbo-dependencies-bom/pom.xml
@@ -126,7 +126,7 @@
<kryo_serializers_version>0.42</kryo_serializers_version>
<fst_version>2.48-jdk-6</fst_version>
<avro_version>1.8.2</avro_version>
- <apollo_client_version>1.8.0</apollo_client_version>
+ <apollo_client_version>2.0.1</apollo_client_version>
<snakeyaml_version>1.32</snakeyaml_version>
<commons_lang3_version>3.8.1</commons_lang3_version>
<protostuff_version>1.5.9</protostuff_version>
diff --git a/dubbo-spring-boot/dubbo-spring-boot-compatible/pom.xml
b/dubbo-spring-boot/dubbo-spring-boot-compatible/pom.xml
index 9f4d8570fb..baeaaa40fe 100644
--- a/dubbo-spring-boot/dubbo-spring-boot-compatible/pom.xml
+++ b/dubbo-spring-boot/dubbo-spring-boot-compatible/pom.xml
@@ -48,6 +48,33 @@
<spring-boot.version>1.4.7.RELEASE</spring-boot.version>
</properties>
</profile>
-
+ <profile>
+ <id>jdk15ge-simple</id>
+ <activation>
+ <jdk>[15,</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <forkMode>once</forkMode>
+ <argLine>${argline} ${jacocoArgLine}
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/java.math=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ </argLine>
+ <systemProperties>
+ <!-- common shared -->
+ </systemProperties>
+ <!-- Activate the use of TCP to transmit events to
the plugin to fix Corrupted STDOUT issue -->
+ <forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/dubbo-test/dubbo-test-spring3.2/pom.xml
b/dubbo-test/dubbo-test-spring3.2/pom.xml
index 991d7e44b2..55035a92e5 100644
--- a/dubbo-test/dubbo-test-spring3.2/pom.xml
+++ b/dubbo-test/dubbo-test-spring3.2/pom.xml
@@ -83,4 +83,35 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>jdk15ge-simple</id>
+ <activation>
+ <jdk>[15,</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <forkMode>once</forkMode>
+ <argLine>${argline} ${jacocoArgLine}
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/java.math=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ </argLine>
+ <systemProperties>
+ <!-- common shared -->
+ </systemProperties>
+ <!-- Activate the use of TCP to transmit events to
the plugin to fix Corrupted STDOUT issue -->
+ <forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/dubbo-test/dubbo-test-spring4.1/pom.xml
b/dubbo-test/dubbo-test-spring4.1/pom.xml
index 0198483923..ae7aabe958 100644
--- a/dubbo-test/dubbo-test-spring4.1/pom.xml
+++ b/dubbo-test/dubbo-test-spring4.1/pom.xml
@@ -82,4 +82,35 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>jdk15ge-simple</id>
+ <activation>
+ <jdk>[15,</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <forkMode>once</forkMode>
+ <argLine>${argline} ${jacocoArgLine}
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/java.math=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ </argLine>
+ <systemProperties>
+ <!-- common shared -->
+ </systemProperties>
+ <!-- Activate the use of TCP to transmit events to
the plugin to fix Corrupted STDOUT issue -->
+ <forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/dubbo-test/dubbo-test-spring4.2/pom.xml
b/dubbo-test/dubbo-test-spring4.2/pom.xml
index e9745ce2da..f65855d3d1 100644
--- a/dubbo-test/dubbo-test-spring4.2/pom.xml
+++ b/dubbo-test/dubbo-test-spring4.2/pom.xml
@@ -82,4 +82,35 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>jdk15ge-simple</id>
+ <activation>
+ <jdk>[15,</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <forkMode>once</forkMode>
+ <argLine>${argline} ${jacocoArgLine}
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/java.math=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ </argLine>
+ <systemProperties>
+ <!-- common shared -->
+ </systemProperties>
+ <!-- Activate the use of TCP to transmit events to
the plugin to fix Corrupted STDOUT issue -->
+ <forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/pom.xml b/pom.xml
index c86c10a8ad..7cd6330c30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -500,7 +500,7 @@
</build>
</profile>
<profile>
- <id>jdk15ge</id>
+ <id>jdk15ge-add-open</id>
<activation>
<jdk>[15,</jdk>
</activation>
@@ -527,6 +527,29 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>jdk15ge-simple</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <forkMode>once</forkMode>
+ <argLine>${argline}
+ </argLine>
+ <systemProperties>
+ <!-- common shared -->
+ </systemProperties>
+ <!-- Activate the use of TCP to transmit events to
the plugin to fix Corrupted STDOUT issue -->
+ <forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
<profile>
<id>jdk9-compile</id>
<activation>