You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/12/27 03:43:26 UTC

[servicecomb-pack] branch SCB-1093 created (now 3cddbbf)

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch SCB-1093
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git.


      at 3cddbbf  SCB-1093 Upgrade the Spring Boot version to 2.1.1 Release

This branch includes the following new commits:

     new 3cddbbf  SCB-1093 Upgrade the Spring Boot version to 2.1.1 Release

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[servicecomb-pack] 01/01: SCB-1093 Upgrade the Spring Boot version to 2.1.1 Release

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch SCB-1093
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git

commit 3cddbbfef87bd57c52bac75af8ed73dfd84ead15
Author: Willem Jiang <ji...@huawei.com>
AuthorDate: Thu Dec 27 11:43:01 2018 +0800

    SCB-1093 Upgrade the Spring Boot version to 2.1.1 Release
---
 .../org/apache/servicecomb/pack/alpha/server/AlphaConfig.java    | 5 +----
 alpha/alpha-server/src/main/resources/application.conf           | 3 +++
 .../servicecomb/pack/alpha/server/AlphaIntegrationTest.java      | 3 ++-
 .../pack/alpha/server/AlphaIntegrationWithSSLTest.java           | 3 ++-
 .../pack/alpha/server/tcc/MemoryAlphaTccServerTest.java          | 4 ++--
 .../servicecomb/pack/alpha/server/tcc/RdbAlphaTccServerTest.java | 4 +++-
 .../apache/servicecomb/pack/alpha/server/tcc/TccApplication.java | 3 ++-
 .../servicecomb/pack/alpha/server/tcc/TccCallbackEngineTest.java | 4 +++-
 .../servicecomb/pack/alpha/server/tcc/TccConfiguration.java      | 5 +++++
 .../pack/alpha/server/tcc/service/TccTxEventServiceTest.java     | 4 +++-
 .../server/tcc/service/TccTxEventServiceTransactionTest.java     | 2 ++
 pom.xml                                                          | 9 +--------
 12 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/alpha/alpha-server/src/main/java/org/apache/servicecomb/pack/alpha/server/AlphaConfig.java b/alpha/alpha-server/src/main/java/org/apache/servicecomb/pack/alpha/server/AlphaConfig.java
index 7ba3343..0078ede 100644
--- a/alpha/alpha-server/src/main/java/org/apache/servicecomb/pack/alpha/server/AlphaConfig.java
+++ b/alpha/alpha-server/src/main/java/org/apache/servicecomb/pack/alpha/server/AlphaConfig.java
@@ -47,7 +47,7 @@ import org.springframework.context.annotation.Configuration;
 
 @EntityScan(basePackages = "org.apache.servicecomb.pack.alpha")
 @Configuration
