Skip to content

Commit

Permalink
[SCB-1277]make sure demo and samples are normal
Browse files Browse the repository at this point in the history
  • Loading branch information
heyile authored and wujimin committed May 5, 2019
1 parent cfd26b9 commit 8ef4ca9
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 85 deletions.
50 changes: 0 additions & 50 deletions demo/demo-local/pom.xml

This file was deleted.

This file was deleted.

Expand Up @@ -47,6 +47,18 @@ public static void check(Object expect, Object real) {
}
}

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 ............");
Expand Down
Expand Up @@ -110,8 +110,19 @@ private static void testEmpty(Test test) {
}

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) {
Expand Down
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion demo/pom.xml
Expand Up @@ -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>
Expand Down
Binary file removed gpg-sec.tar.enc
Binary file not shown.
Expand Up @@ -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;

Expand Down

0 comments on commit 8ef4ca9

Please sign in to comment.