You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by al...@apache.org on 2021/01/21 16:03:20 UTC
[dubbo-samples] branch master updated: http add test frameword
(#261)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new bd4cf46 http add test frameword (#261)
bd4cf46 is described below
commit bd4cf46d18ce5603296c279c98fa6b9b0f116825
Author: zhuzhenyu <87...@qq.com>
AuthorDate: Fri Jan 22 00:03:10 2021 +0800
http add test frameword (#261)
---
dubbo-samples-http/case-configuration.yml | 64 ++++++++++
dubbo-samples-http/case-versions.conf | 6 +
dubbo-samples-http/pom.xml | 194 ++++++------------------------
3 files changed, 107 insertions(+), 157 deletions(-)
diff --git a/dubbo-samples-http/case-configuration.yml b/dubbo-samples-http/case-configuration.yml
new file mode 100644
index 0000000..7d00e3b
--- /dev/null
+++ b/dubbo-samples-http/case-configuration.yml
@@ -0,0 +1,64 @@
+# 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.
+
+services:
+ zookeeper:
+ image: zookeeper:latest
+
+ dubbo-samples-http-tomcat:
+ type: app
+ basedir: .
+ mainClass: org.apache.dubbo.samples.http.HttpProvider
+ systemProps:
+ - zookeeper.address=zookeeper
+ - zookeeper.port=2181
+ - servlet.port=8080
+ - servlet.container=tomcat
+ waitPortsBeforeRun:
+ - zookeeper:2181
+ checkPorts:
+ - 8080
+ checkLog: "dubbo service started"
+
+ dubbo-samples-http-jetty:
+ type: app
+ basedir: .
+ mainClass: org.apache.dubbo.samples.http.HttpProvider
+ systemProps:
+ - zookeeper.address=zookeeper
+ - zookeeper.port=2181
+ - servlet.port=8081
+ - servlet.container=jetty
+ waitPortsBeforeRun:
+ - zookeeper:2181
+ checkPorts:
+ - 8081
+ checkLog: "dubbo service started"
+
+ dubbo-samples-http-test:
+ type: test
+ basedir: .
+ tests:
+ - "**/*IT.class"
+ systemProps:
+ - zookeeper.address=zookeeper
+ - zookeeper.port=2181
+ waitPortsBeforeRun:
+ - zookeeper:2181
+ - dubbo-samples-http-tomcat:8080
+ - dubbo-samples-http-jetty:8081
+ depends_on:
+ - dubbo-samples-http-tomcat
+ - dubbo-samples-http-jetty
+
diff --git a/dubbo-samples-http/case-versions.conf b/dubbo-samples-http/case-versions.conf
new file mode 100644
index 0000000..978f7e7
--- /dev/null
+++ b/dubbo-samples-http/case-versions.conf
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# Spring app
+dubbo.version=2.7*, 3.*
+spring.version=4.*, 5.*
diff --git a/dubbo-samples-http/pom.xml b/dubbo-samples-http/pom.xml
index cbca98c..7439410 100644
--- a/dubbo-samples-http/pom.xml
+++ b/dubbo-samples-http/pom.xml
@@ -32,29 +32,45 @@
<dubbo.version>2.7.7</dubbo.version>
<spring.version>4.3.16.RELEASE</spring.version>
<junit.version>4.12</junit.version>
- <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
- <jib-maven-plugin.version>1.2.0</jib-maven-plugin.version>
- <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
- <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
- <image.name>${project.artifactId}:${dubbo.version}</image.name>
- <java-image.name>openjdk:8</java-image.name>
- <servlet.port.1>8080</servlet.port.1>
- <servlet.container.1>tomcat</servlet.container.1>
- <servlet.port.2>8081</servlet.port.2>
- <servlet.container.2>jetty</servlet.container.2>
- <zookeeper.port>2181</zookeeper.port>
- <main-class>org.apache.dubbo.samples.http.HttpProvider</main-class>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-framework-bom</artifactId>
+ <version>${spring.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-dependencies-bom</artifactId>
+ <artifactId>dubbo-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-dependencies-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.9.10.8</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>2.9.10</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.9.10</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -62,13 +78,11 @@
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
- <version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
- <version>${dubbo.version}</version>
<type>pom</type>
</dependency>
@@ -97,6 +111,7 @@
<artifactId>spring-web</artifactId>
</dependency>
+
<dependency>
<groupId>com.github.briandilley.jsonrpc4j</groupId>
<artifactId>jsonrpc4j</artifactId>
@@ -113,152 +128,17 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
<scope>test</scope>
</dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>dubbo-integration-test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-maven-address-plugin</artifactId>
- <version>1.0-SNAPSHOT</version>
- <executions>
- <execution>
- <goals>
- <goal>local-address</goal>
- </goals>
- <configuration>
- <localAddress>dubbo-local-address</localAddress>
- </configuration>
- <phase>initialize</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.google.cloud.tools</groupId>
- <artifactId>jib-maven-plugin</artifactId>
- <version>${jib-maven-plugin.version}</version>
- <configuration>
- <from>
- <image>${java-image.name}</image>
- </from>
- <to>
- <image>${image.name}</image>
- </to>
- <container>
- <mainClass>${main-class}</mainClass>
- <environment>
- <DUBBO_IP_TO_REGISTRY>${dubbo-local-address}</DUBBO_IP_TO_REGISTRY>
- </environment>
- <jvmFlags>
- <jvmFlag>-Dzookeeper.address=${dubbo-local-address}</jvmFlag>
- </jvmFlags>
- </container>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>dockerBuild</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>${docker-maven-plugin.version}</version>
- <configuration>
- <images>
- <image>
- <name>zookeeper:latest</name>
- <run>
- <ports>
- <port>${zookeeper.port}:${zookeeper.port}</port>
- </ports>
- </run>
- </image>
- <image>
- <name>${image.name}</name>
- <run>
- <ports>
- <port>${servlet.port.1}:${servlet.port.1}</port>
- </ports>
- <wait>
- <log>dubbo service started</log>
- </wait>
- <env>
- <servlet.container>${servlet.container.1}</servlet.container>
- <servlet.port>${servlet.port.1}</servlet.port>
- </env>
- </run>
- </image>
- <image>
- <name>${image.name}</name>
- <run>
- <ports>
- <port>${servlet.port.2}:${servlet.port.2}</port>
- </ports>
- <wait>
- <log>dubbo service started</log>
- </wait>
- <env>
- <servlet.container>${servlet.container.2}</servlet.container>
- <servlet.port>${servlet.port.2}</servlet.port>
- </env>
- </run>
- </image>
- </images>
- </configuration>
- <executions>
- <execution>
- <id>start</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ </dependencies>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>${maven-failsafe-plugin.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <zookeeper.address>${dubbo-local-address}</zookeeper.address>
- </systemPropertyVariables>
- <includes>
- <include>**/*IT.java</include>
- </includes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <profiles>
<!-- For jdk 11 above JavaEE annotation -->
<profile>
<id>javax.annotation</id>
@@ -280,7 +160,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>${maven-compiler-plugin.version}</version>
+ <version>3.7.0</version>
<configuration>
<source>${source.level}</source>
<target>${target.level}</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org