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/03/27 14:36:46 UTC

[incubator-servicecomb-saga] 01/03: SCB-410 Alpha Service upgraded to Spring Boot 2.0

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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit ff732723684775ab53670881f75a7b179b62616f
Author: Willem Jiang <ji...@huawei.com>
AuthorDate: Mon Mar 26 23:18:26 2018 +0800

    SCB-410 Alpha Service upgraded to Spring Boot 2.0
---
 acceptance-tests/acceptance-pack/pom.xml           | 11 +++++++-
 .../org/apache/servicecomb/saga/PackStepdefs.java  | 11 ++++++--
 alpha/alpha-server/pom.xml                         | 19 ++++++++++++++
 integration-tests/pack-tests/pom.xml               | 21 ++++++++++++++-
 .../pack-tests/src/test/resources/log4j2.xml       | 30 ++++++++++++++++++++++
 pom.xml                                            |  2 +-
 saga-persistence/saga-persistence-jpa/pom.xml      |  8 ++++++
 7 files changed, 97 insertions(+), 5 deletions(-)

diff --git a/acceptance-tests/acceptance-pack/pom.xml b/acceptance-tests/acceptance-pack/pom.xml
index aaae3fb..7baba71 100644
--- a/acceptance-tests/acceptance-pack/pom.xml
+++ b/acceptance-tests/acceptance-pack/pom.xml
@@ -86,7 +86,7 @@
                   <run>
                     <env>
                       <JAVA_OPTS>
-                        -Dspring.profiles.active=prd
+                        -Dspring.profiles.active=prd -Dspring.datasource.initialization-mode=always
                       </JAVA_OPTS>
                     </env>
                     <links>
@@ -283,6 +283,9 @@
                 <booking.byteman.port>
                   ${booking.byteman.port}
                 </booking.byteman.port>
+                <info.service.uri>
+                  ${info.service.uri}
+                </info.service.uri>
               </systemPropertyVariables>
               <argLine>${jacoco.failsafe.argLine}</argLine>
             </configuration>
@@ -331,6 +334,12 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>spring-boot-2</id>
+      <properties>
+        <info.service.uri>/actuator/info</info.service.uri>
+      </properties>
+    </profile>
   </profiles>
 
 </project>
diff --git a/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java b/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java
index 2646b1b..8d166ad 100644
--- a/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java
+++ b/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java
@@ -44,6 +44,7 @@ public class PackStepdefs implements En {
   private static final String CAR_SERVICE_ADDRESS = "car.service.address";
   private static final String HOTEL_SERVICE_ADDRESS = "hotel.service.address";
   private static final String BOOKING_SERVICE_ADDRESS = "booking.service.address";
+  private static final String INFO_SERVICE_URI = "info.service.uri";
   private static final String[] addresses = {CAR_SERVICE_ADDRESS, HOTEL_SERVICE_ADDRESS};
 
   private static final Consumer<Map<String, String>[]> NO_OP_CONSUMER = (dataMap) -> {
@@ -63,7 +64,8 @@ public class PackStepdefs implements En {
     });
 
     And("^Alpha is up and running$", () -> {
-      probe(System.getProperty(ALPHA_REST_ADDRESS));
+      String infoURI = System.getProperty(INFO_SERVICE_URI, "/info");
+      probe(System.getProperty(ALPHA_REST_ADDRESS), infoURI);
     });
 
     Given("^Install the byteman script ([A-Za-z0-9_\\.]+) to ([A-Za-z]+) Service$", (String script, String service) -> {
@@ -159,11 +161,16 @@ public class PackStepdefs implements En {
   }
 
   private void probe(String address) {
+    probe(address, "/info");
+  }
+
+  private void probe(String address, String infoURI) {
     log.info("Connecting to service address {}", address);
     given()
         .when()
-        .get(address + "/info")
+        .get(address + infoURI)
         .then()
         .statusCode(is(200));
   }
+
 }
diff --git a/alpha/alpha-server/pom.xml b/alpha/alpha-server/pom.xml
index bfb3b20..857068e 100644
--- a/alpha/alpha-server/pom.xml
+++ b/alpha/alpha-server/pom.xml
@@ -167,5 +167,24 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>spring-boot-2</id>
+      <properties>
+        <spring.boot.version>2.0.0.RELEASE</spring.boot.version>
+      </properties>
+      <!-- Need to add the dependency of log4j2 core -->
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.logging.log4j</groupId>
+          <artifactId>log4j-core</artifactId>
+          <version>2.6.2</version>
+        </dependency>
+        <dependency>
+          <groupId>com.lmax</groupId>
+          <artifactId>disruptor</artifactId>
+          <version>3.3.7</version>
+        </dependency>
+      </dependencies>
+    </profile>
   </profiles>
 </project>
diff --git a/integration-tests/pack-tests/pom.xml b/integration-tests/pack-tests/pom.xml
index 0ff8f8d..e018425 100644
--- a/integration-tests/pack-tests/pom.xml
+++ b/integration-tests/pack-tests/pom.xml
@@ -130,6 +130,25 @@
 
   <profiles>
     <profile>
+      <id>spring-boot-2</id>
+      <properties>
+        <spring.boot.version>2.0.0.RELEASE</spring.boot.version>
+      </properties>
+      <!-- Need to add the dependency of log4j2 core -->
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.logging.log4j</groupId>
+          <artifactId>log4j-core</artifactId>
+          <version>2.6.2</version>
+        </dependency>
+        <dependency>
+          <groupId>com.lmax</groupId>
+          <artifactId>disruptor</artifactId>
+          <version>3.3.7</version>
+        </dependency>
+      </dependencies>
+    </profile>
+    <profile>
       <id>docker</id>
       <build>
         <plugins>
@@ -167,7 +186,7 @@
                   <run>
                     <env>
                       <JAVA_OPTS>
-                        -Dspring.profiles.active=prd
+                        -Dspring.profiles.active=prd -Dspring.datasource.initialization-mode=always
                       </JAVA_OPTS>
                     </env>
                     <links>
diff --git a/integration-tests/pack-tests/src/test/resources/log4j2.xml b/integration-tests/pack-tests/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..cae04cb
--- /dev/null
+++ b/integration-tests/pack-tests/src/test/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<Configuration status="WARN">
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info">
+      <AppenderRef ref="Console"/>
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pom.xml b/pom.xml
index ba304d5..3a0194d 100755
--- a/pom.xml
+++ b/pom.xml
@@ -366,7 +366,7 @@
       <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
-        <version>1.10.19</version>
+        <version>2.16.0</version>
         <scope>test</scope>
       </dependency>
       <dependency>
diff --git a/saga-persistence/saga-persistence-jpa/pom.xml b/saga-persistence/saga-persistence-jpa/pom.xml
index 52d999d..f3c1cc2 100644
--- a/saga-persistence/saga-persistence-jpa/pom.xml
+++ b/saga-persistence/saga-persistence-jpa/pom.xml
@@ -85,5 +85,13 @@
       </plugin>
     </plugins>
   </build>
+  <profiles>
+    <profile>
+      <id>spring-boot-2</id>
+      <properties>
+        <spring.boot.version>2.0.0.RELEASE</spring.boot.version>
+      </properties>
+    </profile>
+  </profiles>
 
 </project>

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.