Skip to content
Permalink
Browse files
Fix it for Dubbo 3.0 (#280)
  • Loading branch information
AlbumenJ committed Mar 1, 2021
1 parent 6396b09 commit 5cea6d00d56723e716056e51d066cf9e69eda847
Showing 22 changed files with 32 additions and 26 deletions.
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# SpringBoot/SpringCloud app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring-boot.version=1.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# SpringBoot/SpringCloud app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring-boot.version=1.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# SpringBoot/SpringCloud app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring-boot.version=1.*
@@ -42,8 +42,8 @@ public static void generateDubboPropertiesForGlobal() {
"dubbo.registry.address=zookeeper://" + zookeeperHost + ":2181\n" +
"dubbo.protocols.dubbo1.name=dubbo\n" +
"dubbo.protocols.dubbo1.port=20991\n" +
"dubbo.protocols.hessian1.name=hessian\n" +
"dubbo.protocols.hessian1.port=8089";
"dubbo.protocols.dubbo2.name=dubbo\n" +
"dubbo.protocols.dubbo2.port=20992";

System.out.println(str);

@@ -17,6 +17,6 @@
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.protocols.dubbo1.name=dubbo
dubbo.protocols.dubbo1.port=20991
dubbo.protocols.hessian1.name=hessian
dubbo.protocols.hessian1.port=8089
dubbo.protocols.dubbo2.name=dubbo
dubbo.protocols.dubbo2.port=20992

@@ -28,9 +28,9 @@
<dubbo:config-center address="zookeeper://${zookeeper.address:127.0.0.1}:2181"/>

<bean id="demoService" class="org.apache.dubbo.samples.configcenter.impl.DemoServiceImpl"/>
<dubbo:service protocol="hessian1" interface="org.apache.dubbo.samples.configcenter.api.DemoService"
ref="demoService"/>
<dubbo:service protocol="dubbo1" interface="org.apache.dubbo.samples.configcenter.api.DemoService"
ref="demoService"/>
<dubbo:service protocol="dubbo2" interface="org.apache.dubbo.samples.configcenter.api.DemoService"
ref="demoService"/>

</beans>
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# SpringBoot app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring-boot.version=2.*
@@ -27,6 +27,8 @@ public class CompatibleServiceDiscovery implements ServiceDiscovery {

protected ServiceInstance serviceInstance;

protected URL url;

//@Override
public ServiceInstance getLocalInstance() {
return serviceInstance;
@@ -44,7 +46,7 @@ public void update(ServiceInstance serviceInstance) throws RuntimeException {

@Override
public void initialize(URL registryURL) throws Exception {

url = registryURL;
}

@Override
@@ -62,4 +64,8 @@ public Set<String> getServices() {
return null;
}

@Override
public URL getUrl() {
return url;
}
}
@@ -43,7 +43,7 @@ public void testRegisteredProviders() throws Exception {
List<String> decodedUrls = urls.stream().map(URL::decode).collect(Collectors.toList());
Assert.assertEquals(1, decodedUrls.size());
String url = decodedUrls.get(0);
Assert.assertTrue(url.startsWith("compatible://"));
Assert.assertTrue(url.startsWith("compatible://") || url.startsWith("dubbo://"));
}

@Test
@@ -52,7 +52,7 @@ public void testRegisteredConsumers() throws Exception {
List<String> decodedUrls = urls.stream().map(URL::decode).collect(Collectors.toList());
Assert.assertFalse(decodedUrls.isEmpty());
String url = decodedUrls.get(0);
Assert.assertTrue(url.startsWith("consumer://"));
Assert.assertTrue(url.startsWith("consumer://") || url.startsWith("dubbo://"));
}

@Test
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -2,5 +2,5 @@
# Supported component versions of the test case

# Spring app
dubbo.version=2.7*, 3.*
dubbo.version=2.7*
spring.version=4.*, 5.*
@@ -20,5 +20,5 @@
# Supported component versions of the test case

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

0 comments on commit 5cea6d0

Please sign in to comment.