Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add javax.annotation-api, fix java 11 compatibility issues #756

Draft
wants to merge 2 commits into
base: 2.7.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion dubbo-spring-boot-compatible/autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,41 @@
<artifactId>dubbo</artifactId>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>


<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.dubbo.spring.boot.autoconfigure;

import org.apache.curator.test.TestingServer;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ConsumerConfig;
import org.apache.dubbo.config.ModuleConfig;
Expand All @@ -24,10 +25,11 @@
import org.apache.dubbo.config.ProviderConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.rpc.model.ApplicationModel;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -38,6 +40,8 @@
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;

/**
* {@link DubboAutoConfiguration} Test On single Dubbo Configuration
*
Expand All @@ -48,10 +52,10 @@
properties = {
"dubbo.application.name = dubbo-demo-application",
"dubbo.module.name = dubbo-demo-module",
"dubbo.registry.address = zookeeper://192.168.99.100:32770",
"dubbo.registry.address = zookeeper://127.0.0.1:"+ DubboAutoConfigurationOnSingleConfigTest.zkServerPort,
"dubbo.protocol.name=dubbo",
"dubbo.protocol.port=20880",
"dubbo.monitor.address=zookeeper://127.0.0.1:32770",
"dubbo.monitor.address=zookeeper://127.0.0.1:"+ DubboAutoConfigurationOnSingleConfigTest.zkServerPort,
"dubbo.provider.host=127.0.0.1",
"dubbo.consumer.client=netty"
}
Expand All @@ -62,6 +66,8 @@
@EnableAutoConfiguration
public class DubboAutoConfigurationOnSingleConfigTest {

static final int zkServerPort = 32770;

@Autowired
private ApplicationConfig applicationConfig;

Expand Down Expand Up @@ -89,6 +95,18 @@ public class DubboAutoConfigurationOnSingleConfigTest {
@Autowired
private ApplicationContext applicationContext;

private static TestingServer zkServer;

@BeforeClass
public static void setup() throws Exception {
zkServer = new TestingServer(zkServerPort, true);
}

@AfterClass
public static void shutdown() throws IOException {
zkServer.close();
}

@Before
public void init() {
ApplicationModel.reset();
Expand Down Expand Up @@ -116,14 +134,14 @@ public void testModuleConfig() {
@Test
public void testRegistryConfig() {

Assert.assertEquals("zookeeper://192.168.99.100:32770", registryConfig.getAddress());
Assert.assertEquals("zookeeper://127.0.0.1:"+ DubboAutoConfigurationOnSingleConfigTest.zkServerPort, registryConfig.getAddress());

}

@Test
public void testMonitorConfig() {

Assert.assertEquals("zookeeper://127.0.0.1:32770", monitorConfig.getAddress());
Assert.assertEquals("zookeeper://127.0.0.1:"+ DubboAutoConfigurationOnSingleConfigTest.zkServerPort, monitorConfig.getAddress());

}

Expand Down
6 changes: 6 additions & 0 deletions dubbo-spring-boot-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
</exclusions>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>

</dependencies>
</dependencyManagement>

Expand Down