This is an automated email from the ASF dual-hosted git repository.

zhaoyunxing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new ec0a16a3 change test configuration to test interface type registry 
(#411)
ec0a16a3 is described below

commit ec0a16a3db8100ac7daaa03e66dd8c0c5eabb8b5
Author: ken.lj <[email protected]>
AuthorDate: Mon Aug 29 10:51:36 2022 +0800

    change test configuration to test interface type registry (#411)
    
    * change test configuration to test interface type registry
    
    * update java samples
---
 helloworld/java-client/src/main/resources/log4j.properties     |  2 +-
 .../src/test/java/com/apache/dubbo/sample/TestHelloWorld.java  | 10 ++++++++--
 .../main/java/com/apache/dubbo/sample/basic/ApiProvider.java   |  2 ++
 helloworld/java-server/src/main/resources/log4j.properties     |  2 +-
 registry/nacos/go-client/conf/dubbogo.yml                      |  1 +
 registry/nacos/go-server/conf/dubbogo.yml                      |  1 +
 registry/zookeeper/go-client/conf/dubbogo.yml                  |  1 +
 registry/zookeeper/go-server/conf/dubbogo.yml                  |  1 +
 8 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/helloworld/java-client/src/main/resources/log4j.properties 
b/helloworld/java-client/src/main/resources/log4j.properties
index 6b82abab..d6ecd5ce 100644
--- a/helloworld/java-client/src/main/resources/log4j.properties
+++ b/helloworld/java-client/src/main/resources/log4j.properties
@@ -18,7 +18,7 @@
 #
 
 ###set log levels###
-log4j.rootLogger=debug, stdout
+log4j.rootLogger=info, stdout
 ###output to the console###
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.Target=System.out
diff --git 
a/helloworld/java-client/src/test/java/com/apache/dubbo/sample/TestHelloWorld.java
 
b/helloworld/java-client/src/test/java/com/apache/dubbo/sample/TestHelloWorld.java
index f417963e..fca50a1b 100644
--- 
a/helloworld/java-client/src/test/java/com/apache/dubbo/sample/TestHelloWorld.java
+++ 
b/helloworld/java-client/src/test/java/com/apache/dubbo/sample/TestHelloWorld.java
@@ -25,6 +25,7 @@ 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;
+import org.apache.dubbo.config.bootstrap.DubboBootstrap;
 import org.apache.dubbo.sample.hello.Helloworld;
 
 import java.io.IOException;
@@ -42,8 +43,13 @@ public class TestHelloWorld {
         ref.setProtocol(CommonConstants.TRIPLE);
         ref.setLazy(true);
         ref.setTimeout(100000);
-        ref.setApplication(new ApplicationConfig("demo-consumer"));
-        ref.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
+
+        DubboBootstrap.getInstance()
+                        .application(new 
ApplicationConfig("test-demo-consumer"))
+                        .registry(new 
RegistryConfig("zookeeper://127.0.0.1:2181"))
+                        .reference(ref)
+                        .start();
+
         final IGreeter iGreeter = ref.get();
 
         System.out.println("dubbo ref started");
diff --git 
a/helloworld/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiProvider.java
 
b/helloworld/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiProvider.java
index b50dc252..27f04325 100644
--- 
a/helloworld/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiProvider.java
+++ 
b/helloworld/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiProvider.java
@@ -22,6 +22,8 @@ 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 java.util.concurrent.CountDownLatch;
 
 public class ApiProvider {
diff --git a/helloworld/java-server/src/main/resources/log4j.properties 
b/helloworld/java-server/src/main/resources/log4j.properties
index 6b82abab..d6ecd5ce 100644
--- a/helloworld/java-server/src/main/resources/log4j.properties
+++ b/helloworld/java-server/src/main/resources/log4j.properties
@@ -18,7 +18,7 @@
 #
 
 ###set log levels###
-log4j.rootLogger=debug, stdout
+log4j.rootLogger=info, stdout
 ###output to the console###
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.Target=System.out
diff --git a/registry/nacos/go-client/conf/dubbogo.yml 
b/registry/nacos/go-client/conf/dubbogo.yml
index b0a5d5a5..ba7ea969 100644
--- a/registry/nacos/go-client/conf/dubbogo.yml
+++ b/registry/nacos/go-client/conf/dubbogo.yml
@@ -12,6 +12,7 @@ dubbo:
       protocol: nacos
       address: 127.0.0.1:8848
       group: myGroup # default is DEFAULT_GROUP
+      registry-type: interface
 #      namespace: 9fb00abb-278d-42fc-96bf-e0151601e4a1 # default is public
   consumer:
     references:
diff --git a/registry/nacos/go-server/conf/dubbogo.yml 
b/registry/nacos/go-server/conf/dubbogo.yml
index 446f5e32..7b4ba076 100644
--- a/registry/nacos/go-server/conf/dubbogo.yml
+++ b/registry/nacos/go-server/conf/dubbogo.yml
@@ -12,6 +12,7 @@ dubbo:
       protocol: nacos
       address: 127.0.0.1:8848
       group: myGroup # nacos group, default is DEFAULT_GROUP
+      registry-type: interface
 #      namespace: 9fb00abb-278d-42fc-96bf-e0151601e4a1 # nacos namespaceID, 
should be created before. default is public
   protocols:
     dubbo:
diff --git a/registry/zookeeper/go-client/conf/dubbogo.yml 
b/registry/zookeeper/go-client/conf/dubbogo.yml
index d088eb68..9ccbc1e1 100644
--- a/registry/zookeeper/go-client/conf/dubbogo.yml
+++ b/registry/zookeeper/go-client/conf/dubbogo.yml
@@ -5,6 +5,7 @@ dubbo:
       timeout: 3s
       address: 127.0.0.1:2181
       group: myGroup
+      registry-type: interface
   consumer:
     references:
       GreeterClientImpl:
diff --git a/registry/zookeeper/go-server/conf/dubbogo.yml 
b/registry/zookeeper/go-server/conf/dubbogo.yml
index 6637b9ff..87d0281f 100644
--- a/registry/zookeeper/go-server/conf/dubbogo.yml
+++ b/registry/zookeeper/go-server/conf/dubbogo.yml
@@ -5,6 +5,7 @@ dubbo:
       timeout: 3s
       address: 127.0.0.1:2181
       group: myGroup # default is dubbo
+      registry-type: interface
   protocols:
     triple:
       name: tri

Reply via email to