-class AlphaConfig {
+public class AlphaConfig {
   private static final Logger LOG = LoggerFactory.getLogger(AlphaConfig.class);
   private final BlockingQueue<Runnable> pendingCompensations = new LinkedBlockingQueue<>();
   private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
@@ -89,9 +89,6 @@ class AlphaConfig {
   }
 
   @Bean
-  GrpcServerConfig grpcServerConfig() { return new GrpcServerConfig(); }
-
-  @Bean
   TxConsistentService txConsistentService(
       @Value("${alpha.event.pollingInterval:500}") int eventPollingInterval,
       @Value("${alpha.event.scanner.enabled:true}") boolean eventScannerEnabled,
diff --git a/alpha/alpha-server/src/main/resources/application.conf b/alpha/alpha-server/src/main/resources/application.conf
index 993979e..c741472 100644
--- a/alpha/alpha-server/src/main/resources/application.conf
+++ b/alpha/alpha-server/src/main/resources/application.conf
@@ -15,6 +15,9 @@
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
 
+## To fix the issue that Spring Boot 2.1 disable the bean definition override by default
+spring.main.allow-bean-definition-overriding=true
+
 ###############################
 # Kamon related configuration #
 ###############################
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationTest.java
index 51c9ce7..017b19b 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationTest.java
@@ -76,7 +76,8 @@ import org.springframework.test.context.junit4.SpringRunner;
     properties = {
         "alpha.server.host=0.0.0.0",
         "alpha.server.port=8090",
-        "alpha.event.pollingInterval=1"
+        "alpha.event.pollingInterval=1",
+        "spring.main.allow-bean-definition-overriding=true"
        })
 public class AlphaIntegrationTest {
   private static final int port = 8090;
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationWithSSLTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationWithSSLTest.java
index 02f37df..a3b0dfb 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationWithSSLTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/AlphaIntegrationWithSSLTest.java
@@ -39,7 +39,8 @@ import io.netty.handler.ssl.SslProvider;
     properties = {
         "alpha.server.host=0.0.0.0",
         "alpha.server.port=8092",
-        "alpha.event.pollingInterval=1"
+        "alpha.event.pollingInterval=1",
+        "spring.main.allow-bean-definition-overriding=true"
     })
 public class AlphaIntegrationWithSSLTest extends AlphaIntegrationTest {
   private static final int port = 8092;
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/MemoryAlphaTccServerTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/MemoryAlphaTccServerTest.java
index e42af58..559c660 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/MemoryAlphaTccServerTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/MemoryAlphaTccServerTest.java
@@ -25,12 +25,12 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
-@SpringBootTest(classes = {TccApplication.class, TccConfiguration.class},
+@SpringBootTest(classes = {TccApplication.class},
     properties = {
         "alpha.server.host=0.0.0.0",
         "alpha.server.port=8190"
     })
-@ActiveProfiles("memory")
+@ActiveProfiles("memory,tccTest")
 public class MemoryAlphaTccServerTest extends AlphaTccServerTestBase {
 
   @BeforeClass
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/RdbAlphaTccServerTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/RdbAlphaTccServerTest.java
index 3e7e258..b1d20c4 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/RdbAlphaTccServerTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/RdbAlphaTccServerTest.java
@@ -21,14 +21,16 @@ import io.grpc.netty.NettyChannelBuilder;
 import org.junit.BeforeClass;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
-@SpringBootTest(classes = {TccApplication.class, TccConfiguration.class},
+@SpringBootTest(classes = {TccApplication.class},
     properties = {
         "alpha.server.host=0.0.0.0",
         "alpha.server.port=8091"
     })
+@ActiveProfiles("tccTest")
 public class RdbAlphaTccServerTest extends AlphaTccServerTestBase {
 
   @BeforeClass
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccApplication.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccApplication.java
index 5bf5afa..0562357 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccApplication.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccApplication.java
@@ -21,9 +21,10 @@ import org.apache.servicecomb.pack.alpha.server.GrpcServerConfig;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.Import;
+import org.springframework.test.context.ActiveProfiles;
 
 @SpringBootApplication(scanBasePackageClasses = GrpcTccEventService.class)
-@Import(GrpcServerConfig.class)
+@Import({GrpcServerConfig.class,TccConfiguration.class})
 public class TccApplication {
   public static void main(String[] args) {
     SpringApplication.run(TccApplication.class, args);
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccCallbackEngineTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccCallbackEngineTest.java
index d8f2bda..7491b1d 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccCallbackEngineTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccCallbackEngineTest.java
@@ -42,15 +42,17 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
-@SpringBootTest(classes = {TccApplication.class, TccConfiguration.class},
+@SpringBootTest(classes = {TccApplication.class},
     properties = {
         "alpha.server.host=0.0.0.0",
         "alpha.server.port=8092",
         "alpha.compensation.retry.delay=30"
     })
+@ActiveProfiles("tccTest")
 public class TccCallbackEngineTest {
 
   @Autowired
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccConfiguration.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccConfiguration.java
index a83cb27..7d850a3 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccConfiguration.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/TccConfiguration.java
@@ -26,8 +26,13 @@ import org.apache.servicecomb.pack.alpha.server.tcc.service.TccTxEventService;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
 
+/**
+ * This configuration is just for speeding up the integration usage.
+ */
 @Configuration
+@Profile("tccTest")
 public class TccConfiguration {
 
   @Value("${alpha.compensation.retry.delay:3000}")
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTest.java
index c424ca7..476bd0b 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTest.java
@@ -48,12 +48,14 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
-@SpringBootTest(classes = {TccApplication.class, TccConfiguration.class}, properties = {
+@SpringBootTest(classes = {TccApplication.class}, properties = {
     "spring.jpa.show-sql=true"
 })
+@ActiveProfiles("tccTest")
 public class TccTxEventServiceTest {
 
   @Autowired
diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTransactionTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTransactionTest.java
index 9788681..d3e52cc 100644
--- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTransactionTest.java
+++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/tcc/service/TccTxEventServiceTransactionTest.java
@@ -43,10 +43,12 @@ import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = {TccApplication.class, TccConfiguration.class})
+@ActiveProfiles("tccTest")
 public class TccTxEventServiceTransactionTest {
 
   @Autowired
diff --git a/pom.xml b/pom.xml
index 6594f1a..97133ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,10 +51,9 @@
     <disruptor.version>3.3.7</disruptor.version>
     <dubbo.version>2.6.4</dubbo.version>
     <spring.boot1.version>1.5.17.RELEASE</spring.boot1.version>
-    <spring.boot2.version>2.0.6.RELEASE</spring.boot2.version>
+    <spring.boot2.version>2.1.1.RELEASE</spring.boot2.version>
     <spring.boot.version>${spring.boot2.version}</spring.boot.version>
     <java.chassis.version>1.0.0</java.chassis.version>
-    <spring.version>4.3.18.RELEASE</spring.version>
     <akka.version>2.5.14</akka.version>
     <rat.version>0.12</rat.version>
     <maven.failsafe.version>2.19.1</maven.failsafe.version>
@@ -554,12 +553,6 @@
         <version>3.0.3</version>
         <scope>test</scope>
       </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-test</artifactId>
-        <version>${spring.version}</version>
-        <scope>test</scope>
-      </dependency>
     </dependencies>
   </dependencyManagement>