You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/06/30 03:15:03 UTC

[incubator-servicecomb-java-chassis] branch master updated (652dce4 -> 060af8d)

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

liubao pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git.


    from 652dce4  [SCB-702] Deleted unwanted json-lib maven dependency
     new 2aee30c  [SCB-699] add schemaIds field in register.yaml when mock the Local service center
     new 7fab8ed  Update LocalServiceRegistryClientImpl.java
     new 060af8d  add some unit tests

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../serviceregistry/client/LocalServiceRegistryClientImpl.java   | 9 +++++++--
 .../client/LocalServiceRegistryClientImplTest.java               | 7 +++++++
 service-registry/src/test/resources/registry.yaml                | 2 ++
 3 files changed, 16 insertions(+), 2 deletions(-)


[incubator-servicecomb-java-chassis] 01/03: [SCB-699] add schemaIds field in register.yaml when mock the Local service center

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 2aee30c37e2c11a23589872cd23be61883d07a4e
Author: f00240441 <qi...@huawei.com>
AuthorDate: Tue Jun 26 19:37:20 2018 +0800

    [SCB-699] add schemaIds field in register.yaml when mock the Local service center
---
 .../serviceregistry/client/LocalServiceRegistryClientImpl.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
index 84c1516..ff3c7ea 100644
--- a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
+++ b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
@@ -118,14 +118,18 @@ public class LocalServiceRegistryClientImpl implements ServiceRegistryClient {
         String appId = (String) serviceConfig.get("appid");
         String version = (String) serviceConfig.get("version");
         String serviceId = (String) serviceConfig.get("id");
-
+        List<String> schemas = (List<String> ) serviceConfig.get("schemaIds");
+		
         Microservice microservice = new Microservice();
         microservice.setAppId(appId == null ? DEFAULT_APPLICATION_ID : appId);
         microservice.setServiceName(name);
         microservice.setVersion(version);
         microservice.setServiceId(serviceId == null ? UUID.randomUUID().toString() : serviceId);
         microserviceIdMap.put(microservice.getServiceId(), microservice);
-
+        if (schemas != null) {
+            microservice.setSchemas(schemas);
+        }
+		
         Map<String, MicroserviceInstance> instanceMap = new ConcurrentHashMap<>();
         for (Map<String, Object> instanceConfig : instancesConfig) {
           @SuppressWarnings("unchecked")


[incubator-servicecomb-java-chassis] 02/03: Update LocalServiceRegistryClientImpl.java

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 7fab8eda0ed015c40bca7757b14b85877d6bbae2
Author: fangnoo <fa...@users.noreply.github.com>
AuthorDate: Tue Jun 26 19:56:59 2018 +0800

    Update LocalServiceRegistryClientImpl.java
---
 .../serviceregistry/client/LocalServiceRegistryClientImpl.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
index ff3c7ea..7daaa03 100644
--- a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
+++ b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
@@ -118,8 +118,9 @@ public class LocalServiceRegistryClientImpl implements ServiceRegistryClient {
         String appId = (String) serviceConfig.get("appid");
         String version = (String) serviceConfig.get("version");
         String serviceId = (String) serviceConfig.get("id");
+        @SuppressWarnings("unchecked")
         List<String> schemas = (List<String> ) serviceConfig.get("schemaIds");
-		
+        	
         Microservice microservice = new Microservice();
         microservice.setAppId(appId == null ? DEFAULT_APPLICATION_ID : appId);
         microservice.setServiceName(name);
@@ -129,7 +130,7 @@ public class LocalServiceRegistryClientImpl implements ServiceRegistryClient {
         if (schemas != null) {
             microservice.setSchemas(schemas);
         }
-		
+        	
         Map<String, MicroserviceInstance> instanceMap = new ConcurrentHashMap<>();
         for (Map<String, Object> instanceConfig : instancesConfig) {
           @SuppressWarnings("unchecked")


[incubator-servicecomb-java-chassis] 03/03: add some unit tests

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 060af8d66c61cc714e1b1a11e043a56f0dae9264
Author: f00240441 <qi...@huawei.com>
AuthorDate: Wed Jun 27 19:18:32 2018 +0800

    add some unit tests
---
 .../serviceregistry/client/LocalServiceRegistryClientImplTest.java | 7 +++++++
 service-registry/src/test/resources/registry.yaml                  | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java
index 095aa8b..7e95be9 100644
--- a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java
+++ b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java
@@ -190,5 +190,12 @@ public class LocalServiceRegistryClientImplTest {
     Assert.assertEquals(200, schemasHolder.getStatusCode());
     Assert.assertTrue(schemasHolder.getValue().isEmpty());
   }
+
+  @Test
+  public void testLoadSchemaIdsFromRegistryFile() {
+    Microservice microservice = registryClient.getMicroservice("001");
+    Assert.assertThat(microservice.getSchemas().size(), Is.is(1));
+    Assert.assertTrue(microservice.getSchemas().contains("springmvcHello"));
+  }
 }
 
diff --git a/service-registry/src/test/resources/registry.yaml b/service-registry/src/test/resources/registry.yaml
index ffd495c..8cad52c 100644
--- a/service-registry/src/test/resources/registry.yaml
+++ b/service-registry/src/test/resources/registry.yaml
@@ -19,6 +19,8 @@ springmvctest:
   - id: "001"
     version: "1.0"
     appid: myapp
+    schemaIds:
+      - springmvcHello
     instances:
       - endpoints:
         - rest://127.0.0.1:8080