Skip to content
Permalink
Browse files
Merge branch 'master' into master
  • Loading branch information
chenyu2016 committed Jul 24, 2019
2 parents 64962a7 + 754e937 commit 057aaac45c444bb597c4f65dd0749a01bf569127
Showing 148 changed files with 2,658 additions and 505 deletions.
@@ -17,7 +17,8 @@ install: true

script:
- ./mvnw -B clean install -pl dubbo-maven-address-plugin
- ./mvnw -B clean verify -Pdubbo-integration-test -Djava-image.name=${JAVA_BASE_IMAGE}
- ./mvnw -B clean verify -Pdubbo-integration-test -Djava-image.name=${JAVA_BASE_IMAGE} -Ddubbo.version=2.7.4-SNAPSHOT



after_success:
@@ -31,7 +31,7 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>2.7.2</dubbo.version>
<dubbo.version>2.7.3</dubbo.version>
<spring-test.version>4.3.16.RELEASE</spring-test.version>
<junit.version>4.12</junit.version>
<docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
@@ -176,6 +176,9 @@
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<zookeeper.address>${dubbo-local-address}</zookeeper.address>
</systemPropertyVariables>
<includes>
<include>**/*IT.java</include>
</includes>
@@ -34,7 +34,6 @@ public class AnnotationProviderBootstrap {

public static void main(String[] args) throws Exception {
new EmbeddedZooKeeper(2181, false).start();
Thread.sleep(1000);

AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ProviderConfiguration.class);
context.start();
@@ -1,11 +1,12 @@
/*
* Copyright 2014 the original author or authors.
* 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
*
* Licensed 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
* 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,
@@ -15,11 +16,6 @@
*/
package org.apache.dubbo.samples.annotation;

import java.io.File;
import java.lang.reflect.Method;
import java.util.Properties;
import java.util.UUID;

import org.apache.zookeeper.server.ServerConfig;
import org.apache.zookeeper.server.ZooKeeperServerMain;
import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
@@ -29,11 +25,16 @@
import org.springframework.util.ErrorHandler;
import org.springframework.util.SocketUtils;

import java.io.File;
import java.lang.reflect.Method;
import java.util.Properties;
import java.util.UUID;

/**
* from: https://github.com/spring-projects/spring-xd/blob/v1.3.1.RELEASE/spring-xd-dirt/src/main/java/org/springframework/xd/dirt/zookeeper/ZooKeeperUtils.java
*
* <p>
* Helper class to start an embedded instance of standalone (non clustered) ZooKeeper.
*
* <p>
* NOTE: at least an external standalone server (if not an ensemble) are recommended, even for
* {@link org.springframework.xd.dirt.server.singlenode.SingleNodeApplication}
*
@@ -90,7 +91,7 @@ public EmbeddedZooKeeper() {
/**
* Construct an EmbeddedZooKeeper with the provided port.
*
* @param clientPort port for ZooKeeper server to bind to
* @param clientPort port for ZooKeeper server to bind to
*/
public EmbeddedZooKeeper(int clientPort, boolean daemon) {
this.clientPort = clientPort;
@@ -176,9 +177,7 @@ public synchronized void stop() {
Method shutdown = ZooKeeperServerMain.class.getDeclaredMethod("shutdown");
shutdown.setAccessible(true);
shutdown.invoke(zkServer);
}

catch (Exception e) {
} catch (Exception e) {
throw new RuntimeException(e);
}

@@ -188,8 +187,7 @@ public synchronized void stop() {
try {
zkServerThread.join(5000);
zkServerThread = null;
}
catch (InterruptedException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.warn("Interrupted while waiting for embedded ZooKeeper to exit");
// abandoning zk thread
@@ -227,7 +225,7 @@ public void run() {
try {
Properties properties = new Properties();
File file = new File(System.getProperty("java.io.tmpdir")
+ File.separator + UUID.randomUUID());
+ File.separator + UUID.randomUUID());
file.deleteOnExit();
properties.setProperty("dataDir", file.getAbsolutePath());
properties.setProperty("clientPort", String.valueOf(clientPort));
@@ -240,12 +238,10 @@ public void run() {
configuration.readFrom(quorumPeerConfig);

zkServer.runFromConfig(configuration);
}
catch (Exception e) {
} catch (Exception e) {
if (errorHandler != null) {
errorHandler.handleError(e);
}
else {
} else {
logger.error("Exception running embedded ZooKeeper", e);
}
}
@@ -38,7 +38,7 @@ public String replyGreeting(String name) {

private void sleepWhile() {
try {
Thread.sleep(300);
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
@@ -19,4 +19,4 @@

dubbo.application.name=samples-annotation-consumer
dubbo.registry.address=zookeeper://${zookeeper.address:127.0.0.1}:2181
dubbo.consumer.timeout=3000
dubbo.consumer.timeout=1000
@@ -49,6 +49,6 @@ public void testGreeting() throws Exception {

@Test
public void testReplyGreeting() throws Exception {
Assert.assertEquals("Annotation, fine dubbo", annotationAction.replyGreeting("dubbo"));
Assert.assertEquals("Throw Exception", annotationAction.replyGreeting("dubbo"));
}
}
@@ -29,7 +29,7 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>2.7.2</dubbo.version>
<dubbo.version>2.7.3</dubbo.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>
@@ -31,7 +31,7 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>2.7.2</dubbo.version>
<dubbo.version>2.7.3</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>
@@ -32,8 +32,8 @@
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<spring.version>4.3.16.RELEASE</spring.version>
<dubbo.version>2.7.3-SNAPSHOT</dubbo.version>
<dubbo.rpc.version>2.7.3-SNAPSHOT</dubbo.rpc.version>
<dubbo.version>2.7.3</dubbo.version>
<dubbo.rpc.version>2.7.3</dubbo.rpc.version>
<zookeeper.version>3.4.13</zookeeper.version>
<curator.version>4.0.1</curator.version>
<validation-api.version>1.1.0.Final</validation-api.version>
@@ -199,10 +199,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-configcenter-zookeeper</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
@@ -31,7 +31,7 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>2.7.2</dubbo.version>
<dubbo.version>2.7.3</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>
@@ -31,7 +31,7 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>2.7.2</dubbo.version>
<dubbo.version>2.7.3</dubbo.version>
<spring.version>4.3.16.RELEASE</spring.version>