Skip to content
Permalink
Browse files
feat: compatibility test has worked! πŸŽ‰
  • Loading branch information
plusmancn committed Sep 15, 2021
1 parent 9dbd4a1 commit 2993ec067473a28672575cd202cb8e13e2ba80cb
Showing 14 changed files with 225 additions and 145 deletions.
@@ -15,35 +15,36 @@
# limitations under the License.

props:
app_default: dubbo-samples-migration-default
app_default_main_class: org.apache.dubbo.migration.provider.ApiProvider
app_provider: dubbo-samples-migration-provider
app_provider_main_class: org.apache.dubbo.migration.provider.ApiProvider
app_consumer: dubbo-samples-migration-consumer
zookeeper_port: 2181
dubbo_port: 20880

services:
${app_default}:
${app_provider}:
type: app
basedir: ${app_default}
mainClass: ${app_default_main_class}
basedir: ${app_provider}
mainClass: ${app_provider_main_class}
systemProps:
- dubbo.current.protocol=dubbo
- zookeeper.address=${app_default}
- zookeeper.address=${app_provider}
- dubbo.application.register-mode=all
checkPorts:
- ${zookeeper_port}
- ${dubbo_port}
checkLog: "dubbo service started"

${app_default}-test:
${app_consumer}-test:
type: test
basedir: ${app_default}
basedir: ${app_consumer}
tests:
- "**/*IT.class"
systemProps:
- dubbo.current.protocol=dubbo
- zookeeper.address=${app_default}
- zookeeper.address=${app_provider}
waitPortsBeforeRun:
- ${app_default}:${zookeeper_port}
- ${app_default}:${dubbo_port}
- ${app_provider}:${zookeeper_port}
- ${app_provider}:${dubbo_port}
depends_on:
- ${app_default}
- ${app_provider}
@@ -19,8 +19,8 @@
# Supported component versions of the test case

# Spring app
dubbo.version=3.*
spring.version=4.*, 5.*

# dubbo.dubbo-samples-migration-default.version=3.*
# dubbo.dubbo-samples-migration-default-test.version=2.7.*
# Support Compatibility test
dubbo.provider.version=3.*
dubbo.consumer.version=2.7.*
@@ -2,14 +2,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dubbo-samples-migration</artifactId>
<groupId>org.apache.dubbo</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>


<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-samples-migration-api</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>dubbo-samples-migration-consumer</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<dubbo.consumer.version>2.7.13</dubbo.consumer.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
<version>${dubbo.consumer.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.consumer.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-bom</artifactId>
<version>${dubbo.consumer.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<type>pom</type>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-samples-migration-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

<profiles>
<!-- For jdk 11 above JavaEE annotation -->
<profile>
<id>javax.annotation</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
@@ -1,5 +1,6 @@
package org.apache.dubbo.migration;
package org.apache.dubbo.migration.consumer;

import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
@@ -18,7 +19,7 @@
public class ApiConsumerIT {
@Test
public void consumeInvoke() {
String curProtocol = System.getProperty("dubbo.current.protocol", "tri");
String curProtocol = System.getProperty("dubbo.current.protocol", CommonConstants.DUBBO);
String zookeeperAddress = System.getProperty("zookeeper.address", "127.0.0.1");

ReferenceConfig<GreeterService> referenceConfig = new ReferenceConfig<>();
@@ -29,7 +30,7 @@ public void consumeInvoke() {
referenceConfig.setTimeout(100000);

DubboBootstrap bootstrap = DubboBootstrap.getInstance();
bootstrap.application(new ApplicationConfig("dubbo-demo-triple-api-consumer"))
bootstrap.application(new ApplicationConfig("dubbo-samples-migration-consumer"))
.registry(new RegistryConfig("zookeeper://" + zookeeperAddress + ":2181"))
.reference(referenceConfig)
.start();

This file was deleted.

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-samples-migration-provider</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<dubbo.provider.version>3.0.2.1</dubbo.provider.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
<version>${dubbo.provider.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.provider.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-bom</artifactId>
<version>${dubbo.provider.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<type>pom</type>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-samples-migration-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

<profiles>
<!-- For jdk 11 above JavaEE annotation -->
<profile>
<id>javax.annotation</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
@@ -16,19 +16,19 @@
*/
package org.apache.dubbo.migration.provider;

import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.migration.EmbeddedZooKeeper;
import org.apache.dubbo.migration.GreeterServiceImpl;

import org.apache.dubbo.migration.api.GreeterService;

public class ApiProvider {
public static void main(String[] args) throws InterruptedException {
String curProtocol = System.getProperty("dubbo.current.protocol", "tri");
String curProtocol = System.getProperty("dubbo.current.protocol", CommonConstants.DUBBO);
String zookeeperAddress = System.getProperty("zookeeper.address", "127.0.0.1");

new EmbeddedZooKeeper(2181, false).start();
@@ -38,7 +38,7 @@ public static void main(String[] args) throws InterruptedException {
serviceConfig.setRef(new GreeterServiceImpl());

DubboBootstrap bootstrap = DubboBootstrap.getInstance();
bootstrap.application(new ApplicationConfig("dubbo-demo-triple-api-provider"))
bootstrap.application(new ApplicationConfig("dubbo-samples-migration-provider"))
.registry(new RegistryConfig("zookeeper://" + zookeeperAddress + ":2181"))
.protocol(new ProtocolConfig(curProtocol))
.service(serviceConfig)
@@ -0,0 +1,26 @@
#
#
# 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.
#
#

###set log levels###
log4j.rootLogger=debug, stdout
###output to the console###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n

0 comments on commit 2993ec0

Please sign in to comment.