This is an automated email from the ASF dual-hosted git repository. wujimin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push: new 8ef4ca9 [SCB-1277]make sure demo and samples are normal 8ef4ca9 is described below commit 8ef4ca9f4af6742d5fb39376b40b4e4d30c1d7e1 Author: heyile <2513931...@qq.com> AuthorDate: Sun May 5 17:44:39 2019 +0800 [SCB-1277]make sure demo and samples are normal --- demo/demo-local/pom.xml | 50 --------------------- .../apache/servicecomb/demo/local/DemoLocal.java | 31 ------------- .../java/org/apache/servicecomb/demo/TestMgr.java | 12 +++++ .../demo/pojo/client/PojoClientTest.java | 15 ++++++- .../main/resources/microservices/pojo/server.yaml | 2 +- demo/pom.xml | 1 - gpg-sec.tar.enc | Bin 10256 -> 0 bytes .../servicecomb/samples/apollo}/MainServer.java | 1 + 8 files changed, 27 insertions(+), 85 deletions(-) diff --git a/demo/demo-local/pom.xml b/demo/demo-local/pom.xml deleted file mode 100644 index 146b3f1..0000000 --- a/demo/demo-local/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ -<!-- - ~ 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. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.servicecomb.demo</groupId> - <artifactId>demo-parent</artifactId> - <version>1.3.0-SNAPSHOT</version> - </parent> - <artifactId>demo-local</artifactId> - <name>Java Chassis::Demo::Local</name> - <dependencies> - <dependency> - <groupId>org.apache.servicecomb.demo</groupId> - <artifactId>pojo-server</artifactId> - </dependency> - <dependency> - <groupId>org.apache.servicecomb.demo</groupId> - <artifactId>pojo-client</artifactId> - </dependency> - </dependencies> - - <properties> - <demo.main>org.apache.servicecomb.demo.local.DemoLocal</demo.main> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - </plugin> - </plugins> - </build> -</project> diff --git a/demo/demo-local/src/main/java/org/apache/servicecomb/demo/local/DemoLocal.java b/demo/demo-local/src/main/java/org/apache/servicecomb/demo/local/DemoLocal.java deleted file mode 100644 index 05f5c82..0000000 --- a/demo/demo-local/src/main/java/org/apache/servicecomb/demo/local/DemoLocal.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -package org.apache.servicecomb.demo.local; - -import org.apache.servicecomb.foundation.common.utils.BeanUtils; -import org.apache.servicecomb.foundation.common.utils.Log4jUtils; - -public class DemoLocal { - public static void main(String[] args) throws Exception { - Log4jUtils.init(); - BeanUtils.init(); - - // TODO:当前未实现本地调用 - // DemoClient.runTest(); - } -} diff --git a/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/TestMgr.java b/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/TestMgr.java index e944472..2fecac6 100644 --- a/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/TestMgr.java +++ b/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/TestMgr.java @@ -47,6 +47,18 @@ public class TestMgr { } } + public static void checkException(Throwable exception, String msg) { + String message = exception.getMessage(); + if (!exception.getMessage().contains(msg)) { + errorList.add(new Error( + message + " | Expect " + message + " contains " + msg + " , but not")); + } + } + + public static void fail(String msg) { + errorList.add(new Error(msg)); + } + public static void summary() { if (errorList.isEmpty()) { LOGGER.info("............. test finished ............"); diff --git a/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClientTest.java b/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClientTest.java index fdc7e38..4aaa590 100644 --- a/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClientTest.java +++ b/demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClientTest.java @@ -110,8 +110,19 @@ public class PojoClientTest { } private static void testNull(Test test) { - TestMgr.check("code is 'null'", test.getTestString(null)); - TestMgr.check(null, test.wrapParam(null)); + try { + test.getTestString(null); + TestMgr.fail("Should throw exception"); + } catch (Throwable e) { + TestMgr.checkException(e, "Parameter is not valid for operation"); + } + + try { + test.wrapParam(null); + TestMgr.fail("Should throw exception"); + } catch (Throwable e) { + TestMgr.checkException(e, "Parameter is not valid for operation"); + } } private static void testChinese(Test test) { diff --git a/demo/demo-spring-boot-transport/demo-spring-boot-pojo-server/src/main/resources/microservices/pojo/server.yaml b/demo/demo-spring-boot-transport/demo-spring-boot-pojo-server/src/main/resources/microservices/pojo/server.yaml index 3fa0fda..876bb19 100644 --- a/demo/demo-spring-boot-transport/demo-spring-boot-pojo-server/src/main/resources/microservices/pojo/server.yaml +++ b/demo/demo-spring-boot-transport/demo-spring-boot-pojo-server/src/main/resources/microservices/pojo/server.yaml @@ -167,7 +167,7 @@ paths: definitions: Error: type: object - x-java-class: org.apache.servicecomb.core.exception.CommonExceptionData + x-java-class: org.apache.servicecomb.swagger.invocation.exception.CommonExceptionData properties: message: type: string diff --git a/demo/pom.xml b/demo/pom.xml index 32d1791..a4da936 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -33,7 +33,6 @@ <modules> <module>docker-build-config</module> <module>docker-run-config</module> - <module>demo-local</module> <module>demo-server-servlet</module> <module>demo-pojo</module> <module>demo-jaxrs</module> diff --git a/gpg-sec.tar.enc b/gpg-sec.tar.enc deleted file mode 100644 index 2d4f786..0000000 Binary files a/gpg-sec.tar.enc and /dev/null differ diff --git a/samples/config-apollo-sample/src/main/java/MainServer.java b/samples/config-apollo-sample/src/main/java/org/apache/servicecomb/samples/apollo/MainServer.java similarity index 96% rename from samples/config-apollo-sample/src/main/java/MainServer.java rename to samples/config-apollo-sample/src/main/java/org/apache/servicecomb/samples/apollo/MainServer.java index 8c682e8..3b94f4a 100644 --- a/samples/config-apollo-sample/src/main/java/MainServer.java +++ b/samples/config-apollo-sample/src/main/java/org/apache/servicecomb/samples/apollo/MainServer.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package org.apache.servicecomb.samples.apollo; import org.apache.servicecomb.foundation.common.utils.BeanUtils;