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/25 01:56:22 UTC

[incubator-servicecomb-java-chassis] 02/02: [SCB-684]fix review comments

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 a2bbd882bd7e3cf75633eb987bb5349cf33c0373
Author: liubao <ba...@huawei.com>
AuthorDate: Fri Jun 22 18:25:06 2018 +0800

    [SCB-684]fix review comments
---
 .../server/ProducerSchemaFactoryHolder.java        |  7 ++++--
 .../META-INF/spring/springmvc.server.bean.xml      | 25 ----------------------
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/ProducerSchemaFactoryHolder.java b/demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/ProducerSchemaFactoryHolder.java
index 766d078..687273b 100644
--- a/demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/ProducerSchemaFactoryHolder.java
+++ b/demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/ProducerSchemaFactoryHolder.java
@@ -21,9 +21,11 @@ import org.apache.servicecomb.core.BootListener;
 import org.apache.servicecomb.core.definition.SchemaMeta;
 import org.apache.servicecomb.core.definition.schema.ProducerSchemaFactory;
 import org.apache.servicecomb.demo.TestMgr;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectWriter;
@@ -34,8 +36,9 @@ import io.swagger.models.Swagger;
 import io.swagger.util.Yaml;
 
 /**
- * Created by Administrator on 2018/6/22.
+ * Testing schemas generation should be same for each boot up and accommodate swagger.
  */
+@Component
 public class ProducerSchemaFactoryHolder implements BootListener {
   private static final Logger LOGGER = LoggerFactory.getLogger(ProducerSchemaFactoryHolder.class);
 
@@ -53,7 +56,7 @@ public class ProducerSchemaFactoryHolder implements BootListener {
             new CodeFirstSpringmvcForSchema());
     String codeFirst = getSwaggerContent(meta.getSwagger());
     TestMgr.check("07a48acef4cc1a7f2387d695923c49e98951a974e4f51cf1356d6878db48888f",
-        Hashing.sha256().newHasher().putString(codeFirst, Charsets.UTF_8).hash().toString());
+        RegistryUtils.calcSchemaSummary(codeFirst));
     TestMgr.check(codeFirst.length(), 899);
 
     if (!TestMgr.isSuccess()) {
diff --git a/demo/demo-springmvc/springmvc-server/src/main/resources/META-INF/spring/springmvc.server.bean.xml b/demo/demo-springmvc/springmvc-server/src/main/resources/META-INF/spring/springmvc.server.bean.xml
deleted file mode 100644
index 7b05f28..0000000
--- a/demo/demo-springmvc/springmvc-server/src/main/resources/META-INF/spring/springmvc.server.bean.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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
-  ~
-  ~     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,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd">
-
-  <bean id="ProducerSchemaFactoryHolder"
-    class="org.apache.servicecomb.demo.springmvc.server.ProducerSchemaFactoryHolder"></bean>
-</beans>