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 2022/11/01 01:50:24 UTC
[servicecomb-samples] 01/02: move integration tests from servicecomb-java-chassis to servicecomb-samples
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/servicecomb-samples.git
commit 6624b4d17de3f6f3a95ff43a696766ca4c017907
Author: liubao <bi...@qq.com>
AuthorDate: Tue Nov 1 09:28:42 2022 +0800
move integration tests from servicecomb-java-chassis to servicecomb-samples
---
java-chassis-integration-tests/README.md | 9 +
.../ci/checkstyle/checkstyle.xml | 148 +++
.../ci/checkstyle/suppressions.xml | 25 +
.../ci/copy-integration-tests-logs.sh | 22 +
.../ci/spotbugs/exclude.xml | 263 ++++
java-chassis-integration-tests/demo-schema/pom.xml | 93 ++
.../servicecomb/demo/CategorizedTestCase.java | 45 +
.../demo/CategorizedTestCaseRunner.java | 65 +
.../apache/servicecomb/demo/CodeFirstPojoIntf.java | 58 +
.../servicecomb/demo/CodeFirstRestTemplate.java | 309 +++++
.../servicecomb/demo/CommonSchemaInterface.java | 39 +
.../org/apache/servicecomb/demo/DemoConst.java | 24 +
.../org/apache/servicecomb/demo/DemoSSLCustom.java | 73 ++
.../org/apache/servicecomb/demo/EmptyObject.java | 21 +
.../java/org/apache/servicecomb/demo/Generic.java | 21 +
.../demo/RestObjectMapperWithStringMapper.java | 67 +
...stObjectMapperWithStringMapperNotWriteNull.java | 46 +
.../java/org/apache/servicecomb/demo/TestMgr.java | 123 ++
.../apache/servicecomb/demo/compute/Compute.java | 41 +
.../servicecomb/demo/compute/GenericParam.java | 75 ++
.../demo/compute/GenericParamExtended.java | 60 +
.../demo/compute/GenericParamWithJsonIgnore.java | 78 ++
.../apache/servicecomb/demo/compute/Person.java | 42 +
.../servicecomb/demo/controller/Controller.java | 32 +
.../apache/servicecomb/demo/controller/Person.java | 35 +
.../servicecomb/demo/helloworld/greeter/Hello.java | 24 +
.../servicecomb/demo/ignore/IgnoreInterface.java | 22 +
.../demo/ignore/InputModelForTestIgnore.java | 90 ++
.../demo/ignore/OutputModelForTestIgnore.java | 138 ++
.../apache/servicecomb/demo/jaxbbean/JAXBJob.java | 61 +
.../servicecomb/demo/jaxbbean/JAXBPerson.java | 108 ++
.../jaxrs/server/validation/ValidationModel.java | 57 +
.../servicecomb/demo/mapnull/ParseRequest.java | 63 +
.../servicecomb/demo/mapnull/ParseResponse.java | 72 ++
.../servicecomb/demo/model/SpecialNameModel.java | 36 +
.../demo/multiErrorCode/MultiRequest.java | 40 +
.../demo/multiErrorCode/MultiResponse200.java | 50 +
.../demo/multiErrorCode/MultiResponse400.java | 50 +
.../demo/multiErrorCode/MultiResponse500.java | 50 +
.../produceprocessor/ProduceAppXmlProcessor.java | 52 +
.../override/ProduceAppXmlProcessor.java | 52 +
.../servicecomb/demo/server/AbstractModel.java | 49 +
.../demo/server/DefaultAbstractModel.java | 35 +
.../servicecomb/demo/server/GenericsModel.java | 52 +
.../apache/servicecomb/demo/server/MapModel.java | 42 +
.../demo/server/NotRecommendedServiceInf.java | 33 +
.../demo/server/SecondAbstractModel.java | 35 +
.../org/apache/servicecomb/demo/server/Test.java | 38 +
.../servicecomb/demo/server/TestRequest.java | 63 +
.../servicecomb/demo/server/TestResponse.java | 35 +
.../org/apache/servicecomb/demo/server/User.java | 77 ++
.../demo/server/WrappedAbstractModel.java | 63 +
.../servicecomb/demo/smartcare/Application.java | 98 ++
.../apache/servicecomb/demo/smartcare/Group.java | 50 +
.../servicecomb/demo/smartcare/Response.java | 45 +
.../servicecomb/demo/smartcare/SmartCare.java | 25 +
.../apache/servicecomb/demo/utils/JAXBUtils.java | 94 ++
.../apache/servicecomb/demo/validator/Student.java | 58 +
.../apache/servicecomb/demo/validator/Teacher.java | 49 +
...comb.common.rest.codec.produce.ProduceProcessor | 19 +
.../src/main/resources/config/log4j.properties | 23 +
.../src/main/resources/microservice.yaml | 30 +
.../resources/microservices/jaxrs/compute.yaml | 201 +++
.../microservices/no-use/cse.basic.Basic/main.idl | 62 +
.../resources/microservices/no-use/hello/main.idl | 26 +
.../no-use/helloworld.Greeter/main.idl | 29 +
.../no-use/helloworld.Standard/main.idl | 34 +
.../resources/microservices/no-use/server/main.idl | 97 ++
.../microservices/pojo/helloworld.Greeter.yaml | 74 ++
.../main/resources/microservices/pojo/server.yaml | 221 ++++
.../resources/microservices/pojo/smartcare.yaml | 136 ++
.../resources/microservices/pojo/tcc-server.yaml | 108 ++
.../microservices/springmvc/controller.yaml | 136 ++
.../dynamic-config-tests/pom.xml | 54 +
.../dynamicconfig/test/DynamicConfigurationIT.java | 52 +
.../apache/dynamicconfig/test/SimApolloServer.java | 43 +
.../src/test/resources/config/log4j.z.properties | 18 +
.../src/test/resources/microservice.yaml | 33 +
.../it-common/enable-it-jar | 16 +
java-chassis-integration-tests/it-common/pom.xml | 55 +
.../org/apache/servicecomb/it/CommandReceiver.java | 101 ++
.../org/apache/servicecomb/it/ITBootListener.java | 82 ++
.../java/org/apache/servicecomb/it/ITMain.java | 27 +
.../java/org/apache/servicecomb/it/ITUtils.java | 121 ++
.../apache/servicecomb/it/schema/CommonModel.java | 29 +
.../apache/servicecomb/it/schema/DynamicColor.java | 42 +
.../org/apache/servicecomb/it/schema/Generic.java | 21 +
.../servicecomb/it/schema/PersonViewModel.java | 128 ++
.../servicecomb/it/schema/ReactiveHelloIntf.java | 23 +
.../servicecomb/it/schema/RequestBaseModel.java | 49 +
.../apache/servicecomb/it/schema/RequestModel.java | 49 +
.../servicecomb/it/schema/ResponseBaseModel.java | 49 +
.../servicecomb/it/schema/ResponseModel.java | 49 +
.../org/apache/servicecomb/it/schema/User.java | 101 ++
.../it/schema/generic/AbstractBaseService.java | 67 +
.../it/schema/generic/AbstractBean.java | 30 +
.../it/schema/generic/IBaseService.java | 40 +
.../servicecomb/it/schema/generic/IMyService.java | 21 +
.../servicecomb/it/schema/generic/PersonBean.java | 21 +
.../it/schema/objectparams/BeanParamRequest.java | 107 ++
.../servicecomb/it/schema/objectparams/Color.java | 24 +
.../schema/objectparams/FlattenObjectRequest.java | 287 +++++
.../schema/objectparams/FlattenObjectResponse.java | 264 ++++
.../objectparams/FluentSetterBeanParamRequest.java | 118 ++
.../FluentSetterFlattenObjectRequest.java | 304 +++++
.../FluentSetterFlattenObjectResponse.java | 282 +++++
.../it/schema/objectparams/GenericObjectParam.java | 88 ++
.../objectparams/InnerRecursiveObjectParam.java | 91 ++
.../schema/objectparams/MultiLayerObjectParam.java | 92 ++
.../objectparams/MultiLayerObjectParam2.java | 91 ++
.../schema/objectparams/ObjectParamTypeSchema.java | 37 +
.../it/schema/objectparams/QueryObjectModel.java | 57 +
.../schema/objectparams/RecursiveObjectParam.java | 120 ++
.../it-common/src/main/resources/microservice.yaml | 53 +
java-chassis-integration-tests/it-consumer/pom.xml | 60 +
.../org/apache/servicecomb/it/ConsumerMain.java | 232 ++++
.../java/org/apache/servicecomb/it/Consumers.java | 88 ++
.../org/apache/servicecomb/it/ResultPrinter.java | 65 +
.../servicecomb/it/deploy/DeployDefinition.java | 120 ++
.../org/apache/servicecomb/it/deploy/Deploys.java | 333 +++++
.../servicecomb/it/deploy/MicroserviceDeploy.java | 85 ++
.../it/deploy/MicroserviceDeployDefinition.java | 56 +
.../apache/servicecomb/it/deploy/NormalDeploy.java | 165 +++
.../servicecomb/it/deploy/ServiceCenterDeploy.java | 96 ++
.../servicecomb/it/deploy/SubProcessLogger.java | 122 ++
.../it/extend/engine/GateRestTemplate.java | 94 ++
.../it/extend/engine/ITAsyncClientHttpRequest.java | 42 +
.../engine/ITAsyncClientHttpRequestFactory.java | 39 +
.../it/extend/engine/ITClientHttpRequest.java | 41 +
.../extend/engine/ITClientHttpRequestFactory.java | 37 +
.../servicecomb/it/extend/engine/ITInvoker.java | 57 +
.../it/extend/engine/ITSCBAsyncRestTemplate.java | 96 ++
.../it/extend/engine/ITSCBRestTemplate.java | 76 ++
.../it/extend/engine/ITUriTemplateHandler.java | 44 +
.../apache/servicecomb/it/junit/ITJUnitUtils.java | 244 ++++
.../apache/servicecomb/it/junit/SCBFailure.java | 57 +
.../it/schema/ApiOperationJaxrsSchema.java | 50 +
.../it/schema/ApiOperationSpringMVCSchema.java | 46 +
.../servicecomb/it/schema/ApiParamJaxrsSchema.java | 69 +
.../servicecomb/it/schema/ApiParamPojoSchema.java | 34 +
.../it/schema/ApiParamSpringmvcSchema.java | 79 ++
.../it/schema/DefaultJsonValueResponse.java | 39 +
.../it/schema/IgnoreMethodJaxrsSchema.java | 35 +
.../it/schema/IgnoreMethodPojoSchema.java | 31 +
.../it/schema/IgnoreMethodSpringmvcSchema.java | 33 +
.../it/schema/IgnoreStaticMethodJaxrsSchema.java | 50 +
.../it/schema/IgnoreStaticMethodPojoSchema.java | 44 +
.../schema/IgnoreStaticMethodSpringmvcSchema.java | 46 +
.../servicecomb/it/schema/TestApiOperation.java | 74 ++
.../it/schema/generic/TestMyService.java | 91 ++
.../TestNullFieldAndDefaultValueParam.java | 139 +++
.../servicecomb/it/testcase/TestAcceptType.java | 102 ++
.../it/testcase/TestAnnotatedAttribute.java | 208 ++++
.../it/testcase/TestApiOperationOverride.java | 229 ++++
.../servicecomb/it/testcase/TestApiParam.java | 141 +++
.../servicecomb/it/testcase/TestAsyncInvoke.java | 148 +++
.../it/testcase/TestChangeTransport.java | 74 ++
.../it/testcase/TestDataTypePrimitive.java | 1317 ++++++++++++++++++++
.../testcase/TestDefaultJsonValueJaxrsSchema.java | 115 ++
.../servicecomb/it/testcase/TestDefaultMethod.java | 83 ++
.../servicecomb/it/testcase/TestDefaultValue.java | 528 ++++++++
.../servicecomb/it/testcase/TestDownload.java | 186 +++
.../it/testcase/TestDownloadSlowStreamEdge.java | 43 +
.../it/testcase/TestExceptionConvertEdge.java | 52 +
.../servicecomb/it/testcase/TestGenericEdge.java | 100 ++
.../servicecomb/it/testcase/TestIgnoreMethod.java | 45 +
.../it/testcase/TestIgnoreStaticMethod.java | 59 +
.../servicecomb/it/testcase/TestJsonView.java | 323 +++++
.../servicecomb/it/testcase/TestOptional.java | 94 ++
.../servicecomb/it/testcase/TestParamCodec.java | 95 ++
.../it/testcase/TestParamCodecEdge.java | 111 ++
.../servicecomb/it/testcase/TestReactive.java | 39 +
.../testcase/TestRequestBodySpringMvcSchema.java | 91 ++
.../it/testcase/TestRestController.java | 108 ++
.../it/testcase/TestRestServerConfigEdge.java | 141 +++
.../it/testcase/TestRestVertxTransportConfig.java | 95 ++
.../it/testcase/TestSpringConfiguration.java | 39 +
.../apache/servicecomb/it/testcase/TestTrace.java | 61 +
.../servicecomb/it/testcase/TestTraceEdge.java | 42 +
.../it/testcase/TestTransportContext.java | 37 +
.../apache/servicecomb/it/testcase/TestUpload.java | 403 ++++++
.../servicecomb/it/testcase/base/TestGeneric.java | 321 +++++
.../objectparams/TestJAXRSObjectParamType.java | 449 +++++++
.../objectparams/TestRPCObjectParamType.java | 275 ++++
.../objectparams/TestSpringMVCObjectParamType.java | 600 +++++++++
.../TestSpringMVCObjectParamTypeRestOnly.java | 108 ++
.../publicHeaders/TestPublicHeadersEdge.java | 72 ++
.../it/testcase/support/DownloadSchemaIntf.java | 39 +
.../thirdparty/Test3rdPartyInvocation.java | 277 ++++
.../weak/consumer/SpringmvcBasicRequestModel.java | 34 +
.../weak/consumer/SpringmvcBasicResponseModel.java | 34 +
.../weak/consumer/SpringmvcBasicService.java | 30 +
.../testcase/weak/consumer/TestSpringmvcBasic.java | 64 +
.../src/main/resources/certificates/server.p12 | Bin 0 -> 4541 bytes
.../src/main/resources/certificates/trust.jks | Bin 0 -> 1828 bytes
.../it-consumer/src/main/resources/logback.xml | 38 +
.../src/main/resources/microservice.yaml | 32 +
.../java/org/apache/servicecomb/it/TestMain.java | 35 +
.../it-edge/enable-it-jar | 16 +
java-chassis-integration-tests/it-edge/pom.xml | 58 +
.../apache/servicecomb/it/authentication/Auth.java | 24 +
.../servicecomb/it/authentication/encrypt/Hcr.java | 39 +
.../it/edge/DemoDispatcherWithFailureHandler.java | 63 +
.../edge/DemoDispatcherWithoutFailureHandler.java | 42 +
.../org/apache/servicecomb/it/edge/EdgeConst.java | 22 +
.../apache/servicecomb/it/edge/EdgeDispatcher.java | 57 +
.../org/apache/servicecomb/it/edge/EdgeMain.java | 26 +
.../servicecomb/it/edge/PreLoadBootListener.java | 48 +
.../context/InheritInvocationContextFilter.java | 73 ++
.../it/edge/converter/CustomException.java | 53 +
.../edge/converter/CustomExceptionConverter.java | 48 +
.../servicecomb/it/edge/encrypt/Encrypt.java | 28 +
.../it/edge/encrypt/EncryptContext.java | 46 +
.../it/edge/encrypt/EncryptEdgeDispatcher.java | 113 ++
.../it/edge/encrypt/EncryptEdgeInvocation.java | 34 +
.../it/edge/encrypt/filter/DecodeBodyFilter.java | 73 ++
.../encrypt/filter/EdgeSignatureRequestFilter.java | 67 +
.../filter/EdgeSignatureResponseFilter.java | 78 ++
.../it/edge/encrypt/filter/UserIdFilter.java | 46 +
.../it/edge/filter/CheckRawFormParamFilter.java | 73 ++
.../servicecomb/it/edge/handler/AuthHandler.java | 74 ++
.../it/edge/handler/ExceptionConvertHandler.java | 44 +
...servicecomb.common.rest.filter.HttpServerFilter | 23 +
....exception.ExceptionToProducerResponseConverter | 18 +
...cecomb.transport.rest.vertx.VertxHttpDispatcher | 21 +
.../src/main/resources/config/cse.handler.xml | 21 +
.../it-edge/src/main/resources/logback.xml | 38 +
.../it-edge/src/main/resources/microservice.yaml | 199 +++
.../enable-it-jar | 16 +
.../it-producer-deploy-springboot2-servlet/pom.xml | 113 ++
.../it/SpringBoot2ServletApplication.java | 41 +
.../src/main/resources/application.yaml | 23 +
.../src/main/resources/logback.xml | 38 +
.../src/main/resources/microservice.yaml | 24 +
.../enable-it-jar | 16 +
.../pom.xml | 114 ++
.../org/apache/servicecomb/it/ConditionBean.java | 32 +
.../it/SpringBoot2StandaloneApplication.java | 42 +
.../src/main/resources/application.yaml | 19 +
.../src/main/resources/logback.xml | 38 +
.../src/main/resources/microservice.yaml | 27 +
.../it-producer/enable-it-jar | 16 +
java-chassis-integration-tests/it-producer/pom.xml | 42 +
.../apache/servicecomb/it/BaseProducerMain.java | 23 +
.../org/apache/servicecomb/it/DemoSSLCustom.java | 40 +
.../it/schema/AcceptTypeJaxrsSchema.java | 42 +
.../it/schema/AcceptTypeSpringmvcSchema.java | 36 +
.../schema/AnnotatedAttributeSpringmvcSchema.java | 74 ++
.../it/schema/ApiOperationJaxrsSchema.java | 47 +
.../it/schema/ApiOperationSpringmvcSchema.java | 41 +
.../it/schema/ApiOpertionPojoSchema.java | 35 +
.../it/schema/DataTypeAsyncJaxrsSchema.java | 53 +
.../servicecomb/it/schema/DataTypeJaxrsSchema.java | 280 +++++
.../servicecomb/it/schema/DataTypePojoSchema.java | 66 +
.../it/schema/DataTypeSpringmvcSchema.java | 222 ++++
.../it/schema/DefaultJsonValueJaxrsSchema.java | 47 +
.../it/schema/DefaultJsonValueRequest.java | 51 +
.../it/schema/DefaultJsonValueResponse.java | 39 +
.../it/schema/DefaultValueJaxrsSchema.java | 104 ++
.../it/schema/DefaultValueSpringmvcSchema.java | 199 +++
.../servicecomb/it/schema/DownloadSchema.java | 244 ++++
.../it/schema/EdgeExceptionConvertSchema.java | 38 +
.../apache/servicecomb/it/schema/EmptyScheam.java | 26 +
.../servicecomb/it/schema/GenericSchema.java | 116 ++
.../servicecomb/it/schema/JsonViewJaxrsSchema.java | 118 ++
.../servicecomb/it/schema/JsonViewPojoSchema.java | 83 ++
.../it/schema/JsonViewSpringmvcSchema.java | 98 ++
.../servicecomb/it/schema/OptionalJaxrsSchema.java | 42 +
.../servicecomb/it/schema/OptionalPojoSchema.java | 36 +
.../it/schema/OptionalSpringmvcSchema.java | 50 +
.../servicecomb/it/schema/ParamCodecSchema.java | 65 +
.../it/schema/ParamCodecSchemaRestOnly.java | 38 +
.../it/schema/ReactiveWithIntfSchema.java | 33 +
.../it/schema/RequestBodySpringMvcSchema.java | 38 +
.../schema/RestControllerEmptyMappingSchema.java | 31 +
.../it/schema/RestControllerSchema.java | 38 +
.../RestControllerWithRequestMappingSchema.java | 31 +
.../schema/RestControllerWithRestSchemaSchema.java | 33 +
.../it/schema/RestVertxTransportConfigSchema.java | 47 +
.../apache/servicecomb/it/schema/TraceSchema.java | 51 +
.../it/schema/TransportContextSchema.java | 31 +
.../it/schema/TransportJaxrsSchema.java | 35 +
.../servicecomb/it/schema/TransportPojoSchema.java | 33 +
.../it/schema/TransportSpringmvcSchema.java | 34 +
.../servicecomb/it/schema/UploadJaxrsSchema.java | 160 +++
.../it/schema/UploadSpringmvcSchema.java | 118 ++
.../servicecomb/it/schema/generic/MyEndpoint.java | 28 +
.../it/schema/generic/MyEndpointWithInterface.java | 70 ++
.../servicecomb/it/schema/generic/MyService.java | 69 +
.../objectparams/JAXRSObjectParamTypeSchema.java | 94 ++
.../objectparams/RPCObjectParamTypeSchema.java | 60 +
.../SpringMVCObjectParamTypeSchema.java | 131 ++
.../SpringMVCObjectRestSchemaRestOnly.java | 54 +
.../TestNullFieldAndDefaultValueParamProducer.java | 127 ++
.../EdgePublicHeadersJaxrsSchema.java | 43 +
.../EdgePublicHeadersSpringMVCSchema.java | 42 +
.../weak/provider/SpringmvcBasicEndpoint.java | 50 +
.../weak/provider/SpringmvcBasicRequestModel.java | 39 +
.../weak/provider/SpringmvcBasicResponseModel.java | 39 +
.../src/main/resources/certificates/server.p12 | Bin 0 -> 4541 bytes
.../src/main/resources/certificates/trust.jks | Bin 0 -> 1828 bytes
.../it-producer/src/main/resources/logback.xml | 38 +
.../src/main/resources/microservice.yaml | 40 +
java-chassis-integration-tests/jaxrs-tests/pom.xml | 68 +
.../demo/jaxrs/tests/JaxrsIntegrationTestBase.java | 338 +++++
.../demo/jaxrs/tests/JaxrsTestMain.java | 29 +
.../demo/jaxrs/tests/RawJaxrsIntegrationTest.java | 28 +
.../demo/jaxrs/tests/endpoints/CodeFirstJaxrs.java | 83 ++
.../endpoints/EnglishGreetingRestEndpoint.java | 46 +
.../jaxrs/tests/endpoints/SchemaFirstJaxrs.java | 57 +
.../tests/endpoints/SchemaFirstJaxrsImpl.java | 54 +
.../endpoints/SomeAbstractJaxrsRestEndpoint.java | 133 ++
.../src/test/resources/config/log4j.z.properties | 18 +
.../src/test/resources/log4j.properties | 20 +
.../src/test/resources/microservice.yaml | 32 +
.../resources/microservices/jaxrs/schemaFirst.yaml | 291 +++++
java-chassis-integration-tests/pojo-test/pom.xml | 68 +
.../demo/pojo/test/PojoIntegrationTestBase.java | 303 +++++
.../servicecomb/demo/pojo/test/PojoService.java | 58 +
.../servicecomb/demo/pojo/test/PojoTestMain.java | 29 +
.../demo/pojo/test/RawPojoIntegrationTest.java | 28 +
.../servicecomb/demo/pojo/test/SomePojoConfig.java | 62 +
.../demo/pojo/test/endpoints/CodeFirstPojo.java | 108 ++
.../demo/pojo/test/endpoints/HelloImpl.java | 40 +
.../demo/pojo/test/endpoints/SmartCareImpl.java | 58 +
.../demo/pojo/test/endpoints/TestImpl.java | 109 ++
.../src/test/resources/config/log4j.z.properties | 21 +
.../pojo-test/src/test/resources/microservice.yaml | 27 +
java-chassis-integration-tests/pom.xml | 211 ++++
.../spring-jaxrs-tests/pom.xml | 73 ++
.../jaxrs/tests/JaxrsSpringIntegrationTest.java | 58 +
.../demo/jaxrs/tests/JaxrsSpringMain.java | 30 +
.../src/test/resources/application-dev.yaml | 19 +
.../src/test/resources/application-prod.yaml | 19 +
.../src/test/resources/application.properties | 19 +
.../src/test/resources/application.yaml | 21 +
.../src/test/resources/application.yml | 24 +
.../src/test/resources/log4j.properties | 23 +
.../src/test/resources/microservice.yaml | 25 +
.../spring-pojo-connection-limit-test/pom.xml | 60 +
.../PojoSpringConnectionLimitIntegrationTest.java | 42 +
.../src/test/resources/log4j.properties | 20 +
.../src/test/resources/microservice.yaml | 29 +
.../spring-pojo-tests/pom.xml | 61 +
.../demo/pojo/test/PojoSpringIntegrationTest.java | 38 +
.../src/test/resources/log4j.properties | 23 +
.../src/test/resources/microservice.yaml | 21 +
.../springmvc-tests/common/pom.xml | 48 +
.../tests/SpringMvcIntegrationTestBase.java | 699 +++++++++++
.../tests/endpoints/CodeFirstSpringmvc.java | 171 +++
.../tests/endpoints/CodeFirstSpringmvcBase.java | 143 +++
...eFirstSpringmvcSimplifiedMappingAnnotation.java | 175 +++
.../springmvc/tests/endpoints/ControllerBase.java | 50 +
.../springmvc/tests/endpoints/ControllerImpl.java | 66 +
.../ControllerSimplifiedMappingAnnotationImpl.java | 67 +
.../endpoints/EnglishGreetingRestEndpoint.java | 45 +
.../endpoints/EnglishGreetingRestEndpointBase.java | 29 +
...ingSimplifiedMappingAnnotationRestEndpoint.java | 45 +
.../endpoints/FrenchGreetingRestEndpoint.java | 38 +
.../endpoints/FrenchGreetingRestEndpointBase.java | 24 +
...ingSimplifiedMappingAnnotationRestEndpoint.java | 38 +
.../springmvc-tests/connection-limit/pom.xml | 46 +
.../tests/RawSpringMvcIntegrationTest.java | 56 +
.../demo/springmvc/tests/SpringMvcTestMain.java | 29 +
.../src/test/resources/config/log4j.z.properties | 21 +
.../src/test/resources/microservice.yaml | 33 +
.../general-with-springboot/pom.xml | 62 +
.../tests/SpringMvcSpringIntegrationTest.java | 39 +
.../demo/springmvc/tests/SpringMvcSpringMain.java | 26 +
.../src/test/resources/log4j.properties | 20 +
.../src/test/resources/logback.xml | 31 +
.../src/test/resources/microservice.yaml | 32 +
.../springmvc-tests/general/pom.xml | 46 +
.../tests/RawSpringMvcIntegrationTest.java | 35 +
.../demo/springmvc/tests/SpringMvcTestMain.java | 29 +
.../src/test/resources/config/log4j.z.properties | 21 +
.../general/src/test/resources/microservice.yaml | 32 +
.../springmvc-tests/pom.xml | 57 +
.../simplified-mapping-with-springboot/pom.xml | 62 +
...SimplifiedMappingAnnotationIntegrationTest.java | 40 +
.../demo/springmvc/tests/SpringMvcSpringMain.java | 26 +
.../src/test/resources/log4j.properties | 20 +
.../src/test/resources/logback.xml | 31 +
.../src/test/resources/microservice.yaml | 32 +
.../springmvc-tests/simplified-mapping/pom.xml | 46 +
...SimplifiedMappingAnnotationIntegrationTest.java | 36 +
.../demo/springmvc/tests/SpringMvcTestMain.java | 29 +
.../src/test/resources/config/log4j.z.properties | 21 +
.../src/test/resources/microservice.yaml | 32 +
java-chassis-integration-tests/test-common/pom.xml | 75 ++
.../apache/servicecomb/tests/EmbeddedAppender.java | 105 ++
.../org/apache/servicecomb/tests/Log4jConfig.java | 39 +
.../tests/tracing/TraceContextConfig.java | 102 ++
.../servicecomb/tests/tracing/TracingTestBase.java | 109 ++
.../tracing-tests/pom.xml | 90 ++
.../apache/servicecomb/tests/tracing/SlowRepo.java | 22 +
.../servicecomb/tests/tracing/SlowRepoImpl.java | 38 +
.../tests/tracing/SomeTracedController.java | 55 +
.../tests/tracing/TracedJaxrsController.java | 57 +
.../servicecomb/tests/tracing/TracedPojo.java | 23 +
.../tests/tracing/TracedPojoConfig.java | 41 +
.../servicecomb/tests/tracing/TracedPojoImpl.java | 34 +
.../servicecomb/tests/tracing/TracingTestMain.java | 26 +
.../tracing/ZipkinTracingIntegrationTest.java | 53 +
.../src/test/resources/log4j.properties | 18 +
.../src/test/resources/microservice.yaml | 44 +
406 files changed, 31517 insertions(+)
diff --git a/java-chassis-integration-tests/README.md b/java-chassis-integration-tests/README.md
new file mode 100644
index 0000000..5568c7b
--- /dev/null
+++ b/java-chassis-integration-tests/README.md
@@ -0,0 +1,9 @@
+This module contains integrated test cases. Running these test cases, should include profile
+
+```shell script
+-Pit
+```
+
+[java-chassis-samples][java-chassis-samples] project provides a lot of samples.
+
+[java-chassis-samples]: https://github.com/apache/servicecomb-samples/tree/master/java-chassis-samples
diff --git a/java-chassis-integration-tests/ci/checkstyle/checkstyle.xml b/java-chassis-integration-tests/ci/checkstyle/checkstyle.xml
new file mode 100644
index 0000000..8c34ac0
--- /dev/null
+++ b/java-chassis-integration-tests/ci/checkstyle/checkstyle.xml
@@ -0,0 +1,148 @@
+<?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.
+ -->
+
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+ This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+ Checkstyle-Configuration: paas
+ Description: none
+-->
+<module name="Checker">
+ <module name="FileTabCharacter">
+ <!-- Checks that there are no tab characters in the file. -->
+ </module>
+ <module name="NewlineAtEndOfFile">
+ </module>
+ <module name="RegexpSingleline">
+ <property name="format" value="Throwables.propagate\("/>
+ <property name="message" value="Throwables.propagate is deprecated"/>
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RegexpSingleline">
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Trailing whitespace"/>
+ <property name="severity" value="error"/>
+ </module>
+ <module name="TreeWalker">
+ <module name="AvoidStarImport"/>
+ <module name="EmptyStatement"/>
+ <module name="LeftCurly">
+ <!-- Checks for placement of the left curly brace ('{'). -->
+ <property name="severity" value="error"/>
+ </module>
+ <module name="LocalFinalVariableName">
+ <!-- Validates identifiers for local final variables against the
+ expression "^[a-z][a-zA-Z0-9]*$". -->
+ <property name="severity" value="error"/>
+ </module>
+ <module name="LocalVariableName">
+ <!-- Validates identifiers for local variables against the
+ expression "^[a-z][a-zA-Z0-9]*$". -->
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ModifierOrder"/>
+
+ <!-- check if a switch statement has a default clause -->
+ <module name="MissingSwitchDefault"/>
+
+ <module name="NoWhitespaceAfter">
+ <!-- Checks that there is no whitespace after various unary operators.
+ Linebreaks are allowed.
+ -->
+ <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS,
+ UNARY_PLUS"/>
+ <property name="allowLineBreaks" value="true"/>
+ <property name="severity" value="error"/>
+ </module>
+ <!-- Checks for braces around if and else blocks -->
+ <module name="NeedBraces">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
+ </module>
+ <module name="NoWhitespaceBefore">
+ <!-- Checks that there is no whitespace before various unary operators.
+ Linebreaks are allowed.
+ -->
+ <property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/>
+ <property name="allowLineBreaks" value="true"/>
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ParenPad">
+ <!-- Checks that there is no whitespace before close parens or after
+ open parens.
+ -->
+ <property name="severity" value="error"/>
+ </module>
+ <!-- Checks for over-complicated boolean expressions. -->
+ <module name="SimplifyBooleanExpression"/>
+ <module name="RedundantImport"/>
+ <module name="RedundantModifier">
+ <property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
+ </module>
+ <module name="RightCurly">
+ <!-- Checks right curlies on CATCH, ELSE, and TRY blocks are on
+ the same line. e.g., the following example is fine:
+ <pre>
+ if {
+ ...
+ } else
+ </pre>
+ -->
+ <!-- This next example is not fine:
+ <pre>
+ if {
+ ...
+ }
+ else
+ </pre>
+ -->
+ <property name="option" value="same"/>
+ <property name="severity" value="error"/>
+ </module>
+ <module name="UnusedImports">
+ <property name="processJavadoc" value="true"/>
+ </module>
+ <module name="UpperEll">
+ <!-- Checks that long constants are defined with an upper ell.-->
+ <property name="severity" value="error"/>
+ </module>
+ <module name="WhitespaceAfter">
+ <!-- Checks that commas, semicolons and typecasts are followed by
+ whitespace.
+ -->
+ <property name="tokens" value="COMMA, SEMI, TYPECAST"/>
+ </module>
+ <module name="WhitespaceAround">
+ <!-- Checks that various tokens are surrounded by whitespace.
+ This includes most binary operators and keywords followed
+ by regular or curly braces.
+ -->
+ <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR,
+ BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
+ EQUAL, GE, GT, LAND, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
+ LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
+ LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
+ MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION,
+ SL, SL_ASSIGN, SR_ASSIGN, STAR, STAR_ASSIGN"/>
+ <property name="severity" value="error"/>
+ </module>
+ </module>
+</module>
diff --git a/java-chassis-integration-tests/ci/checkstyle/suppressions.xml b/java-chassis-integration-tests/ci/checkstyle/suppressions.xml
new file mode 100644
index 0000000..57e56d5
--- /dev/null
+++ b/java-chassis-integration-tests/ci/checkstyle/suppressions.xml
@@ -0,0 +1,25 @@
+<?xml version="1.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.
+ -->
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
+ "https://checkstyle.org/dtds/suppressions_1_2.dtd">
+
+<suppressions>
+ <suppress files="[/\\]target[/\\]" checks=".*" />
+</suppressions>
diff --git a/java-chassis-integration-tests/ci/copy-integration-tests-logs.sh b/java-chassis-integration-tests/ci/copy-integration-tests-logs.sh
new file mode 100644
index 0000000..67c792e
--- /dev/null
+++ b/java-chassis-integration-tests/ci/copy-integration-tests-logs.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+#
+# 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.
+#
+
+mkdir integration-tests-logs
+cp ./integration-tests/it-consumer/servicecomb-integration-*.log integration-tests-logs/
diff --git a/java-chassis-integration-tests/ci/spotbugs/exclude.xml b/java-chassis-integration-tests/ci/spotbugs/exclude.xml
new file mode 100644
index 0000000..0bd1332
--- /dev/null
+++ b/java-chassis-integration-tests/ci/spotbugs/exclude.xml
@@ -0,0 +1,263 @@
+<?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.
+
+-->
+<FindBugsFilter
+ xmlns="https://github.com/spotbugs/filter/3.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
+
+
+ <!-- pattern sort by alpha -->
+
+ <Match>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="BC_VACUOUS_INSTANCEOF"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DC_DOUBLECHECK"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DC_PARTIALLY_CONSTRUCTED"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ <Class name="org.apache.servicecomb.demo.jaxrs.server.beanParam.BeanParamTestService"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ <Class name="org.apache.servicecomb.it.deploy.Deploys"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ <Class name="org.apache.servicecomb.it.testcase.TestParamCodecEdge"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ <Class name="org.apache.servicecomb.it.testcase.TestRestServerConfigEdge"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="DM_EXIT"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EC_UNRELATED_TYPES"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EI_EXPOSE_STATIC_REP2"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="ICAST_INTEGER_MULTIPLY_CAST_TO_LONG"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="IS2_INCONSISTENT_SYNC"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MF_CLASS_MASKS_FIELD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_CANNOT_BE_FINAL"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_EXPOSE_REP"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_MUTABLE_ARRAY"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_MUTABLE_COLLECTION_PKGPROTECT"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_OOI_PKGPROTECT"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_SHOULD_BE_FINAL"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="MS_PKGPROTECT"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NM_CLASS_NOT_EXCEPTION"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NM_METHOD_NAMING_CONVENTION"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
+ <Class name="org.apache.servicecomb.it.testcase.objectparams.TestJAXRSObjectParamType"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
+ <Class name="org.apache.servicecomb.it.testcase.objectparams.TestRPCObjectParamType"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
+ <Class name="org.apache.servicecomb.it.testcase.objectparams.TestSpringMVCObjectParamType"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_NONNULL_RETURN_VIOLATION"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_NULL_ON_SOME_PATH"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="OBL_UNSATISFIED_OBLIGATION"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="RC_REF_COMPARISON"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="REC_CATCH_EXCEPTION"/>
+ <Class name="org.apache.servicecomb.demo.springmvc.SpringmvcClient"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="REFLC_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_CLASS"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="RV_NEGATING_RESULT_OF_COMPARETO"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="RV_RETURN_VALUE_IGNORED"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="SR_NOT_CHECKED"/>
+ <Class name="org.apache.servicecomb.demo.springmvc.client.ConsumerTestsAfterBootup"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"/>
+ </Match>
+
+ <Match>
+ <Bug pattern="VA_FORMAT_STRING_USES_NEWLINE"/>
+ </Match>
+
+</FindBugsFilter>
diff --git a/java-chassis-integration-tests/demo-schema/pom.xml b/java-chassis-integration-tests/demo-schema/pom.xml
new file mode 100644
index 0000000..1f4a451
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/pom.xml
@@ -0,0 +1,93 @@
+<!--
+ ~ 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>
+ <artifactId>integration-tests</artifactId>
+ <groupId>org.apache.servicecomb.tests</groupId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>demo-schema</artifactId>
+ <name>Java Chassis::Demo::Schema</name>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>handler-bizkeeper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>handler-loadbalance</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>transport-highway</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>transport-rest-vertx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>transport-rest-servlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>handler-flowcontrol-qps</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>swagger-generator-springmvc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>foundation-test-scaffolding</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>inspector</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>config/log4j.eclipse.properties</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CategorizedTestCase.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CategorizedTestCase.java
new file mode 100644
index 0000000..c526787
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CategorizedTestCase.java
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+public interface CategorizedTestCase {
+ /**
+ * test case which only successful in REST transport
+ */
+ default void testRestTransport() throws Exception {
+
+ }
+
+ /**
+ * test case which only successful in HIGHWAY transport
+ */
+ default void testHighwayTransport() throws Exception {
+
+ }
+
+ /**
+ * test case which successful in both REST and HIGHWAY transport
+ */
+ default void testAllTransport() throws Exception {
+
+ }
+
+ default String getMicroserviceName() {
+ return null;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CategorizedTestCaseRunner.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CategorizedTestCaseRunner.java
new file mode 100644
index 0000000..47dd8b9
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CategorizedTestCaseRunner.java
@@ -0,0 +1,65 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
+import org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CategorizedTestCaseRunner {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CategorizedTestCaseRunner.class);
+
+ public static void runCategorizedTestCase(String microserviceName) throws Exception {
+ Map<String, CategorizedTestCase> tests = BeanUtils.getContext().getBeansOfType(CategorizedTestCase.class);
+ for (String transport : DemoConst.transports) {
+ for (CategorizedTestCase testCase : tests.values()) {
+
+ try {
+ if (testCase.getMicroserviceName() != null) {
+ changeTransport(testCase.getMicroserviceName(), transport);
+ } else {
+ changeTransport(microserviceName, transport);
+ }
+
+ testCase.testAllTransport();
+ if ("rest".equals(transport)) {
+ testCase.testRestTransport();
+ } else if ("highway".equals(transport)) {
+ testCase.testHighwayTransport();
+ }
+ } catch (Exception e) {
+ LOGGER.error("run categorized test case " +
+ testCase.getClass().getName() +
+ " failed.", e);
+ TestMgr.failed("run categorized test case " +
+ testCase.getClass().getName() +
+ " failed, reason " + e.getMessage(),
+ e);
+ }
+ }
+ }
+ }
+
+ public static void changeTransport(String microserviceName, String transport) {
+ ArchaiusUtils.setProperty("servicecomb.references.transport." + microserviceName, transport);
+ TestMgr.setMsg(microserviceName, transport);
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CodeFirstPojoIntf.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CodeFirstPojoIntf.java
new file mode 100644
index 0000000..38779b3
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CodeFirstPojoIntf.java
@@ -0,0 +1,58 @@
+/*
+ * 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;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.servicecomb.demo.compute.Person;
+import org.apache.servicecomb.demo.mapnull.ParseRequest;
+import org.apache.servicecomb.demo.mapnull.ParseResponse;
+import org.apache.servicecomb.demo.server.MapModel;
+import org.apache.servicecomb.demo.server.User;
+
+public interface CodeFirstPojoIntf {
+ ParseResponse parse(ParseRequest request);
+
+ MapModel testMapModel(MapModel model);
+
+ Map<String, String> testMap(Map<String, String> map);
+
+ Map<String, User> testUserMap(Map<String, User> userMap);
+
+ List<User> testUserArray(List<User> users);
+
+ String[] testStrings(String[] input);
+
+ byte[] testBytes(byte[] input);
+
+ int reduce(int a, int b);
+
+ Date addDate(Date date, long second);
+
+ Person sayHello(Person user);
+
+ String saySomething(String prefix, Person user);
+
+ String sayHi(String name);
+
+ boolean isTrue();
+
+ String addString(List<String> s);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CodeFirstRestTemplate.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CodeFirstRestTemplate.java
new file mode 100644
index 0000000..c40c4da
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CodeFirstRestTemplate.java
@@ -0,0 +1,309 @@
+/*
+ * 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;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.servicecomb.common.rest.codec.produce.ProduceProcessorManager;
+import org.apache.servicecomb.core.Const;
+import org.apache.servicecomb.demo.compute.Person;
+import org.apache.servicecomb.demo.ignore.InputModelForTestIgnore;
+import org.apache.servicecomb.demo.ignore.OutputModelForTestIgnore;
+import org.apache.servicecomb.demo.jaxbbean.JAXBJob;
+import org.apache.servicecomb.demo.jaxbbean.JAXBPerson;
+import org.apache.servicecomb.demo.server.User;
+import org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils;
+import org.apache.servicecomb.registry.RegistrationManager;
+import org.apache.servicecomb.swagger.invocation.context.ContextUtils;
+import org.apache.servicecomb.swagger.invocation.context.InvocationContext;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+import io.vertx.core.json.JsonObject;
+
+public class CodeFirstRestTemplate {
+ protected void changeTransport(String microserviceName, String transport) {
+ ArchaiusUtils.setProperty("servicecomb.references.transport." + microserviceName, transport);
+ TestMgr.setMsg(microserviceName, transport);
+ }
+
+ public void testCodeFirst(RestTemplate template, String microserviceName, String basePath) {
+ String cseUrlPrefix = "cse://" + microserviceName + basePath;
+ changeTransport(microserviceName, "highway");
+ testOnlyHighway(template, cseUrlPrefix);
+
+ changeTransport(microserviceName, Const.RESTFUL);
+ testOnlyRest(microserviceName, template, cseUrlPrefix);
+
+ for (String transport : DemoConst.transports) {
+ changeTransport(microserviceName, transport);
+ testAllTransport(microserviceName, template, cseUrlPrefix);
+ }
+ }
+
+ protected void testAllTransport(String microserviceName, RestTemplate template, String cseUrlPrefix) {
+ testCodeFirstUserMap(template, cseUrlPrefix);
+ testCodeFirstTextPlain(template, cseUrlPrefix);
+ testCodeFirstAppXml(template, cseUrlPrefix);
+ testCodeFirstBytes(template, cseUrlPrefix);
+ testCseResponse(microserviceName, template, cseUrlPrefix);
+ testCodeFirstAddDate(template, cseUrlPrefix);
+
+ testCodeFirstAdd(template, cseUrlPrefix);
+ testCodeFirstAddString(template, cseUrlPrefix);
+ testCodeFirstIsTrue(template, cseUrlPrefix);
+ testCodeFirstSayHi2(template, cseUrlPrefix);
+ testCodeFirstSayHi(template, cseUrlPrefix);
+ testCodeFirstSaySomething(template, cseUrlPrefix);
+ testCodeFirstSayHello(template, cseUrlPrefix);
+ testCodeFirstReduce(template, cseUrlPrefix);
+
+ testTraceIdOnContextContainsTraceId(template, cseUrlPrefix);
+
+ testRawJson(template, cseUrlPrefix);
+ }
+
+ protected void testOnlyHighway(RestTemplate template, String cseUrlPrefix) {
+
+ }
+
+ protected void testOnlyRest(String microserviceName, RestTemplate template, String cseUrlPrefix) {
+ testCodeFirstUserMap(template, cseUrlPrefix);
+ testCodeFirstTextPlain(template, cseUrlPrefix);
+ testCodeFirstAppXml(template, cseUrlPrefix);
+ testCodeFirstBytes(template, cseUrlPrefix);
+ testCseResponse(microserviceName, template, cseUrlPrefix);
+ testCodeFirstAddDate(template, cseUrlPrefix);
+ testCodeFirstAdd(template, cseUrlPrefix);
+ testCodeFirstAddString(template, cseUrlPrefix);
+
+ testModelFieldIgnore(template, cseUrlPrefix);
+ testCodeFirstReduce(template, cseUrlPrefix);
+ // only rest transport will set trace id
+ testTraceIdOnNotSetBefore(template, cseUrlPrefix);
+ }
+
+ private void testCodeFirstUserMap(RestTemplate template, String cseUrlPrefix) {
+ User user1 = new User();
+ user1.setNames(new String[] {"u1", "u2"});
+
+ User user2 = new User();
+ user2.setNames(new String[] {"u3", "u4"});
+
+ Map<String, User> userMap = new HashMap<>();
+ userMap.put("u1", user1);
+ userMap.put("u2", user2);
+
+ @SuppressWarnings("unchecked")
+ Map<String, User> result = template.postForObject(cseUrlPrefix + "testUserMap",
+ userMap,
+ Map.class);
+
+ TestMgr.check("u1", result.get("u1").getNames()[0]);
+ TestMgr.check("u2", result.get("u1").getNames()[1]);
+ TestMgr.check("u3", result.get("u2").getNames()[0]);
+ TestMgr.check("u4", result.get("u2").getNames()[1]);
+ }
+
+ private void testCodeFirstTextPlain(RestTemplate template, String cseUrlPrefix) {
+ String body = "a=1";
+ String result = template.postForObject(cseUrlPrefix + "textPlain",
+ body,
+ String.class);
+ TestMgr.check(body, result);
+ }
+
+ private void testCodeFirstAppXml(RestTemplate template, String cseUrlPrefix) {
+ JAXBPerson person = new JAXBPerson("jake", 22, "it", "60kg");
+ person.setJob(new JAXBJob("developer", "coding"));
+ HttpHeaders headers = new HttpHeaders();
+ headers.add("Accept", MediaType.APPLICATION_XML_VALUE);
+ headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
+ HttpEntity<JAXBPerson> requestEntity = new HttpEntity<>(person, headers);
+ ResponseEntity<JAXBPerson> resEntity = template.exchange(cseUrlPrefix + "appXml",
+ HttpMethod.POST,
+ requestEntity,
+ JAXBPerson.class);
+ TestMgr.check(-1, ProduceProcessorManager.INSTANCE.findProcessor(MediaType.APPLICATION_XML_VALUE, null).getOrder());
+ // test case maybe fail in JDK 11
+ TestMgr.check(person, resEntity.getBody());
+ }
+
+ private void testCodeFirstBytes(RestTemplate template, String cseUrlPrefix) {
+ byte[] body = new byte[] {0, 1, 2};
+ byte[] result = template.postForObject(cseUrlPrefix + "bytes",
+ body,
+ byte[].class);
+ TestMgr.check(3, result.length);
+ TestMgr.check(1, result[0]);
+ TestMgr.check(1, result[1]);
+ TestMgr.check(2, result[2]);
+ }
+
+ protected void checkStatusCode(String microserviceName, int expectStatusCode, HttpStatus httpStatus) {
+ TestMgr.check(expectStatusCode, httpStatus.value());
+ }
+
+ private void testCseResponse(String targetMicroserviceName, RestTemplate template,
+ String cseUrlPrefix) {
+ String srcMicroserviceName = RegistrationManager.INSTANCE.getMicroservice().getServiceName();
+
+ ResponseEntity<User> responseEntity =
+ template.exchange(cseUrlPrefix + "cseResponse", HttpMethod.GET, null, User.class);
+ TestMgr.check("User [name=nameA, age=100, index=0]", responseEntity.getBody());
+ TestMgr.check("h1v " + srcMicroserviceName, responseEntity.getHeaders().getFirst("h1"));
+ TestMgr.check("h2v " + srcMicroserviceName, responseEntity.getHeaders().getFirst("h2"));
+ checkStatusCode(targetMicroserviceName, 202, responseEntity.getStatusCode());
+ }
+
+ private void testCodeFirstAddDate(RestTemplate template, String cseUrlPrefix) {
+ Map<String, Object> body = new HashMap<>();
+ Date date = new Date();
+ body.put("date", date);
+
+ int seconds = 1;
+ Date result = template.postForObject(cseUrlPrefix + "addDate?seconds={seconds}",
+ body,
+ Date.class,
+ seconds);
+ TestMgr.check(new Date(date.getTime() + seconds * 1000), result);
+ }
+
+ private void testCodeFirstAddString(RestTemplate template, String cseUrlPrefix) {
+ ResponseEntity<String> responseEntity =
+ template.exchange(cseUrlPrefix + "addstring?s=a&s=b",
+ HttpMethod.DELETE,
+ null,
+ String.class);
+ TestMgr.check("ab", responseEntity.getBody());
+ }
+
+ private void testCodeFirstIsTrue(RestTemplate template, String cseUrlPrefix) {
+ boolean result = template.getForObject(cseUrlPrefix + "istrue", boolean.class);
+ TestMgr.check(true, result);
+ }
+
+ private void testCodeFirstSayHi2(RestTemplate template, String cseUrlPrefix) {
+ ResponseEntity<String> responseEntity =
+ template.exchange(cseUrlPrefix + "sayhi/{name}/v2", HttpMethod.PUT, null, String.class, "world");
+ TestMgr.check("world sayhi 2", responseEntity.getBody());
+ }
+
+ private void testCodeFirstSayHi(RestTemplate template, String cseUrlPrefix) {
+ ResponseEntity<String> responseEntity =
+ template.exchange(cseUrlPrefix + "sayhi/{name}", HttpMethod.PUT, null, String.class, "world");
+ TestMgr.check(202, responseEntity.getStatusCodeValue());
+ TestMgr.check("world sayhi", responseEntity.getBody());
+ }
+
+ private void testCodeFirstSaySomething(RestTemplate template, String cseUrlPrefix) {
+ Person person = new Person();
+ person.setName("person name");
+
+ HttpHeaders headers = new HttpHeaders();
+ headers.add("prefix", "prefix prefix");
+ headers.add("userId", "serviceCombUser");
+
+ HttpEntity<Person> requestEntity = new HttpEntity<>(person, headers);
+ String result = template.postForObject(cseUrlPrefix + "saysomething", requestEntity, String.class);
+ TestMgr.check("prefix prefix person name", result);
+ }
+
+ private void testCodeFirstSayHello(RestTemplate template, String cseUrlPrefix) {
+ Map<String, String> persionFieldMap = new HashMap<>();
+ persionFieldMap.put("name", "person name from map");
+ Person result = template.postForObject(cseUrlPrefix + "sayhello", persionFieldMap, Person.class);
+ TestMgr.check("hello person name from map", result);
+
+ Person input = new Person();
+ input.setName("person name from Object");
+ result = template.postForObject(cseUrlPrefix + "sayhello", input, Person.class);
+ TestMgr.check("hello person name from Object", result);
+ }
+
+ private void testCodeFirstAdd(RestTemplate template, String cseUrlPrefix) {
+ Map<String, String> params = new HashMap<>();
+ params.put("a", "5");
+ params.put("b", "3");
+ int result =
+ template.postForObject(cseUrlPrefix + "add", params, Integer.class);
+ TestMgr.check(8, result);
+ }
+
+ private void testCodeFirstReduce(RestTemplate template, String cseUrlPrefix) {
+ Map<String, String> params = new HashMap<>();
+ params.put("a", "5");
+
+ HttpHeaders headers = new HttpHeaders();
+ headers.add(HttpHeaders.COOKIE, "b=3");
+
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ ResponseEntity<Integer> result =
+ template.exchange(cseUrlPrefix + "reduce?a={a}", HttpMethod.GET, requestEntity, Integer.class, params);
+ TestMgr.check(2, result.getBody());
+ }
+
+ private void testModelFieldIgnore(RestTemplate template, String cseUrlPrefix) {
+ InputModelForTestIgnore input = new InputModelForTestIgnore("input_id_rest", "input_id_content",
+ new Person("inputSomeone"), new JsonObject("{\"InputJsonKey\" : \"InputJsonValue\"}"), () -> {
+ });
+ OutputModelForTestIgnore output = template
+ .postForObject(cseUrlPrefix + "ignore", input, OutputModelForTestIgnore.class);
+
+ TestMgr.check(null, output.getInputId());
+ TestMgr.check(input.getContent(), output.getContent());
+ TestMgr.check(null, output.getOutputId());
+
+ TestMgr.check(null, output.getInputIgnoreInterface());
+ TestMgr.check(null, output.getInputJsonObject());
+ TestMgr.check(null, output.getInputObject());
+
+ TestMgr.check(null, output.getOutputIgnoreInterface());
+ TestMgr.check(null, output.getOutputJsonObject());
+ TestMgr.check(null, output.getOutputObject());
+ }
+
+ private void testRawJson(RestTemplate template, String cseUrlPrefix) {
+ String input = "{\"name\" : \"zyy\"}";
+ String output = template.postForObject(cseUrlPrefix + "rawJsonAnnotation", input, String.class);
+ TestMgr.check("hello zyy", output);
+ }
+
+ private void testTraceIdOnNotSetBefore(RestTemplate template, String cseUrlPrefix) {
+ String traceIdUrl = cseUrlPrefix + "traceId";
+ String result = template.getForObject(traceIdUrl, String.class);
+ TestMgr.checkNotEmpty(result);
+ }
+
+ private void testTraceIdOnContextContainsTraceId(RestTemplate template, String cseUrlPrefix) {
+ String traceIdUrl = cseUrlPrefix + "traceId";
+ InvocationContext invocationContext = new InvocationContext();
+ invocationContext.addContext(Const.TRACE_ID_NAME, String.valueOf(Long.MIN_VALUE));
+ ContextUtils.setInvocationContext(invocationContext);
+ String result = template.getForObject(traceIdUrl, String.class);
+ TestMgr.check(String.valueOf(Long.MIN_VALUE), result);
+ ContextUtils.removeInvocationContext();
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CommonSchemaInterface.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CommonSchemaInterface.java
new file mode 100644
index 0000000..eef63ec
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/CommonSchemaInterface.java
@@ -0,0 +1,39 @@
+/*
+ * 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;
+
+import org.apache.servicecomb.swagger.invocation.context.InvocationContext;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import io.swagger.annotations.ApiOperation;
+
+@RequestMapping("/CommonSchemaInterface")
+public interface CommonSchemaInterface {
+ @GetMapping(path = "testInvocationTimeout")
+ String testInvocationTimeout(@RequestParam("timeout") long timeout, @RequestParam("name") String name);
+
+ @GetMapping(path = "testInvocationTimeoutWithInvocation")
+ @ApiOperation(value = "testInvocationTimeoutWithInvocation", nickname = "testInvocationTimeoutWithInvocation")
+ String testInvocationTimeout(InvocationContext context, @RequestParam("timeout") long timeout,
+ @RequestParam("name") String name);
+
+ @GetMapping(path = "testInvocationTimeoutInClientWait")
+ String testInvocationTimeoutInClientWait(@RequestParam("timeout") long timeout, @RequestParam("name") String name);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/DemoConst.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/DemoConst.java
new file mode 100644
index 0000000..c76d4c8
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/DemoConst.java
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+import org.apache.servicecomb.core.Const;
+
+public interface DemoConst {
+ String[] transports = new String[] {"highway", "rest", Const.ANY_TRANSPORT};
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/DemoSSLCustom.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/DemoSSLCustom.java
new file mode 100644
index 0000000..ee8e5fd
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/DemoSSLCustom.java
@@ -0,0 +1,73 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.servicecomb.foundation.ssl.SSLCustom;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DemoSSLCustom extends SSLCustom {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DemoSSLCustom.class);
+
+ @Override
+ public char[] decode(char[] encrypted) {
+ return encrypted;
+ }
+
+ @Override
+ public String getFullPath(String filename) {
+ LOGGER.info("current working dir :" + System.getProperty("user.dir"));
+
+ if (StringUtils.isEmpty(filename)) {
+ return null;
+ }
+
+ // local for different IDEs
+ File localFile = new File(
+ System.getProperty("user.dir") + "/demo/demo-springmvc/springmvc-server/src/main/resources/certificates/"
+ + filename);
+ if (localFile.isFile()) {
+ return localFile.getAbsolutePath();
+ }
+
+ localFile = new File(
+ System.getProperty("user.dir") + "/src/main/resources/certificates/"
+ + filename);
+ if (localFile.isFile()) {
+ return localFile.getAbsolutePath();
+ }
+
+ localFile = new File(System.getProperty("user.dir") + "/certificates/" + filename);
+ if (localFile.isFile()) {
+ return localFile.getAbsolutePath();
+ }
+
+ // docker
+ localFile = new File("/maven/maven/certificates/" + filename);
+ if (localFile.isFile()) {
+ return localFile.getAbsolutePath();
+ }
+
+ // in jar, maybe
+ LOGGER.info("not found file {} in file system, maybe in jar.", filename);
+ return "certificates/" + filename;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/EmptyObject.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/EmptyObject.java
new file mode 100644
index 0000000..2c1baa4
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/EmptyObject.java
@@ -0,0 +1,21 @@
+/*
+ * 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;
+
+public class EmptyObject {
+
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/Generic.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/Generic.java
new file mode 100644
index 0000000..401bb52
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/Generic.java
@@ -0,0 +1,21 @@
+/*
+ * 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;
+
+public class Generic<T> {
+ public T value;
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/RestObjectMapperWithStringMapper.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/RestObjectMapperWithStringMapper.java
new file mode 100644
index 0000000..a15d4cb
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/RestObjectMapperWithStringMapper.java
@@ -0,0 +1,67 @@
+/*
+ * 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;
+
+import java.io.IOException;
+
+import org.apache.servicecomb.foundation.common.utils.RestObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+
+import com.fasterxml.jackson.databind.JavaType;
+
+/**
+ * Demonstrate how to using String as raw type when using RestTemplate to invoke a service that use POJO. e.g.
+ * <p/>
+ * Provider: <p/>
+ * <code>
+ * public Response errorCodeWithHeader(MultiRequest request)
+ * </code>
+ * <p/>
+ * Consumer: <p/>
+ * <code>
+ * String stringRequest = "{\"key\":\"testValue\"}";
+ * template.postForEntity(url, stringRequest, MultiResponse200.class);
+ * </code>
+ * <p/>
+ * <b>Caution:</b> json will convert String to object based on String constructor, using this feature will make default
+ * conversion change. You must write convertValue to check possible types using.
+ */
+public class RestObjectMapperWithStringMapper extends RestObjectMapper {
+ private static final long serialVersionUID = 4279371572149490568L;
+
+ private static Logger LOGGER = LoggerFactory.getLogger(RestObjectMapperWithStringMapper.class);
+
+ public RestObjectMapperWithStringMapper() {
+ super();
+ }
+
+ @Override
+ public <T> T convertValue(Object fromValue, JavaType toValueType) throws IllegalArgumentException {
+ if (String.class.isInstance(fromValue)
+ && !BeanUtils.isSimpleValueType(toValueType.getRawClass())) {
+ try {
+ return super.readValue((String) fromValue, toValueType);
+ } catch (IOException e) {
+ LOGGER.error("Failed to convert value for {}.", e.getMessage());
+ }
+ }
+ return super.convertValue(fromValue, toValueType);
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/RestObjectMapperWithStringMapperNotWriteNull.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/RestObjectMapperWithStringMapperNotWriteNull.java
new file mode 100644
index 0000000..38329e1
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/RestObjectMapperWithStringMapperNotWriteNull.java
@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+
+/**
+ * Demonstrate how to using String as raw type when using RestTemplate to invoke a service that use POJO. e.g.
+ * <p/>
+ * Provider: <p/>
+ * <code>
+ * public Response errorCodeWithHeader(MultiRequest request)
+ * </code>
+ * <p/>
+ * Consumer: <p/>
+ * <code>
+ * String stringRequest = "{\"key\":\"testValue\"}";
+ * template.postForEntity(url, stringRequest, MultiResponse200.class);
+ * </code>
+ * <p/>
+ * <b>Caution:</b> json will convert String to object based on String constructor, using this feature will make default
+ * conversion change. You must write convertValue to check possible types using.
+ */
+public class RestObjectMapperWithStringMapperNotWriteNull extends RestObjectMapperWithStringMapper {
+ private static final long serialVersionUID = 4279371572149490560L;
+
+ public RestObjectMapperWithStringMapperNotWriteNull() {
+ super();
+ setSerializationInclusion(Include.NON_NULL);
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/TestMgr.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/TestMgr.java
new file mode 100644
index 0000000..4f3eb66
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/TestMgr.java
@@ -0,0 +1,123 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.commons.lang3.StringUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TestMgr {
+ private static final Logger LOGGER = LoggerFactory.getLogger(TestMgr.class);
+
+ private static final List<Throwable> errorList = new ArrayList<>();
+
+ private static String msg = "";
+
+ private static final AtomicLong checkes = new AtomicLong(0);
+
+ public static void setMsg(String msg) {
+ TestMgr.msg = msg;
+ }
+
+ public static void setMsg(String microserviceName, String transport) {
+ TestMgr.msg = String.format("microservice=%s, transport=%s", microserviceName, transport);
+ }
+
+ public static void check(Object expect, Object real) {
+ check(expect, real, null);
+ }
+
+ public static void check(Object expect, Object real, Throwable error) {
+ checkes.incrementAndGet();
+
+ if (expect == real) {
+ return;
+ }
+
+ String strExpect = String.valueOf(expect);
+ String strReal = String.valueOf(real);
+
+ if (!strExpect.equals(strReal)) {
+ Error newError = new Error(msg + " | Expect " + strExpect + ", but " + strReal);
+ if (error != null) {
+ newError.setStackTrace(error.getStackTrace());
+ }
+ errorList.add(newError);
+ }
+ }
+
+ public static void checkNotEmpty(String real) {
+ checkes.incrementAndGet();
+
+ if (StringUtils.isEmpty(real)) {
+ errorList.add(new Error(msg + " | unexpected null result, method is " + getCaller()));
+ }
+ }
+
+ public static void fail(String desc) {
+ failed(desc, new Exception(desc));
+ }
+
+ public static void failed(String desc, Throwable e) {
+ checkes.incrementAndGet();
+
+ Error error = new Error(msg + " | " + desc + ", method is " + getCaller());
+ if (e != null) {
+ error.setStackTrace(error.getStackTrace());
+ }
+ errorList.add(error);
+ }
+
+ public static boolean isSuccess() {
+ return errorList.isEmpty();
+ }
+
+ public static void summary() {
+ if (errorList.isEmpty()) {
+ LOGGER.info("............. test finished ............");
+ LOGGER.info("............. total checks : " + checkes.get());
+ return;
+ }
+
+ LOGGER.info("............. test not finished ............");
+ LOGGER.info("............. total checks : " + checkes.get());
+ LOGGER.info("............. total errors : " + errorList.size());
+ LOGGER.info("............. error details: ");
+ for (Throwable e : errorList) {
+ LOGGER.info("", e);
+ }
+ }
+
+ public static List<Throwable> errors() {
+ return errorList;
+ }
+
+ private static String getCaller() {
+ StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+ if (stackTrace.length < 3) {
+ return null;
+ }
+ StackTraceElement stackTraceElement = stackTrace[3];
+ return stackTraceElement.getClassName() + "." + stackTraceElement.getMethodName();
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/Compute.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/Compute.java
new file mode 100644
index 0000000..8249a82
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/Compute.java
@@ -0,0 +1,41 @@
+/*
+ * 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.compute;
+
+public interface Compute {
+
+ int add(int a, int b);
+
+ int reduce(int a, int b);
+
+ Person sayHello(Person user);
+
+ String testRawJsonString(String jsonInput);
+
+ String saySomething(String prefix, Person user);
+
+ void sayHi(String name);
+
+ void sayHi2(String name);
+
+ void sayHei(String name);
+
+ boolean isTrue();
+
+ String addString(String[] s);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParam.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParam.java
new file mode 100644
index 0000000..206f652
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParam.java
@@ -0,0 +1,75 @@
+/*
+ * 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.compute;
+
+public class GenericParam<T> {
+ private String str;
+
+ private long num;
+
+ private T data;
+
+ public String getStr() {
+ return str;
+ }
+
+ public void setStr(String str) {
+ this.str = str;
+ }
+
+ public GenericParam<T> str(String str) {
+ this.str = str;
+ return this;
+ }
+
+ public long getNum() {
+ return num;
+ }
+
+ public void setNum(long num) {
+ this.num = num;
+ }
+
+ public GenericParam<T> num(long num) {
+ this.num = num;
+ return this;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
+ public GenericParam<T> data(T data) {
+ this.data = data;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("GenericParam{");
+ sb.append("str='").append(str).append('\'');
+ sb.append(", num=").append(num);
+ sb.append(", data=").append(data);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParamExtended.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParamExtended.java
new file mode 100644
index 0000000..084a8e9
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParamExtended.java
@@ -0,0 +1,60 @@
+/*
+ * 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.compute;
+
+public class GenericParamExtended<T> extends GenericParam<T> {
+ private String strExtended;
+
+ private int intExtended;
+
+ public String getStrExtended() {
+ return strExtended;
+ }
+
+ public void setStrExtended(String strExtended) {
+ this.strExtended = strExtended;
+ }
+
+ public GenericParamExtended<T> strExtended(String strExtended) {
+ this.strExtended = strExtended;
+ return this;
+ }
+
+ public int getIntExtended() {
+ return intExtended;
+ }
+
+ public void setIntExtended(int intExtended) {
+ this.intExtended = intExtended;
+ }
+
+ public GenericParamExtended<T> intExtended(int intExtended) {
+ this.intExtended = intExtended;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("GenericParamExtended{");
+ sb.append("strExtended='").append(strExtended).append('\'');
+ sb.append(", intExtended=").append(intExtended);
+ sb.append(", super=").append(super.toString());
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParamWithJsonIgnore.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParamWithJsonIgnore.java
new file mode 100644
index 0000000..448f64b
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/GenericParamWithJsonIgnore.java
@@ -0,0 +1,78 @@
+/*
+ * 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.compute;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class GenericParamWithJsonIgnore<T> {
+ private String str;
+
+ private long num;
+
+ @JsonIgnore
+ private T data;
+
+ public String getStr() {
+ return str;
+ }
+
+ public void setStr(String str) {
+ this.str = str;
+ }
+
+ public GenericParamWithJsonIgnore<T> str(String str) {
+ this.str = str;
+ return this;
+ }
+
+ public long getNum() {
+ return num;
+ }
+
+ public void setNum(long num) {
+ this.num = num;
+ }
+
+ public GenericParamWithJsonIgnore<T> num(long num) {
+ this.num = num;
+ return this;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
+ public GenericParamWithJsonIgnore<T> data(T data) {
+ this.data = data;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("GenericParamWithJsonIgnore{");
+ sb.append("str='").append(str).append('\'');
+ sb.append(", num=").append(num);
+ sb.append(", data=").append(data);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/Person.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/Person.java
new file mode 100644
index 0000000..d3f0cfb
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/compute/Person.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute;
+
+public class Person {
+ private String name;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public Person() {
+ }
+
+ public Person(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/controller/Controller.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/controller/Controller.java
new file mode 100644
index 0000000..b82cd34
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/controller/Controller.java
@@ -0,0 +1,32 @@
+/*
+ * 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.controller;
+
+public interface Controller {
+ int add(int a, int b);
+
+ String sayHello(String name);
+
+ String saySomething(String prefix, Person user);
+
+ String sayHi(String name);
+
+ String sayHei(String name);
+
+ String sayHello1(String name);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/controller/Person.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/controller/Person.java
new file mode 100644
index 0000000..061598e
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/controller/Person.java
@@ -0,0 +1,35 @@
+/*
+ * 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.controller;
+
+public class Person {
+ private String name;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/helloworld/greeter/Hello.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/helloworld/greeter/Hello.java
new file mode 100644
index 0000000..d9b3530
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/helloworld/greeter/Hello.java
@@ -0,0 +1,24 @@
+/*
+ * 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.helloworld.greeter;
+
+public interface Hello {
+ String SayHello(String name);
+
+ String SayHelloAgain(String name);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/IgnoreInterface.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/IgnoreInterface.java
new file mode 100644
index 0000000..253019a
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/IgnoreInterface.java
@@ -0,0 +1,22 @@
+/*
+ * 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.ignore;
+
+public interface IgnoreInterface {
+ void ignoreMethod();
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/InputModelForTestIgnore.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/InputModelForTestIgnore.java
new file mode 100644
index 0000000..b54b91d
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/InputModelForTestIgnore.java
@@ -0,0 +1,90 @@
+/*
+ * 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.ignore;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import io.vertx.core.json.JsonObject;
+
+public class InputModelForTestIgnore {
+ @JsonIgnore
+ private String inputId = null;
+
+ private String content = null;
+
+ @JsonIgnore
+ private Object inputObject = null;
+
+ @JsonIgnore
+ private JsonObject inputJsonObject = null;
+
+ @JsonIgnore
+ private IgnoreInterface inputIgnoreInterface = null;
+
+ public String getInputId() {
+ return this.inputId;
+ }
+
+ public void setInputId(String inputId) {
+ this.inputId = inputId;
+ }
+
+ public String getContent() {
+ return this.content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Object getInputObject() {
+ return inputObject;
+ }
+
+ public void setInputObject(Object inputObject) {
+ this.inputObject = inputObject;
+ }
+
+ public JsonObject getInputJsonObject() {
+ return inputJsonObject;
+ }
+
+ public void setInputJsonObject(JsonObject inputJsonObject) {
+ this.inputJsonObject = inputJsonObject;
+ }
+
+ public IgnoreInterface getInputIgnoreInterface() {
+ return inputIgnoreInterface;
+ }
+
+ public void setInputIgnoreInterface(IgnoreInterface inputIgnoreInterface) {
+ this.inputIgnoreInterface = inputIgnoreInterface;
+ }
+
+ public InputModelForTestIgnore() {
+ }
+
+ public InputModelForTestIgnore(String inputId, String content, Object inputObject,
+ JsonObject inputJsonObject, IgnoreInterface inputIgnoreInterface) {
+ this.inputId = inputId;
+ this.content = content;
+ this.inputObject = inputObject;
+ this.inputJsonObject = inputJsonObject;
+ this.inputIgnoreInterface = inputIgnoreInterface;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/OutputModelForTestIgnore.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/OutputModelForTestIgnore.java
new file mode 100644
index 0000000..ec35eec
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/ignore/OutputModelForTestIgnore.java
@@ -0,0 +1,138 @@
+/*
+ * 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.ignore;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import io.vertx.core.json.JsonObject;
+
+public class OutputModelForTestIgnore {
+ @JsonIgnore
+ private String outputId = null;
+
+ private String inputId = null;
+
+ private String content = null;
+
+ @JsonIgnore
+ private Object inputObject = null;
+
+ @JsonIgnore
+ private JsonObject inputJsonObject = null;
+
+ @JsonIgnore
+ private IgnoreInterface inputIgnoreInterface = null;
+
+ @JsonIgnore
+ private Object outputObject = null;
+
+ @JsonIgnore
+ private JsonObject outputJsonObject = null;
+
+ @JsonIgnore
+ private IgnoreInterface outputIgnoreInterface = null;
+
+ public String getOutputId() {
+ return this.outputId;
+ }
+
+ public void setOutputId(String outputId) {
+ this.outputId = outputId;
+ }
+
+ public String getInputId() {
+ return this.inputId;
+ }
+
+ public void setInputId(String inputId) {
+ this.inputId = inputId;
+ }
+
+ public String getContent() {
+ return this.content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Object getInputObject() {
+ return inputObject;
+ }
+
+ public void setInputObject(Object inputObject) {
+ this.inputObject = inputObject;
+ }
+
+ public JsonObject getInputJsonObject() {
+ return inputJsonObject;
+ }
+
+ public void setInputJsonObject(JsonObject inputJsonObject) {
+ this.inputJsonObject = inputJsonObject;
+ }
+
+ public IgnoreInterface getInputIgnoreInterface() {
+ return inputIgnoreInterface;
+ }
+
+ public void setInputIgnoreInterface(IgnoreInterface inputIgnoreInterface) {
+ this.inputIgnoreInterface = inputIgnoreInterface;
+ }
+
+ public Object getOutputObject() {
+ return outputObject;
+ }
+
+ public void setOutputObject(Object outputObject) {
+ this.outputObject = outputObject;
+ }
+
+ public JsonObject getOutputJsonObject() {
+ return outputJsonObject;
+ }
+
+ public void setOutputJsonObject(JsonObject outputJsonObject) {
+ this.outputJsonObject = outputJsonObject;
+ }
+
+ public IgnoreInterface getOutputIgnoreInterface() {
+ return outputIgnoreInterface;
+ }
+
+ public void setOutputIgnoreInterface(IgnoreInterface outputIgnoreInterface) {
+ this.outputIgnoreInterface = outputIgnoreInterface;
+ }
+
+ public OutputModelForTestIgnore() {
+ }
+
+ public OutputModelForTestIgnore(String outputId, String inputId, String content, Object inputObject,
+ JsonObject inputJsonObject, IgnoreInterface inputIgnoreInterface, Object outputObject,
+ JsonObject outputJsonObject, IgnoreInterface outputIgnoreInterface) {
+ this.outputId = outputId;
+ this.inputId = inputId;
+ this.content = content;
+ this.inputObject = inputObject;
+ this.inputJsonObject = inputJsonObject;
+ this.inputIgnoreInterface = inputIgnoreInterface;
+ this.outputObject = outputObject;
+ this.outputJsonObject = outputJsonObject;
+ this.outputIgnoreInterface = outputIgnoreInterface;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxbbean/JAXBJob.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxbbean/JAXBJob.java
new file mode 100644
index 0000000..6208798
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxbbean/JAXBJob.java
@@ -0,0 +1,61 @@
+/*
+ * 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.jaxbbean;
+
+import javax.xml.bind.annotation.XmlAccessOrder;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorOrder;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "job")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
+public class JAXBJob {
+ private String name;
+
+ private String content;
+
+ public JAXBJob() {
+ }
+
+ public JAXBJob(String name, String content) {
+ this.name = name;
+ this.content = content;
+ }
+
+ @Override
+ public String toString() {
+ return "Job{" + "name'" + name + '\'' + ", content='" + content + '\'' + '}';
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxbbean/JAXBPerson.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxbbean/JAXBPerson.java
new file mode 100644
index 0000000..bd66e9d
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxbbean/JAXBPerson.java
@@ -0,0 +1,108 @@
+/*
+ * 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.jaxbbean;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlAccessOrder;
+import javax.xml.bind.annotation.XmlAccessorOrder;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(propOrder = {"name", "role", "job"})
+@XmlRootElement(name = "person")
+@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
+public class JAXBPerson implements Serializable {
+ private static final long serialVersionUID = -7127275268696924681L;
+
+ private String name;
+
+ private int age;
+
+ private String role;
+
+ private String weight;
+
+ private JAXBJob job;
+
+ public JAXBPerson() {
+ }
+
+ public JAXBPerson(String name, int age, String role, String weight) {
+ this.name = name;
+ this.age = age;
+ this.role = role;
+ this.weight = weight;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @XmlAttribute
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ @XmlElement(nillable = true)
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ @XmlTransient
+ public String getWeight() {
+ return weight;
+ }
+
+ public void setWeight(String weight) {
+ this.weight = weight;
+ }
+
+ @XmlElement
+ public JAXBJob getJob() {
+ return job;
+ }
+
+ public void setJob(JAXBJob job) {
+ this.job = job;
+ }
+
+ @Override
+ public String toString() {
+ return "Person{" +
+ "name='" + name + '\'' +
+ ", age=" + age +
+ ", role='" + role + '\'' +
+ ", job=" + job +
+ '}';
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxrs/server/validation/ValidationModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxrs/server/validation/ValidationModel.java
new file mode 100644
index 0000000..09e2612
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/jaxrs/server/validation/ValidationModel.java
@@ -0,0 +1,57 @@
+/*
+ * 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.jaxrs.server.validation;
+
+import java.util.List;
+
+import javax.validation.constraints.NotNull;
+
+public class ValidationModel {
+ @NotNull
+ private Integer age;
+
+ @NotNull
+ private List<String> members;
+
+ @NotNull
+ private String name;
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ public List<String> getMembers() {
+ return members;
+ }
+
+ public void setMembers(List<String> members) {
+ this.members = members;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/mapnull/ParseRequest.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/mapnull/ParseRequest.java
new file mode 100644
index 0000000..1544e99
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/mapnull/ParseRequest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.mapnull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ParseRequest {
+ public String msgType = "";
+
+ public String strMsg;
+
+ public String strID = "";
+
+ public Map<String, Object> flags = new HashMap<>();
+
+ public String getMsgType() {
+ return msgType;
+ }
+
+ public void setMsgType(String msgType) {
+ this.msgType = msgType;
+ }
+
+ public String getStrMsg() {
+ return strMsg;
+ }
+
+ public void setStrMsg(String strMsg) {
+ this.strMsg = strMsg;
+ }
+
+ public String getStrID() {
+ return strID;
+ }
+
+ public void setStrID(String strID) {
+ this.strID = strID;
+ }
+
+ public Map<String, Object> getFlags() {
+ return flags;
+ }
+
+ public void setFlags(Map<String, Object> flags) {
+ this.flags = flags;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/mapnull/ParseResponse.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/mapnull/ParseResponse.java
new file mode 100644
index 0000000..8330fe8
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/mapnull/ParseResponse.java
@@ -0,0 +1,72 @@
+/*
+ * 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.mapnull;
+
+import java.util.Map;
+
+public class ParseResponse {
+ public String resultCode = "99999999";
+
+ public String resultInfo = "unknown result";
+
+ public String msgType = "";
+
+ public Map<String, String> msgHeader;
+
+ public Map<String, Object> msgBody;
+
+ public String getResultCode() {
+ return resultCode;
+ }
+
+ public void setResultCode(String resultCode) {
+ this.resultCode = resultCode;
+ }
+
+ public String getResultInfo() {
+ return resultInfo;
+ }
+
+ public void setResultInfo(String resultInfo) {
+ this.resultInfo = resultInfo;
+ }
+
+ public String getMsgType() {
+ return msgType;
+ }
+
+ public void setMsgType(String msgType) {
+ this.msgType = msgType;
+ }
+
+ public Map<String, String> getMsgHeader() {
+ return msgHeader;
+ }
+
+ public void setMsgHeader(Map<String, String> msgHeader) {
+ this.msgHeader = msgHeader;
+ }
+
+ public Map<String, Object> getMsgBody() {
+ return msgBody;
+ }
+
+ public void setMsgBody(Map<String, Object> msgBody) {
+ this.msgBody = msgBody;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/model/SpecialNameModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/model/SpecialNameModel.java
new file mode 100644
index 0000000..dfacc03
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/model/SpecialNameModel.java
@@ -0,0 +1,36 @@
+/*
+ * 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.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class SpecialNameModel {
+ // names starts with only one lower case , although getter/setter generated by IDE is correct,
+ // will cause jackson generate incorrect swagger names.
+ // @JsonProperty must be used to make json work in a predictable way.
+ @JsonProperty("aIntName")
+ private int aIntName;
+
+ public int getaIntName() {
+ return aIntName;
+ }
+
+ public void setaIntName(int aIntName) {
+ this.aIntName = aIntName;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiRequest.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiRequest.java
new file mode 100644
index 0000000..738355a
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiRequest.java
@@ -0,0 +1,40 @@
+/*
+ * 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.multiErrorCode;
+
+public class MultiRequest{
+ private String message;
+
+ private int code;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse200.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse200.java
new file mode 100644
index 0000000..34f60c7
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse200.java
@@ -0,0 +1,50 @@
+/*
+ * 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.multiErrorCode;
+
+public class MultiResponse200 {
+ private String message;
+
+ private int code;
+
+ private long t200;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public long getT200() {
+ return t200;
+ }
+
+ public void setT200(long t200) {
+ this.t200 = t200;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse400.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse400.java
new file mode 100644
index 0000000..af27dc1
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse400.java
@@ -0,0 +1,50 @@
+/*
+ * 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.multiErrorCode;
+
+public class MultiResponse400 {
+ private String message;
+
+ private int code;
+
+ private long t400;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public long getT400() {
+ return t400;
+ }
+
+ public void setT400(long t400) {
+ this.t400 = t400;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse500.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse500.java
new file mode 100644
index 0000000..379d1ba
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/multiErrorCode/MultiResponse500.java
@@ -0,0 +1,50 @@
+/*
+ * 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.multiErrorCode;
+
+public class MultiResponse500 {
+ private String message;
+
+ private int code;
+
+ private long t500;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public long getT500() {
+ return t500;
+ }
+
+ public void setT500(long t500) {
+ this.t500 = t500;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/produceprocessor/ProduceAppXmlProcessor.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/produceprocessor/ProduceAppXmlProcessor.java
new file mode 100644
index 0000000..2303e5d
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/produceprocessor/ProduceAppXmlProcessor.java
@@ -0,0 +1,52 @@
+/*
+ * 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.produceprocessor;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor;
+import org.apache.servicecomb.demo.utils.JAXBUtils;
+
+import com.fasterxml.jackson.databind.JavaType;
+
+public class ProduceAppXmlProcessor implements ProduceProcessor {
+
+ @Override
+ public String getName() {
+ return MediaType.APPLICATION_XML;
+ }
+
+ @Override
+ public int getOrder() {
+ return 0;
+ }
+
+ @Override
+ public void doEncodeResponse(OutputStream output, Object result) throws Exception {
+ output.write(JAXBUtils.convertToXml(result).getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public Object doDecodeResponse(InputStream input, JavaType type) throws Exception {
+ return JAXBUtils.convertToJavaBean(input, type);
+ }
+
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/produceprocessor/override/ProduceAppXmlProcessor.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/produceprocessor/override/ProduceAppXmlProcessor.java
new file mode 100644
index 0000000..116b15f
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/produceprocessor/override/ProduceAppXmlProcessor.java
@@ -0,0 +1,52 @@
+/*
+ * 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.produceprocessor.override;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor;
+import org.apache.servicecomb.demo.utils.JAXBUtils;
+
+import com.fasterxml.jackson.databind.JavaType;
+
+public class ProduceAppXmlProcessor implements ProduceProcessor {
+
+ @Override
+ public String getName() {
+ return MediaType.APPLICATION_XML;
+ }
+
+ @Override
+ public int getOrder() {
+ return -1;
+ }
+
+ @Override
+ public void doEncodeResponse(OutputStream output, Object result) throws Exception {
+ output.write(JAXBUtils.convertToXml(result).getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public Object doDecodeResponse(InputStream input, JavaType type) throws Exception {
+ return JAXBUtils.convertToJavaBean(input, type);
+ }
+
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/AbstractModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/AbstractModel.java
new file mode 100644
index 0000000..9cf1328
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/AbstractModel.java
@@ -0,0 +1,49 @@
+/*
+ * 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.server;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
+
+// 当使用 List<AbstractModel> 等 Collection 类型的时候, jackson 序列化不会携带类以外的其他属性
+// 即会忽略掉类型信息。 当抽象类型用于 Collection 类型参数的时候,必须使用已有的属性(例子中的 property = "type")来确定类型,
+// 并在子类中显示指定属性的值,而不能使用和依赖jackson根据类型信息自己生成的类型。
+
+// 还有一种方法,是序列化的时候指定类型, see: https://www.studytrails.com/2016/09/12/java-jackson-serialization-list/
+// 但是多数序列化接口,包括 RestTemplate 等,都无法得知参数的类型。 这种方式难于应用于开发框架实现,因此对于Collection 类型参数场景,使用已有属性
+// 是最简洁的方法。
+
+@JsonTypeInfo(
+ use = Id.NAME, property = "type"
+)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = DefaultAbstractModel.class, name = "default"),
+ @JsonSubTypes.Type(value = SecondAbstractModel.class, name = "second"),
+})
+public abstract class AbstractModel {
+ protected String type;
+
+ protected String name;
+
+ public abstract String getType();
+
+ public abstract String getName();
+
+ public abstract void setName(String name);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/DefaultAbstractModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/DefaultAbstractModel.java
new file mode 100644
index 0000000..c9f06ee
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/DefaultAbstractModel.java
@@ -0,0 +1,35 @@
+/*
+ * 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.server;
+
+public class DefaultAbstractModel extends AbstractModel {
+ @Override
+ public String getType() {
+ return "default";
+ }
+
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/GenericsModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/GenericsModel.java
new file mode 100644
index 0000000..45853db
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/GenericsModel.java
@@ -0,0 +1,52 @@
+/*
+ * 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.server;
+
+import java.util.List;
+
+public class GenericsModel {
+ private String name;
+
+ private List<List<String>> nameList;
+
+ private List<List<List<Object>>> objectLists;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List<List<String>> getNameList() {
+ return nameList;
+ }
+
+ public void setNameList(List<List<String>> nameList) {
+ this.nameList = nameList;
+ }
+
+ public List<List<List<Object>>> getObjectLists() {
+ return objectLists;
+ }
+
+ public void setObjectLists(List<List<List<Object>>> objectLists) {
+ this.objectLists = objectLists;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/MapModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/MapModel.java
new file mode 100644
index 0000000..695310c
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/MapModel.java
@@ -0,0 +1,42 @@
+/*
+ * 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.server;
+
+import java.util.Map;
+
+public class MapModel {
+ private String name;
+
+ private Map<String, String> names;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map<String, String> getNames() {
+ return names;
+ }
+
+ public void setNames(Map<String, String> names) {
+ this.names = names;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/NotRecommendedServiceInf.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/NotRecommendedServiceInf.java
new file mode 100644
index 0000000..f6be5ae
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/NotRecommendedServiceInf.java
@@ -0,0 +1,33 @@
+/*
+ * 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.server;
+
+import java.util.List;
+import java.util.Map;
+
+public interface NotRecommendedServiceInf {
+ Map<Long, Long> longMap(Map<Long, Long> map);
+
+ List<AbstractModel> listAbstractModel(List<AbstractModel> listModel);
+
+ AbstractModel abstractModel(AbstractModel model);
+
+ Map<Long, AbstractModel> mapAbstractModel(Map<Long, AbstractModel> mapModel);
+
+ WrappedAbstractModel wrappedAbstractModel(WrappedAbstractModel wrappedModel);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/SecondAbstractModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/SecondAbstractModel.java
new file mode 100644
index 0000000..46a0b85
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/SecondAbstractModel.java
@@ -0,0 +1,35 @@
+/*
+ * 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.server;
+
+public class SecondAbstractModel extends AbstractModel {
+ @Override
+ public String getType() {
+ return "second";
+ }
+
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/Test.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/Test.java
new file mode 100644
index 0000000..0afa62a
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/Test.java
@@ -0,0 +1,38 @@
+/*
+ * 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.server;
+
+public interface Test {
+ String testStringArray(String[] arr);
+
+ String getTestString(String code);
+
+ String postTestStatic(int code);
+
+ String patchTestStatic(int code);
+
+ String testException(int code);
+
+ User wrapParam(TestRequest request);
+
+ User splitParam(int index, User user);
+
+ String addString(String[] strArr);
+
+ String testTraceId();
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/TestRequest.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/TestRequest.java
new file mode 100644
index 0000000..6f62268
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/TestRequest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.server;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TestRequest {
+ private int index;
+
+ private User user;
+
+ private List<User> users = new ArrayList<>();
+
+ private byte[] data;
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ public List<User> getUsers() {
+ return users;
+ }
+
+ public void setUsers(List<User> users) {
+ this.users = users;
+ }
+
+ public byte[] getData() {
+ return data;
+ }
+
+ public void setData(byte[] data) {
+ this.data = data;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/TestResponse.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/TestResponse.java
new file mode 100644
index 0000000..c6baa8e
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/TestResponse.java
@@ -0,0 +1,35 @@
+/*
+ * 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.server;
+
+public class TestResponse {
+ private User user;
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ @Override
+ public String toString() {
+ return "TestResponse [user=" + user + "]";
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/User.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/User.java
new file mode 100644
index 0000000..c55ed1e
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/User.java
@@ -0,0 +1,77 @@
+/*
+ * 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.server;
+
+import org.apache.servicecomb.foundation.common.utils.JsonUtils;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+public class User {
+ private String name = "nameA";
+
+ private int age = 100;
+
+ private int index;
+
+ private String[] names;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String[] getNames() {
+ return names;
+ }
+
+ public void setNames(String[] names) {
+ this.names = names;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ @Override
+ public String toString() {
+ return "User [name=" + name + ", age=" + age + ", index=" + index + "]";
+ }
+
+ public String jsonString() {
+ try {
+ return JsonUtils.writeValueAsString(this);
+ } catch (JsonProcessingException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/WrappedAbstractModel.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/WrappedAbstractModel.java
new file mode 100644
index 0000000..8015ccf
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/server/WrappedAbstractModel.java
@@ -0,0 +1,63 @@
+/*
+ * 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.server;
+
+import java.util.List;
+import java.util.Map;
+
+public class WrappedAbstractModel {
+ private String name;
+
+ private Map<Long, AbstractModel> mapModel;
+
+ private List<AbstractModel> listModel;
+
+ private AbstractModel model;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map<Long, AbstractModel> getMapModel() {
+ return mapModel;
+ }
+
+ public void setMapModel(Map<Long, AbstractModel> mapModel) {
+ this.mapModel = mapModel;
+ }
+
+ public List<AbstractModel> getListModel() {
+ return listModel;
+ }
+
+ public void setListModel(List<AbstractModel> listModel) {
+ this.listModel = listModel;
+ }
+
+ public AbstractModel getModel() {
+ return model;
+ }
+
+ public void setModel(AbstractModel model) {
+ this.model = model;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Application.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Application.java
new file mode 100644
index 0000000..88f7db4
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Application.java
@@ -0,0 +1,98 @@
+/*
+ * 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.smartcare;
+
+import java.util.List;
+
+public class Application {
+ private String name;
+
+ private String labelEN;
+
+ private String labelCH;
+
+ private String defaultGroup;
+
+ private String version;
+
+ private boolean dynamicFlag;
+
+ private List<Group> groups;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLabelEN() {
+ return labelEN;
+ }
+
+ public void setLabelEN(String labelEN) {
+ this.labelEN = labelEN;
+ }
+
+ public String getLabelCH() {
+ return labelCH;
+ }
+
+ public void setLabelCH(String labelCH) {
+ this.labelCH = labelCH;
+ }
+
+ public String getDefaultGroup() {
+ return defaultGroup;
+ }
+
+ public void setDefaultGroup(String defaultGroup) {
+ this.defaultGroup = defaultGroup;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public boolean isDynamicFlag() {
+ return dynamicFlag;
+ }
+
+ public void setDynamicFlag(boolean dynamicFlag) {
+ this.dynamicFlag = dynamicFlag;
+ }
+
+ public List<Group> getGroups() {
+ return groups;
+ }
+
+ public void setGroups(List<Group> groups) {
+ this.groups = groups;
+ }
+
+ @Override
+ public String toString() {
+ return "name=" + name + "\n"
+ + "version=" + version;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Group.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Group.java
new file mode 100644
index 0000000..8010d38
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Group.java
@@ -0,0 +1,50 @@
+/*
+ * 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.smartcare;
+
+public class Group {
+ private String name;
+
+ private String labelEN;
+
+ private String labelCH;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLabelEN() {
+ return labelEN;
+ }
+
+ public void setLabelEN(String labelEN) {
+ this.labelEN = labelEN;
+ }
+
+ public String getLabelCH() {
+ return labelCH;
+ }
+
+ public void setLabelCH(String labelCH) {
+ this.labelCH = labelCH;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Response.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Response.java
new file mode 100644
index 0000000..3e0a286
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/Response.java
@@ -0,0 +1,45 @@
+/*
+ * 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.smartcare;
+
+public class Response {
+ private int resultCode;
+
+ private String resultMessage;
+
+ public int getResultCode() {
+ return resultCode;
+ }
+
+ public void setResultCode(int resultCode) {
+ this.resultCode = resultCode;
+ }
+
+ public String getResultMessage() {
+ return resultMessage;
+ }
+
+ public void setResultMessage(String resultMessage) {
+ this.resultMessage = resultMessage;
+ }
+
+ @Override
+ public String toString() {
+ return "resultCode: " + resultCode + "\n" + "resultMessage: " + resultMessage;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/SmartCare.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/SmartCare.java
new file mode 100644
index 0000000..85008f9
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/smartcare/SmartCare.java
@@ -0,0 +1,25 @@
+/*
+ * 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.smartcare;
+
+public interface SmartCare {
+
+ Response addApplication(Application application);
+
+ Response delApplication(String appName);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/utils/JAXBUtils.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/utils/JAXBUtils.java
new file mode 100644
index 0000000..671260f
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/utils/JAXBUtils.java
@@ -0,0 +1,94 @@
+/*
+ * 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.utils;
+
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.InputSource;
+
+import com.fasterxml.jackson.databind.JavaType;
+
+public class JAXBUtils {
+ private static final Logger LOGGER = LoggerFactory.getLogger(JAXBUtils.class);
+
+ private JAXBUtils() {
+ }
+
+ public static String convertToXml(Object obj) {
+ return convertToXml(obj, StandardCharsets.UTF_8.toString());
+ }
+
+ public static String convertToXml(Object obj, String encoding) {
+ String result = null;
+ try {
+ JAXBContext context = JAXBContext.newInstance(obj.getClass());
+ Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
+
+ StringWriter writer = new StringWriter();
+ marshaller.marshal(obj, writer);
+ result = writer.toString();
+ } catch (Exception e) {
+ LOGGER.error("Bean convert to xml failed, error message: {}", e.getMessage());
+ }
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T convertToJavaBean(InputStream xml, JavaType type) {
+ return (T) convertToJavaBean(xml, type.getRawClass());
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T convertToJavaBean(InputStream xml, Class<T> c) {
+ T t = null;
+ try {
+ JAXBContext context = JAXBContext.newInstance(c);
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ t = (T) unmarshaller.unmarshal(XXEPrevention(xml));
+ } catch (Exception e) {
+ LOGGER.error("Xml convert to Bean failed, error message: {}", e.getMessage());
+ }
+ return t;
+ }
+
+ private static Source XXEPrevention(InputStream xml) {
+ Source xmlSource = null;
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ try {
+ spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+ xmlSource = new SAXSource(spf.newSAXParser().getXMLReader(), new InputSource(xml));
+ } catch (Exception e) {
+ LOGGER.error("Xml External Entity (XXE) Processing report error, error message: {}", e.getMessage());
+ }
+ return xmlSource;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/validator/Student.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/validator/Student.java
new file mode 100644
index 0000000..65feea2
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/validator/Student.java
@@ -0,0 +1,58 @@
+/*
+ * 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.validator;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.NotNull;
+
+public class Student {
+ @NotNull
+ private String name;
+
+ @Max(20)
+ private int age;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public Student() {
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public Student(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
+
+ @Override
+ public String toString() {
+ return name + " " + age;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/validator/Teacher.java b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/validator/Teacher.java
new file mode 100644
index 0000000..009a250
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/java/org/apache/servicecomb/demo/validator/Teacher.java
@@ -0,0 +1,49 @@
+/*
+ * 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.validator;
+
+import javax.validation.constraints.NotBlank;
+
+public class Teacher {
+
+ @NotBlank(message = "must not be blank")
+ private String name;
+
+ private String age;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAge() {
+ return age;
+ }
+
+ public void setAge(String age) {
+ this.age = age;
+ }
+
+ @Override
+ public String toString() {
+ return name + " " + age;
+ }
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor b/java-chassis-integration-tests/demo-schema/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor
new file mode 100644
index 0000000..ff9a6cb
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
+org.apache.servicecomb.demo.produceprocessor.ProduceAppXmlProcessor
+org.apache.servicecomb.demo.produceprocessor.override.ProduceAppXmlProcessor
\ No newline at end of file
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/config/log4j.properties b/java-chassis-integration-tests/demo-schema/src/main/resources/config/log4j.properties
new file mode 100644
index 0000000..9401094
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/config/log4j.properties
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+paas.logs.dir=../target/logs/
+paas.logs.file=cse.log
+
+log4j.rootLogger=INFO,paas,stdout
+log4j.logger.org.apache.servicecomb.core.definition.schema.ProducerSchemaFactory=OFF
+log4j.logger.org.apache.servicecomb.core.definition.schema.StaticSchemaFactory=OFF
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservice.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservice.yaml
new file mode 100644
index 0000000..97db791
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservice.yaml
@@ -0,0 +1,30 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+servicecomb-config-order: -1
+
+cse:
+ test:
+ duplicate1: older
+
+servicecomb:
+ test:
+ duplicate2: older
+
+demo.multi.service.center.serverB:
+ key1: key1
+ key2: key2
+ key3: key3
\ No newline at end of file
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/jaxrs/compute.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/jaxrs/compute.yaml
new file mode 100644
index 0000000..6606be5
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/jaxrs/compute.yaml
@@ -0,0 +1,201 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+swagger: '2.0'
+info:
+ title: rest test
+ version: 1.0.0
+ x-java-interface: org.apache.servicecomb.demo.compute.Compute
+
+# the domain of the service
+#host: api.uber.com
+
+# array of all schemes that your API supports
+#schemes:
+# - https
+
+# will be prefixed to all paths
+basePath: /compute
+produces:
+ - application/json
+
+paths:
+ /add:
+ post:
+ operationId: add
+ parameters:
+ - name: a
+ in: formData
+ required: true
+ type: integer
+ format: int32
+ - name: b
+ in: formData
+ required: true
+ type: integer
+ format: int32
+ responses:
+ "200":
+ description: add numer
+ schema:
+ type: integer
+ format: int32
+ /reduce:
+ get:
+ operationId: reduce
+ parameters:
+ - name: a
+ in: query
+ required: true
+ type: integer
+ format: int32
+ - name: b
+ in: query
+ required: true
+ type: integer
+ format: int32
+ responses:
+ "200":
+ description: reduce
+ schema:
+ type: integer
+ format: int32
+ /sayhello:
+ post:
+ operationId: sayHello
+ parameters:
+ - name: user
+ in: body
+ required: true
+ schema:
+ $ref: '#/definitions/Person'
+ responses:
+ "200":
+ description: say hello
+ schema:
+ $ref: '#/definitions/Person'
+ /testrawjson:
+ post:
+ operationId: testRawJsonString
+ parameters:
+ - name: jsonInput
+ in: body
+ required: true
+ x-raw-json: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: test RawJson String
+ schema:
+ type: string
+ /saysomething:
+ post:
+ operationId: saySomething
+ parameters:
+ - name: prefix
+ in: header
+ required: true
+ type: string
+ - name: user
+ in: body
+ required: true
+ schema:
+ $ref: '#/definitions/Person'
+ responses:
+ "200":
+ description: say something
+ schema:
+ type: string
+ /sayhi/{name}:
+ put:
+ operationId: sayHi
+ parameters:
+ - name: name
+ in: path
+ required: true
+ type: string
+ responses:
+ "200":
+ description: say hi
+ schema:
+ type: string
+ 202:
+ description: say hi
+ schema:
+ type: string
+ /sayhi/{name}/v2:
+ put:
+ operationId: sayHi2
+ parameters:
+ - name: name
+ in: path
+ required: true
+ type: string
+ responses:
+ "200":
+ description: say hi
+ schema:
+ type: string
+ /sayhei:
+ delete:
+ operationId: sayHei
+ parameters:
+ - name: name
+ in: query
+ required: true
+ type: string
+ responses:
+ "200":
+ description: say hi
+ schema:
+ type: string
+ /istrue:
+ get:
+ operationId: isTrue
+ responses:
+ "200":
+ description: is true
+ schema:
+ type: boolean
+ /addstring:
+ delete:
+ operationId: addString
+ produces:
+ - text/plain
+ parameters:
+ - name: s
+ in: query
+ required: true
+ type: array
+ items:
+ type: string
+ responses:
+ "200":
+ description: add string
+ schema:
+ type: string
+
+definitions:
+ Person:
+ type: object
+ properties:
+ name:
+ type: string
+ x-java-class: "org.apache.servicecomb.demo.compute.Person"
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/cse.basic.Basic/main.idl b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/cse.basic.Basic/main.idl
new file mode 100644
index 0000000..6b5cd76
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/cse.basic.Basic/main.idl
@@ -0,0 +1,62 @@
+// 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 cse.basic;
+
+message BasicRequest {
+ required AllBasicTypes request = 1;
+}
+
+message BasicResponse {
+ required AllBasicTypes request = 1;
+}
+
+message AllBasicTypes {
+ required double tdouble = 1;
+ required float tfloat = 2;
+ required int32 tint32 = 3;
+ required int64 tint64 = 4;
+ required uint32 tuint32 = 5;
+ required uint64 tuint64 = 6;
+ required sint32 tsint32 = 7;
+ required sint64 tsint64 = 8;
+ required fixed32 tfixed32 = 9;
+ required fixed64 tfixed64 = 10;
+ required sfixed32 tsfixed32 = 11;
+ required sfixed64 tsfixed64 = 12;
+ required bool tbool = 13;
+ required string tstring = 14;
+ required bytes tbytes = 15;
+
+ enum EnumType {
+ ONE = 0;
+ TWO = 1;
+ }
+ required EnumType enumType = 16;
+
+ // map<string, string> mapType = 17;
+ //message MapFieldEntry {
+ //required string key = 1;
+ //required string value = 2;
+ //}
+ //repeated MapFieldEntry mapType = 17;
+
+ repeated string tstringList = 17;
+}
+
+service Basic {
+ rpc schalarType(BasicRequest) returns(BasicResponse);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/hello/main.idl b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/hello/main.idl
new file mode 100644
index 0000000..6a6fd47
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/hello/main.idl
@@ -0,0 +1,26 @@
+// 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.
+
+service Greeter {
+ rpc SayHello (HelloRequest) returns (HelloReply) {}
+}
+
+message HelloRequest {
+ required string name = 1;
+}
+
+message HelloReply {
+ required string message = 1;
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/helloworld.Greeter/main.idl b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/helloworld.Greeter/main.idl
new file mode 100644
index 0000000..e415db0
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/helloworld.Greeter/main.idl
@@ -0,0 +1,29 @@
+// 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 helloworld;
+
+service Greeter {
+ rpc SayHello (HelloRequest) returns (HelloReply);
+ rpc SayHelloAgain (HelloRequest) returns (HelloReply);
+}
+
+message HelloRequest {
+ required string name = 1;
+}
+
+message HelloReply {
+ required string message = 1;
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/helloworld.Standard/main.idl b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/helloworld.Standard/main.idl
new file mode 100644
index 0000000..2cf0a7a
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/helloworld.Standard/main.idl
@@ -0,0 +1,34 @@
+// 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 helloworld;
+
+message StandardRequest {
+ required ComplexType args0 = 1;
+}
+
+message StandardResponse {
+ required ComplexType response = 1;
+}
+
+message ComplexType {
+ repeated int32 intType = 1;
+ repeated bool boolType = 2;
+ repeated string stringType = 3;
+}
+
+service Standard {
+ rpc sayHelloComplex (StandardRequest) returns (StandardResponse);
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/server/main.idl b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/server/main.idl
new file mode 100644
index 0000000..d60a7a8
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/no-use/server/main.idl
@@ -0,0 +1,97 @@
+// 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.
+
+message TestRequest{
+ required int32 index = 1;
+ required User user = 2;
+ required bytes data = 3;
+ //repeated MapFieldEntry friends = 4;
+}
+
+message User{
+ required string name = 1;
+ required int32 age = 2;
+ required int32 index = 3;
+ //repeated MapFieldEntry friends = 4;
+}
+
+message MapFieldEntry {
+ required string key = 1;
+ required int32 value = 2;
+}
+
+message TestResponse{
+ required User user = 1;
+}
+
+enum EnumType {
+ ONE = 0;
+ TWO = 1;
+}
+
+message EnumMessage{
+ required EnumType enumType = 1;
+}
+
+message Empty{
+}
+
+message MicroService{
+ optional string service_id = 1;
+ required string app_id = 2;
+ required string name = 3;
+ required string version = 4;
+ optional string description = 5;
+ optional string level = 6 [default = "front"];
+ repeated ServiceDefinition definitions = 7;
+ optional ServiceStatus status = 8 [default = INSERVICE];
+}
+
+message ServiceDefinition {
+ required string name = 1;
+ required string version = 2;
+ required string transport = 3;
+ repeated string schema = 4;
+ //map<string, string> properties = 5;
+}
+
+enum ServiceStatus {
+ INSERVICE = 0;
+ OUTOFSERVICE = 1;
+}
+
+message MicroServiceWrap{
+ required MicroService service = 1;
+}
+
+service server {
+ rpc splitParam(TestRequest) returns(User);
+ rpc standard(TestRequest) returns(TestResponse);
+ rpc sayHello (HelloRequest) returns (HelloReply);
+ rpc standardSayHello (HelloRequest) returns (HelloReply);
+ rpc testEnum(EnumMessage) returns(EnumMessage);
+ rpc testStandardEnum(EnumMessage) returns(EnumMessage);
+ rpc testEmpty(Empty) returns(Empty);
+ rpc testMicroService(MicroService) returns(MicroService);
+ rpc testCreateMicroService(MicroServiceWrap) returns(MicroServiceWrap);
+}
+
+message HelloRequest {
+ required string name = 1;
+}
+
+message HelloReply {
+ required string message = 1;
+}
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/helloworld.Greeter.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/helloworld.Greeter.yaml
new file mode 100644
index 0000000..d503f15
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/helloworld.Greeter.yaml
@@ -0,0 +1,74 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+swagger: '2.0'
+info:
+ title: helloworld.Greeter
+ version: 1.0.0
+ x-java-interface: org.apache.servicecomb.demo.helloworld.greeter.Hello
+
+# the domain of the service
+#host: api.uber.com
+
+# array of all schemes that your API supports
+#schemes:
+# - https
+
+# will be prefixed to all paths
+basePath: /pojo/rest/helloworld.Greeter
+produces:
+ - application/json
+
+paths:
+ /SayHello:
+ post:
+ operationId: SayHello
+ parameters:
+ - name: name
+ in: body
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ default:
+ description: asf
+ schema:
+ type: string
+ /SayHelloAgain:
+ post:
+ operationId: SayHelloAgain
+ parameters:
+ - name: name
+ in: body
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ default:
+ description: asf
+ schema:
+ type: string
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/server.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/server.yaml
new file mode 100644
index 0000000..9c8be9e
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/server.yaml
@@ -0,0 +1,221 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+swagger: '2.0'
+info:
+ title: cse test
+ version: 1.0.0
+ x-java-interface: org.apache.servicecomb.demo.server.Test
+
+# the domain of the service
+#host: api.uber.com
+
+# array of all schemes that your API supports
+#schemes:
+# - https
+
+# will be prefixed to all paths
+basePath: /pojo/rest
+produces:
+ - application/json
+
+paths:
+ /testStringArray:
+ get:
+ operationId: testStringArray
+ parameters:
+ - name: arr
+ in: query
+ required: true
+ type: array
+ items:
+ type: string
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ /testStatic:
+ get:
+ operationId: getTestString
+ parameters:
+ - name: code
+ in: query
+ required: false
+ type: string
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ post:
+ operationId: postTestStatic
+ parameters:
+ - name: code
+ in: query
+ required: true
+ type: integer
+ format: int32
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ patch:
+ operationId: patchTestStatic
+ parameters:
+ - name: code
+ in: query
+ required: true
+ type: integer
+ format: int32
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ /testException/{code}:
+ get:
+ operationId: testException
+ parameters:
+ - name: code
+ in: path
+ required: true
+ type: integer
+ format: int32
+ responses:
+ "200":
+ description: asdf
+ schema:
+ type: string
+ 456:
+ description: asdf
+ schema:
+ type: string
+ 556:
+ description: asdf
+ schema:
+ type: array
+ items:
+ type: string
+ 557:
+ description: asdf
+ schema:
+ type: array
+ items:
+ type: array
+ items:
+ type: string
+ /splitParam:
+ post:
+ operationId: splitParam
+ parameters:
+ - name: index
+ in: query
+ required: true
+ type: integer
+ format: int32
+ - name: user
+ in: body
+ schema:
+ $ref: '#/definitions/User'
+ responses:
+ "200":
+ description: asdf
+ schema:
+ $ref: '#/definitions/User'
+ default:
+ description: asf
+ schema:
+ $ref: '#/definitions/Error'
+ /wrapParam:
+ post:
+ operationId: wrapParam
+ parameters:
+ - name: request
+ in: body
+ required: false
+ schema:
+ $ref: '#/definitions/TestRequest'
+ responses:
+ "200":
+ description: asdf
+ schema:
+ $ref: '#/definitions/User'
+ default:
+ description: asf
+ schema:
+ $ref: '#/definitions/Error'
+ /addstring:
+ delete:
+ operationId: addString
+ parameters:
+ - name: strArr
+ in: query
+ required: true
+ type: array
+ items:
+ type: string
+ responses:
+ "200":
+ description: add string
+ schema:
+ type: string
+ /testTraceId:
+ get:
+ operationId: testTraceId
+ responses:
+ "200":
+ description: get trace id
+ schema:
+ type: string
+definitions:
+ Error:
+ type: object
+ x-java-class: org.apache.servicecomb.swagger.invocation.exception.CommonExceptionData
+ properties:
+ message:
+ type: string
+ TestRequest:
+ type: object
+ properties:
+ index:
+ type: integer
+ format: int32
+ user:
+ $ref: '#/definitions/User'
+ users:
+ type: array
+ items:
+ $ref: '#/definitions/User'
+ data:
+ type: string
+ format: byte
+ User:
+ type: object
+ properties:
+ name:
+ type: string
+ age:
+ type: integer
+ format: int32
+ index:
+ type: integer
+ format: int32
+ x-java-class: "org.apache.servicecomb.demo.server.User"
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
new file mode 100644
index 0000000..0879c3b
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
@@ -0,0 +1,136 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+swagger: '2.0'
+info:
+ title: smartcare test
+ version: 1.0.0
+# x-java-interface is optional, remove it should works well, but sometimes need to generate more class in memory
+# x-java-interface: org.apache.servicecomb.demo.smartcare.SmartCare
+
+# the domain of the service
+#host: api.uber.com
+
+# array of all schemes that your API supports
+#schemes:
+# - https
+
+# will be prefixed to all paths
+basePath: /pojo/rest/plat/meta/v1
+produces:
+ - application/json
+
+paths:
+ /applications:
+ post:
+ operationId: addApplication
+ parameters:
+ - name: application
+ in: body
+ required: true
+ schema:
+ $ref: '#/definitions/Application'
+ responses:
+ 201:
+ description: success
+ schema:
+ $ref: '#/definitions/Response'
+ 400:
+ description: error
+ schema:
+ $ref: '#/definitions/Response'
+ 500:
+ description: error
+ schema:
+ $ref: '#/definitions/Response'
+
+ /applications/{appName}:
+ delete:
+ operationId: delApplication
+ parameters:
+ - name: appName
+ in: path
+ required: true
+ type: string
+ responses:
+ 201:
+ description: success
+ schema:
+ $ref: '#/definitions/Response'
+ 400:
+ description: error
+ schema:
+ $ref: '#/definitions/Response'
+ 500:
+ description: error
+ schema:
+ $ref: '#/definitions/Response'
+
+
+definitions:
+ Application:
+ type: object
+ properties:
+ name:
+ type: string
+ labelEN:
+ type: string
+ labelCH:
+ type: string
+ defaultGroup:
+ type: string
+ version:
+ type: string
+ dynamicFlag:
+ type: boolean
+ groups:
+ type: array
+ items:
+ $ref: '#/definitions/Group'
+ required:
+ - name
+ - defaultGroup
+ - version
+ - dynamicFlag
+ - groups
+
+ Group:
+ type: object
+ properties:
+ name:
+ type: string
+ labelEN:
+ type: string
+ labelCH:
+ type: string
+ required:
+ - name
+
+ Response:
+ type: object
+ x-java-class: org.apache.servicecomb.demo.smartcare.Response
+ properties:
+ resultCode:
+ type: integer
+ format: int32
+ resultMessage:
+ type: string
+ required:
+ - resultCode
+
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/tcc-server.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/tcc-server.yaml
new file mode 100644
index 0000000..4af831b
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/pojo/tcc-server.yaml
@@ -0,0 +1,108 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+swagger: '2.0'
+info:
+ title: cse test
+ version: 1.0.0
+ x-java-interface: org.apache.servicecomb.demo.tccserver.TestTcc
+
+# the domain of the service
+#host: api.uber.com
+
+# array of all schemes that your API supports
+#schemes:
+# - https
+
+# will be prefixed to all paths
+basePath: /pojo/rest/tcc-server
+produces:
+ - application/json
+
+paths:
+ /splitParam:
+ post:
+ operationId: splitParam
+ parameters:
+ - name: index
+ in: query
+ required: true
+ type: number
+ - name: user
+ in: body
+ schema:
+ $ref: '#/definitions/User'
+ responses:
+ "200":
+ description: asdf
+ schema:
+ $ref: '#/definitions/User'
+ default:
+ description: asf
+ schema:
+ $ref: '#/definitions/Error'
+ /wrapParam:
+ post:
+ operationId: wrapParam
+ parameters:
+ - name: TestRequest
+ in: body
+ required: true
+ schema:
+ $ref: '#/definitions/TestRequest'
+ responses:
+ "200":
+ description: asdf
+ schema:
+ $ref: '#/definitions/User'
+ default:
+ description: asf
+ schema:
+ $ref: '#/definitions/Error'
+
+definitions:
+ Error:
+ type: object
+ x-java-class: org.apache.servicecomb.core.exception.CommonExceptionData
+ properties:
+ message:
+ type: string
+ TestRequest:
+ type: object
+ properties:
+ index:
+ type: number
+ user:
+ $ref: '#/definitions/User'
+ users:
+ type: array
+ items:
+ $ref: '#/definitions/User'
+ data:
+ type: string
+ format: byte
+ User:
+ type: object
+ properties:
+ name:
+ type: string
+ age:
+ type: number
+ index:
+ type: number
diff --git a/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/springmvc/controller.yaml b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/springmvc/controller.yaml
new file mode 100644
index 0000000..be2feb0
--- /dev/null
+++ b/java-chassis-integration-tests/demo-schema/src/main/resources/microservices/springmvc/controller.yaml
@@ -0,0 +1,136 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+swagger: '2.0'
+info:
+ title: rest test
+ version: 1.0.0
+ x-java-interface: org.apache.servicecomb.demo.controller.Controller
+
+# the domain of the service
+#host: api.uber.com
+
+# array of all schemes that your API supports
+#schemes:
+# - https
+
+# will be prefixed to all paths
+basePath: /springmvc/controller
+produces:
+ - application/json
+
+paths:
+ /add:
+ get:
+ operationId: add
+ parameters:
+ - name: a
+ in: query
+ required: true
+ type: integer
+ format: int32
+ - name: b
+ in: query
+ required: true
+ type: integer
+ format: int32
+ responses:
+ "200":
+ description: add numer
+ schema:
+ type: integer
+ format: int32
+
+ /sayhello/{name}:
+ post:
+ operationId: sayHello
+ parameters:
+ - name: name
+ in: path
+ required: true
+ type: string
+ responses:
+ "200":
+ description: say hello
+ schema:
+ type: string
+ /saysomething:
+ post:
+ operationId: saySomething
+ parameters:
+ - name: prefix
+ in: query
+ required: true
+ type: string
+ - name: user
+ in: body
+ required: true
+ schema:
+ $ref: '#/definitions/Person'
+ responses:
+ "200":
+ description: say something
+ schema:
+ type: string
+ /sayhi:
+ get:
+ operationId: sayHi
+ parameters:
+ - name: name
+ in: query
+ required: true
+ type: string
+ responses:
+ "200":
+ description: say hi
+ schema:
+ type: string
+ /sayhei:
+ get:
+ operationId: sayHei
+ parameters:
+ - name: name
+ in: header
+ required: true
+ type: string
+ responses:
+ "200":
+ description: say hei
+ schema:
+ type: string
+ /sayHello1:
+ get:
+ operationId: sayHello1
+ parameters:
+ - name: name
+ in: query
+ required: true
+ type: string
+ responses:
+ "200":
+ description: check the handler is effective
+ schema:
+ type: string
+
+definitions:
+ Person:
+ type: object
+ properties:
+ name:
+ type: string
diff --git a/java-chassis-integration-tests/dynamic-config-tests/pom.xml b/java-chassis-integration-tests/dynamic-config-tests/pom.xml
new file mode 100644
index 0000000..e57c259
--- /dev/null
+++ b/java-chassis-integration-tests/dynamic-config-tests/pom.xml
@@ -0,0 +1,54 @@
+<?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.
+ -->
+<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">
+ <parent>
+ <artifactId>integration-tests</artifactId>
+ <groupId>org.apache.servicecomb.tests</groupId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dynamic-config-tests</artifactId>
+ <name>Java Chassis::Integration Tests::Dynamic Configuration</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>foundation-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.netflix.archaius</groupId>
+ <artifactId>archaius-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>config-apollo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/java-chassis-integration-tests/dynamic-config-tests/src/test/java/org/apache/dynamicconfig/test/DynamicConfigurationIT.java b/java-chassis-integration-tests/dynamic-config-tests/src/test/java/org/apache/dynamicconfig/test/DynamicConfigurationIT.java
new file mode 100644
index 0000000..96def08
--- /dev/null
+++ b/java-chassis-integration-tests/dynamic-config-tests/src/test/java/org/apache/dynamicconfig/test/DynamicConfigurationIT.java
@@ -0,0 +1,52 @@
+/*
+ * 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.dynamicconfig.test;
+
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
+import org.apache.servicecomb.foundation.common.utils.Log4jUtils;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import com.netflix.config.DynamicPropertyFactory;
+
+import io.vertx.core.Vertx;
+import org.junit.jupiter.api.Assertions;
+
+public class DynamicConfigurationIT {
+ private static Vertx vertx = null;
+
+ @BeforeAll
+ public static void setUp() throws Exception {
+ vertx = Vertx.vertx();
+ vertx.deployVerticle(new SimApolloServer());
+
+ Log4jUtils.init();
+ BeanUtils.init();
+ }
+
+ @AfterAll
+ public static void tearDown() {
+ vertx.close();
+ }
+
+ @Test
+ public void testDynamicConfiguration() {
+ Assertions.assertEquals(6666, DynamicPropertyFactory.getInstance().getIntProperty("timeout", 0).get());
+ }
+}
diff --git a/java-chassis-integration-tests/dynamic-config-tests/src/test/java/org/apache/dynamicconfig/test/SimApolloServer.java b/java-chassis-integration-tests/dynamic-config-tests/src/test/java/org/apache/dynamicconfig/test/SimApolloServer.java
new file mode 100644
index 0000000..1d46594
--- /dev/null
+++ b/java-chassis-integration-tests/dynamic-config-tests/src/test/java/org/apache/dynamicconfig/test/SimApolloServer.java
@@ -0,0 +1,43 @@
+/*
+ * 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.dynamicconfig.test;
+
+import io.vertx.core.AbstractVerticle;
+
+public class SimApolloServer extends AbstractVerticle {
+ public void start() {
+ String response = "{\n"
+ + " \"appId\": \"test\",\n"
+ + " \"clusterName\": \"default\",\n"
+ + " \"namespaceName\": \"application\",\n"
+ + " \"name\": \"20180703151728-release\",\n"
+ + " \"configurations\": {\n"
+ + " \"timeout\": \"6666\"\n"
+ + " },\n"
+ + " \"comment\": \"\",\n"
+ + " \"dataChangeCreatedBy\": \"apollo\",\n"
+ + " \"dataChangeLastModifiedBy\": \"apollo\",\n"
+ + " \"dataChangeCreatedTime\": \"2018-07-03T15:17:32.000+0800\",\n"
+ + " \"dataChangeLastModifiedTime\": \"2018-07-03T15:17:32.000+0800\"\n"
+ + "}";
+
+ vertx.createHttpServer().requestHandler(req -> req.response()
+ .putHeader("content-type", "application/json")
+ .end(response)).listen(23334);
+ }
+}
diff --git a/java-chassis-integration-tests/dynamic-config-tests/src/test/resources/config/log4j.z.properties b/java-chassis-integration-tests/dynamic-config-tests/src/test/resources/config/log4j.z.properties
new file mode 100644
index 0000000..cffdf89
--- /dev/null
+++ b/java-chassis-integration-tests/dynamic-config-tests/src/test/resources/config/log4j.z.properties
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+log4j.logger.runLogger=WARN
+log4j.rootLogger=WARN,paas,stdout
diff --git a/java-chassis-integration-tests/dynamic-config-tests/src/test/resources/microservice.yaml b/java-chassis-integration-tests/dynamic-config-tests/src/test/resources/microservice.yaml
new file mode 100644
index 0000000..b7b9e62
--- /dev/null
+++ b/java-chassis-integration-tests/dynamic-config-tests/src/test/resources/microservice.yaml
@@ -0,0 +1,33 @@
+#
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+APPLICATION_ID: dynamic-config-test
+service_description:
+ name: apollo-test
+ version: 1.0.1
+
+apollo:
+ config:
+ serverUri: http://localhost:23334
+ serviceName: SampleApp
+ env: DEV
+ clusters: default
+ namespace: application
+ token: testtoken
+ refreshInterval: 2
+
diff --git a/java-chassis-integration-tests/it-common/enable-it-jar b/java-chassis-integration-tests/it-common/enable-it-jar
new file mode 100644
index 0000000..2944f98
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/enable-it-jar
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
diff --git a/java-chassis-integration-tests/it-common/pom.xml b/java-chassis-integration-tests/it-common/pom.xml
new file mode 100644
index 0000000..120a556
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/pom.xml
@@ -0,0 +1,55 @@
+<?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.
+ -->
+<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">
+ <parent>
+ <artifactId>integration-tests</artifactId>
+ <groupId>org.apache.servicecomb.tests</groupId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>it-common</artifactId>
+ <name>Java Chassis::IT::Common</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>inspector</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-alpn-openjdk8-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-alpn-openjdk8-client</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/CommandReceiver.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/CommandReceiver.java
new file mode 100644
index 0000000..ac6b984
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/CommandReceiver.java
@@ -0,0 +1,101 @@
+/*
+ * 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.it;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.servicecomb.core.SCBEngine;
+import org.apache.servicecomb.core.SCBStatus;
+import org.apache.servicecomb.foundation.common.utils.JsonUtils;
+import org.apache.servicecomb.registry.RegistrationManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.TextNode;
+
+public class CommandReceiver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CommandReceiver.class);
+
+ public CommandReceiver() {
+ Thread thread = new Thread(this::run, "it-command-receiver");
+ thread.setDaemon(true);
+ thread.start();
+ }
+
+ public void run() {
+ try {
+ doRun();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void doRun() throws IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ try {
+ JsonNode cmd = JsonUtils.OBJ_MAPPER.readTree(line);
+ dispatchCommand(cmd);
+ } catch (Throwable e) {
+ LOGGER.error("Failed to execute command: {}", line, e);
+ }
+ }
+ reader.close();
+ }
+
+ private void dispatchCommand(JsonNode cmd) {
+ LOGGER.info("dispatch command: {}", cmd);
+ if (TextNode.class.isInstance(cmd)) {
+ onStringCommand(cmd.asText());
+ return;
+ }
+
+ throw new UnsupportedOperationException(cmd.toString());
+ }
+
+ protected void onStringCommand(String command) {
+ switch (command) {
+ case "ms-stop":
+ stop();
+ break;
+ default:
+ throw new UnsupportedOperationException(command);
+ }
+ }
+
+ protected void stop() {
+ new Thread(() -> {
+ for (; ; ) {
+ SCBEngine.getInstance().destroy();
+ if (ITBootListener.isDone() && SCBStatus.DOWN.equals(SCBEngine.getInstance().getStatus())) {
+ LOGGER.info("succeed to close " + RegistrationManager.INSTANCE.getMicroservice().getServiceName());
+ break;
+ }
+ ITUtils.forceWait(TimeUnit.SECONDS, 1);
+ }
+
+ //make sure kill for servlet
+ System.exit(0);
+ }, "it-stop").start();
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITBootListener.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITBootListener.java
new file mode 100644
index 0000000..185fb80
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITBootListener.java
@@ -0,0 +1,82 @@
+/*
+ * 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.it;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.servicecomb.core.BootListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import com.netflix.config.ConcurrentCompositeConfiguration;
+import com.netflix.config.DynamicPropertyFactory;
+
+@Component
+public class ITBootListener implements BootListener {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ITBootListener.class);
+
+ private static boolean done;
+
+ public static boolean isDone() {
+ return done;
+ }
+
+ @Override
+ public void onBootEvent(BootEvent event) {
+ if (!EventType.BEFORE_HANDLER.equals(event.getEventType())) {
+ return;
+ }
+
+ selectPort("servicecomb.rest.address");
+ selectPort("servicecomb.highway.address");
+ done = true;
+ }
+
+ protected void selectPort(String cfgKey) {
+ String endpoint = DynamicPropertyFactory.getInstance().getStringProperty(cfgKey, null).get();
+ if (endpoint == null) {
+ return;
+ }
+
+ URI uri = URI.create("http://" + endpoint);
+ if (uri.getPort() == 0) {
+ int port = getRandomPort();
+ try {
+ ConcurrentCompositeConfiguration config = (ConcurrentCompositeConfiguration) DynamicPropertyFactory
+ .getBackingConfigurationSource();
+ endpoint = new URIBuilder("http://" + endpoint).setPort(port).build().toString().substring(7);
+ config.getConfiguration(0).setProperty(cfgKey, endpoint);
+ LOGGER.info("change {} to {}.", cfgKey, endpoint);
+ } catch (URISyntaxException e) {
+ throw new IllegalStateException("Failed to build endpoint.", e);
+ }
+ }
+ }
+
+ protected int getRandomPort() {
+ try (ServerSocket serverSocket = new ServerSocket(0)) {
+ return serverSocket.getLocalPort();
+ } catch (IOException e) {
+ throw new IllegalStateException("Failed to get random port.", e);
+ }
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITMain.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITMain.java
new file mode 100644
index 0000000..7be9a46
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITMain.java
@@ -0,0 +1,27 @@
+/*
+ * 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.it;
+
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
+
+public class ITMain {
+ public static void main(String[] args) {
+ new CommandReceiver();
+
+ BeanUtils.init();
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITUtils.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITUtils.java
new file mode 100644
index 0000000..ce8f9da
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/ITUtils.java
@@ -0,0 +1,121 @@
+/*
+ * 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.it;
+
+import java.util.Comparator;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.reflect.MethodUtils;
+import org.apache.servicecomb.core.SCBEngine;
+import org.apache.servicecomb.core.SCBStatus;
+import org.apache.servicecomb.registry.DiscoveryManager;
+import org.apache.servicecomb.registry.api.registry.MicroserviceInstance;
+import org.apache.servicecomb.registry.consumer.MicroserviceVersionRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class ITUtils {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ITUtils.class);
+
+ private ITUtils() {
+ }
+
+ public static void forceWait(TimeUnit timeUnit, long timeout) {
+ try {
+ timeUnit.sleep(timeout);
+ } catch (InterruptedException e) {
+ // eat the exception
+ }
+ }
+
+ public static void waitBootFinished() {
+ for (; ; ) {
+ if (SCBEngine.getInstance().getStatus().equals(SCBStatus.UP)) {
+ return;
+ }
+
+ forceWait(TimeUnit.MILLISECONDS, 100);
+ }
+ }
+
+ public static Map<String, MicroserviceInstance> waitMicroserviceReadyAndLimit(String appId, String microserviceName,
+ String strVersionRule, int minInstanceCount) {
+ Map<String, MicroserviceInstance> instances = waitMicroserviceReady(appId,
+ microserviceName,
+ strVersionRule,
+ minInstanceCount);
+ return instances.values()
+ .stream()
+ .sorted(Comparator.comparing(MicroserviceInstance::getInstanceId))
+ .limit(minInstanceCount)
+ .collect(Collectors.toMap(MicroserviceInstance::getInstanceId, Function.identity()));
+ }
+
+ public static Map<String, MicroserviceInstance> waitMicroserviceReady(String appId, String microserviceName,
+ String strVersionRule, int minInstanceCount) {
+ LOGGER.info("waiting for microservice online. appId={}, name={}, minInstanceCount={}",
+ appId,
+ microserviceName,
+ minInstanceCount);
+
+ Map<String, MicroserviceInstance> instances;
+ for (; ; ) {
+ MicroserviceVersionRule microserviceVersionRule = DiscoveryManager.INSTANCE
+ .getAppManager()
+ .getOrCreateMicroserviceVersionRule(appId, microserviceName, strVersionRule);
+ instances = microserviceVersionRule.getInstances();
+ if (instances.size() >= minInstanceCount) {
+ break;
+ }
+
+ LOGGER.info(
+ "waiting for microservice online. appId={}, name={}, expect minInstanceCount={}, real instanceCount={}.",
+ appId,
+ microserviceName,
+ minInstanceCount,
+ instances.size());
+ // pull at once
+ DiscoveryManager.INSTANCE.getAppManager().pullInstances();
+ forceWait(TimeUnit.SECONDS, 1);
+ }
+
+ LOGGER.info("microservice already online. appId={}, name={}, instanceCount={}",
+ appId,
+ microserviceName,
+ minInstanceCount);
+ return instances;
+ }
+
+ public static void invokeExactStaticMethod(final Class<?>[] classes, final String methodName, Object... args) {
+ for (Class<?> cls : classes) {
+ invokeExactStaticMethod(cls, methodName, args);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T invokeExactStaticMethod(final Class<?> cls, final String methodName, Object... args) {
+ try {
+ return (T) MethodUtils.invokeExactStaticMethod(cls, methodName, args);
+ } catch (Throwable e) {
+ throw new IllegalStateException(String.format("Failed to invoke, class=%s, method=%s", cls.getName(), methodName),
+ e);
+ }
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/CommonModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/CommonModel.java
new file mode 100644
index 0000000..1dcebb0
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/CommonModel.java
@@ -0,0 +1,29 @@
+/*
+ * 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.it.schema;
+
+public class CommonModel {
+ private int iValue;
+
+ public int getiValue() {
+ return iValue;
+ }
+
+ public void setiValue(int iValue) {
+ this.iValue = iValue;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/DynamicColor.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/DynamicColor.java
new file mode 100644
index 0000000..c1d394a
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/DynamicColor.java
@@ -0,0 +1,42 @@
+/*
+ * 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.it.schema;
+
+import org.apache.servicecomb.foundation.common.base.DynamicEnum;
+import org.apache.servicecomb.foundation.common.base.DynamicEnumCache;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+public class DynamicColor extends DynamicEnum<String> {
+ public static final DynamicColor RED = new DynamicColor("RED");
+
+ public static final DynamicColor YELLOW = new DynamicColor("YELLOW");
+
+ public static final DynamicColor BLUE = new DynamicColor("BLUE");
+
+ private static final DynamicEnumCache<DynamicColor> CACHE = new DynamicEnumCache<>(DynamicColor.class);
+
+ public DynamicColor(String value) {
+ super(value);
+ }
+
+ @JsonCreator
+ public static DynamicColor fromValue(String value) {
+ return CACHE.fromValue(value);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/Generic.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/Generic.java
new file mode 100644
index 0000000..085b2d1
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/Generic.java
@@ -0,0 +1,21 @@
+/*
+ * 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.it.schema;
+
+public class Generic<T> {
+ public T value;
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/PersonViewModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/PersonViewModel.java
new file mode 100644
index 0000000..ea086d7
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/PersonViewModel.java
@@ -0,0 +1,128 @@
+/*
+ * 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.it.schema;
+
+import java.util.Objects;
+
+import com.fasterxml.jackson.annotation.JsonView;
+
+public class PersonViewModel {
+ public interface Summary {
+ }
+
+ public interface SummaryWithDetails extends Summary {
+ }
+
+ @JsonView(Summary.class)
+ private String name;
+
+ @JsonView(SummaryWithDetails.class)
+ private int age;
+
+ @JsonView(Summary.class)
+ private String emails;
+
+ @JsonView(SummaryWithDetails.class)
+ private String telephone;
+
+ private double rate;
+
+ public String getName() {
+ return name;
+ }
+
+ public PersonViewModel setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public PersonViewModel setAge(int age) {
+ this.age = age;
+ return this;
+ }
+
+ public String getEmails() {
+ return emails;
+ }
+
+ public PersonViewModel setEmails(String emails) {
+ this.emails = emails;
+ return this;
+ }
+
+ public String getTelephone() {
+ return telephone;
+ }
+
+ public PersonViewModel setTelephone(String telephone) {
+ this.telephone = telephone;
+ return this;
+ }
+
+ public double getRate() {
+ return rate;
+ }
+
+ public PersonViewModel setRate(double rate) {
+ this.rate = rate;
+ return this;
+ }
+
+ public static PersonViewModel generatePersonViewModel() {
+ return new PersonViewModel().setAge(12)
+ .setEmails("xxx@servicecomb.com")
+ .setName("servicecomb")
+ .setRate(99.9)
+ .setTelephone("xxx10--xx");
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ PersonViewModel that = (PersonViewModel) o;
+ return age == that.age &&
+ Double.compare(that.rate, rate) == 0 &&
+ Objects.equals(name, that.name) &&
+ Objects.equals(emails, that.emails) &&
+ Objects.equals(telephone, that.telephone);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, age, emails, telephone, rate);
+ }
+
+ @Override
+ public String toString() {
+ return "PersonViewModel{" +
+ "name='" + name + '\'' +
+ ", age=" + age +
+ ", emails='" + emails + '\'' +
+ ", telephone='" + telephone + '\'' +
+ ", rate=" + rate +
+ '}';
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ReactiveHelloIntf.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ReactiveHelloIntf.java
new file mode 100644
index 0000000..5f9cbd0
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ReactiveHelloIntf.java
@@ -0,0 +1,23 @@
+/*
+ * 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.it.schema;
+
+import java.util.concurrent.CompletableFuture;
+
+public interface ReactiveHelloIntf {
+ CompletableFuture<String> hello(String name);
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/RequestBaseModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/RequestBaseModel.java
new file mode 100644
index 0000000..30e1631
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/RequestBaseModel.java
@@ -0,0 +1,49 @@
+/*
+ * 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.it.schema;
+
+public class RequestBaseModel {
+ private int type;
+
+ private Integer integerType;
+
+ private String message;
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+ public Integer getIntegerType() {
+ return integerType;
+ }
+
+ public void setIntegerType(Integer integerType) {
+ this.integerType = integerType;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/RequestModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/RequestModel.java
new file mode 100644
index 0000000..945a87f
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/RequestModel.java
@@ -0,0 +1,49 @@
+/*
+ * 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.it.schema;
+
+public class RequestModel extends RequestBaseModel {
+ private int catalog;
+
+ private Integer integerCatalog;
+
+ private String extendedMessage;
+
+ public int getCatalog() {
+ return catalog;
+ }
+
+ public void setCatalog(int catalog) {
+ this.catalog = catalog;
+ }
+
+ public Integer getIntegerCatalog() {
+ return integerCatalog;
+ }
+
+ public void setIntegerCatalog(Integer integerCatalog) {
+ this.integerCatalog = integerCatalog;
+ }
+
+ public String getExtendedMessage() {
+ return extendedMessage;
+ }
+
+ public void setExtendedMessage(String extendedMessage) {
+ this.extendedMessage = extendedMessage;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ResponseBaseModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ResponseBaseModel.java
new file mode 100644
index 0000000..e045ef7
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ResponseBaseModel.java
@@ -0,0 +1,49 @@
+/*
+ * 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.it.schema;
+
+public class ResponseBaseModel {
+ private int type;
+
+ private Integer integerType;
+
+ private String message;
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+ public Integer getIntegerType() {
+ return integerType;
+ }
+
+ public void setIntegerType(Integer integerType) {
+ this.integerType = integerType;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ResponseModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ResponseModel.java
new file mode 100644
index 0000000..e816aa6
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/ResponseModel.java
@@ -0,0 +1,49 @@
+/*
+ * 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.it.schema;
+
+public class ResponseModel extends ResponseBaseModel {
+ private int catalog;
+
+ private Integer integerCatalog;
+
+ private String extendedMessage;
+
+ public int getCatalog() {
+ return catalog;
+ }
+
+ public void setCatalog(int catalog) {
+ this.catalog = catalog;
+ }
+
+ public Integer getIntegerCatalog() {
+ return integerCatalog;
+ }
+
+ public void setIntegerCatalog(Integer integerCatalog) {
+ this.integerCatalog = integerCatalog;
+ }
+
+ public String getExtendedMessage() {
+ return extendedMessage;
+ }
+
+ public void setExtendedMessage(String extendedMessage) {
+ this.extendedMessage = extendedMessage;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/User.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/User.java
new file mode 100644
index 0000000..f9b38a8
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/User.java
@@ -0,0 +1,101 @@
+/*
+ * 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.it.schema;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+import org.apache.servicecomb.foundation.common.utils.JsonUtils;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+public class User {
+ private String name = "nameA";
+
+ private int age = 100;
+
+ private int index;
+
+ private String[] names;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String[] getNames() {
+ return names;
+ }
+
+ public void setNames(String[] names) {
+ this.names = names;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ @Override
+ public String toString() {
+ return "User [name=" + name + ", age=" + age + ", index=" + index + "]";
+ }
+
+ public String jsonString() {
+ try {
+ return JsonUtils.writeValueAsString(this);
+ } catch (JsonProcessingException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ User user = (User) o;
+ return age == user.age &&
+ index == user.index &&
+ name == null ? user.name == null : name.equals(user.name) &&
+ names == null ? user.names == null : Arrays.equals(names, user.names);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = Objects.hash(name, age, index);
+ result = 31 * result + Arrays.hashCode(names);
+ return result;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBaseService.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBaseService.java
new file mode 100644
index 0000000..356f354
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBaseService.java
@@ -0,0 +1,67 @@
+/*
+ * 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.it.schema.generic;
+
+import java.util.List;
+
+import io.swagger.annotations.ApiOperation;
+
+public class AbstractBaseService<T extends AbstractBean> implements IBaseService<T> {
+ private IBaseService<T> target;
+
+ protected AbstractBaseService(IBaseService<T> t) {
+ target = t;
+ }
+
+ @Override
+ @ApiOperation(nickname = "hello", value = "hello")
+ public T hello(T a) {
+ return target.hello(a);
+ }
+
+ @Override
+ @ApiOperation(nickname = "helloWithValue", value = "helloWithValue")
+ public T hello(T a, String value) {
+ return target.hello(a, value);
+ }
+
+ @Override
+ public T[] helloBody(T[] a) {
+ return target.helloBody(a);
+ }
+
+ @Override
+ public List<T> helloList(List<T> a) {
+ return a;
+ }
+
+ @Override
+ public PersonBean actual() {
+ return target.actual();
+ }
+
+ @Override
+ public PersonBean objectParam(Object obj) {
+ return target.objectParam(obj);
+ }
+
+ @Override
+ public PersonBean objectParamTwo(Object obj, String name) {
+ return target.objectParamTwo(obj, name);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBean.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBean.java
new file mode 100644
index 0000000..af0366e
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBean.java
@@ -0,0 +1,30 @@
+/*
+ * 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.it.schema.generic;
+
+public abstract class AbstractBean {
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/IBaseService.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/IBaseService.java
new file mode 100644
index 0000000..74fc5ee
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/IBaseService.java
@@ -0,0 +1,40 @@
+/*
+ * 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.it.schema.generic;
+
+import java.util.List;
+
+import io.swagger.annotations.ApiOperation;
+
+public interface IBaseService<T extends AbstractBean> {
+ @ApiOperation(nickname = "hello", value = "hello")
+ T hello(T a);
+
+ @ApiOperation(nickname = "helloWithValue", value = "helloWithValue")
+ T hello(T a, String value);
+
+ T[] helloBody(T[] a);
+
+ List<T> helloList(List<T> a);
+
+ PersonBean actual();
+
+ PersonBean objectParam(Object obj);
+
+ PersonBean objectParamTwo(Object obj, String name);
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/IMyService.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/IMyService.java
new file mode 100644
index 0000000..05f07f6
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/IMyService.java
@@ -0,0 +1,21 @@
+/*
+ * 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.it.schema.generic;
+
+public interface IMyService extends IBaseService<PersonBean> {
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/PersonBean.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/PersonBean.java
new file mode 100644
index 0000000..922fc3d
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/PersonBean.java
@@ -0,0 +1,21 @@
+/*
+ * 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.it.schema.generic;
+
+public class PersonBean extends AbstractBean {
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/BeanParamRequest.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/BeanParamRequest.java
new file mode 100644
index 0000000..915b63d
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/BeanParamRequest.java
@@ -0,0 +1,107 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.List;
+
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class BeanParamRequest {
+ private String path;
+
+ @QueryParam("query")
+ private int query;
+
+ @HeaderParam("header")
+ private String header;
+
+ @QueryParam("query_array")
+ private String[] queryArray;
+
+ @QueryParam("query_list")
+ private List<String> queryList;
+
+ @JsonIgnore
+ private List<FlattenObjectRequest> ignored;
+
+ public BeanParamRequest() {
+ }
+
+ public BeanParamRequest(String path, int query, String header, String[] queryArray, List<String> queryList) {
+ this.path = path;
+ this.query = query;
+ this.header = header;
+ this.queryArray = queryArray;
+ this.queryList = queryList;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ @PathParam("path")
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public int getQuery() {
+ return query;
+ }
+
+ public void setQuery(int query) {
+ this.query = query;
+ }
+
+ public String getHeader() {
+ return header;
+ }
+
+ public void setHeader(String header) {
+ this.header = header;
+ }
+
+ public String[] getQueryArray() {
+ return queryArray;
+ }
+
+ public BeanParamRequest setQueryArray(String[] queryArray) {
+ this.queryArray = queryArray;
+ return this;
+ }
+
+ public List<String> getQueryList() {
+ return queryList;
+ }
+
+ public BeanParamRequest setQueryList(List<String> queryList) {
+ this.queryList = queryList;
+ return this;
+ }
+
+ public List<FlattenObjectRequest> getIgnored() {
+ return ignored;
+ }
+
+ public void setIgnored(List<FlattenObjectRequest> ignored) {
+ this.ignored = ignored;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/Color.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/Color.java
new file mode 100644
index 0000000..6924149
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/Color.java
@@ -0,0 +1,24 @@
+/*
+ * 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.it.schema.objectparams;
+
+public enum Color {
+ RED,
+ BLUE,
+ GREEN
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FlattenObjectRequest.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FlattenObjectRequest.java
new file mode 100644
index 0000000..71ff6b3
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FlattenObjectRequest.java
@@ -0,0 +1,287 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class FlattenObjectRequest {
+ private byte anByte;
+
+ private short anShort;
+
+ private int anInt;
+
+ private long anLong;
+
+ private float anFloat;
+
+ private double anDouble;
+
+ private boolean anBoolean;
+
+ private char anChar;
+
+ private Byte anWrappedByte;
+
+ private Short anWrappedShort;
+
+ private Integer anWrappedInteger;
+
+ private Long anWrappedLong;
+
+ private Float anWrappedFloat;
+
+ private Double anWrappedDouble;
+
+ private Boolean anWrappedBoolean;
+
+ private Character anWrappedCharacter;
+
+ private String string;
+
+ private Color color;
+
+ public byte getAnByte() {
+ return anByte;
+ }
+
+ public void setAnByte(byte anByte) {
+ this.anByte = anByte;
+ }
+
+ public short getAnShort() {
+ return anShort;
+ }
+
+ public void setAnShort(short anShort) {
+ this.anShort = anShort;
+ }
+
+ public int getAnInt() {
+ return anInt;
+ }
+
+ public void setAnInt(int anInt) {
+ this.anInt = anInt;
+ }
+
+ public long getAnLong() {
+ return anLong;
+ }
+
+ public void setAnLong(long anLong) {
+ this.anLong = anLong;
+ }
+
+ public float getAnFloat() {
+ return anFloat;
+ }
+
+ public void setAnFloat(float anFloat) {
+ this.anFloat = anFloat;
+ }
+
+ public double getAnDouble() {
+ return anDouble;
+ }
+
+ public void setAnDouble(double anDouble) {
+ this.anDouble = anDouble;
+ }
+
+ public boolean isAnBoolean() {
+ return anBoolean;
+ }
+
+ public void setAnBoolean(boolean anBoolean) {
+ this.anBoolean = anBoolean;
+ }
+
+ public char getAnChar() {
+ return anChar;
+ }
+
+ public void setAnChar(char anChar) {
+ this.anChar = anChar;
+ }
+
+ public Byte getAnWrappedByte() {
+ return anWrappedByte;
+ }
+
+ public void setAnWrappedByte(Byte anWrappedByte) {
+ this.anWrappedByte = anWrappedByte;
+ }
+
+ public Short getAnWrappedShort() {
+ return anWrappedShort;
+ }
+
+ public void setAnWrappedShort(Short anWrappedShort) {
+ this.anWrappedShort = anWrappedShort;
+ }
+
+ public Integer getAnWrappedInteger() {
+ return anWrappedInteger;
+ }
+
+ public void setAnWrappedInteger(Integer anWrappedInteger) {
+ this.anWrappedInteger = anWrappedInteger;
+ }
+
+ public Long getAnWrappedLong() {
+ return anWrappedLong;
+ }
+
+ public void setAnWrappedLong(Long anWrappedLong) {
+ this.anWrappedLong = anWrappedLong;
+ }
+
+ public Float getAnWrappedFloat() {
+ return anWrappedFloat;
+ }
+
+ public void setAnWrappedFloat(Float anWrappedFloat) {
+ this.anWrappedFloat = anWrappedFloat;
+ }
+
+ public Double getAnWrappedDouble() {
+ return anWrappedDouble;
+ }
+
+ public void setAnWrappedDouble(Double anWrappedDouble) {
+ this.anWrappedDouble = anWrappedDouble;
+ }
+
+ public Boolean getAnWrappedBoolean() {
+ return anWrappedBoolean;
+ }
+
+ public void setAnWrappedBoolean(Boolean anWrappedBoolean) {
+ this.anWrappedBoolean = anWrappedBoolean;
+ }
+
+ public Character getAnWrappedCharacter() {
+ return anWrappedCharacter;
+ }
+
+ public void setAnWrappedCharacter(Character anWrappedCharacter) {
+ this.anWrappedCharacter = anWrappedCharacter;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("FlattenObjectRequest{");
+ sb.append("anByte=").append(anByte);
+ sb.append(", anShort=").append(anShort);
+ sb.append(", anInt=").append(anInt);
+ sb.append(", anLong=").append(anLong);
+ sb.append(", anFloat=").append(anFloat);
+ sb.append(", anDouble=").append(anDouble);
+ sb.append(", anBoolean=").append(anBoolean);
+ sb.append(", anChar=").append(anChar);
+ sb.append(", anWrappedByte=").append(anWrappedByte);
+ sb.append(", anWrappedShort=").append(anWrappedShort);
+ sb.append(", anWrappedInteger=").append(anWrappedInteger);
+ sb.append(", anWrappedLong=").append(anWrappedLong);
+ sb.append(", anWrappedFloat=").append(anWrappedFloat);
+ sb.append(", anWrappedDouble=").append(anWrappedDouble);
+ sb.append(", anWrappedBoolean=").append(anWrappedBoolean);
+ sb.append(", anWrappedCharacter=").append(anWrappedCharacter);
+ sb.append(", string='").append(string).append('\'');
+ sb.append(", color=").append(color);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FlattenObjectRequest that = (FlattenObjectRequest) o;
+ return anByte == that.anByte &&
+ anShort == that.anShort &&
+ anInt == that.anInt &&
+ anLong == that.anLong &&
+ Float.compare(that.anFloat, anFloat) == 0 &&
+ Double.compare(that.anDouble, anDouble) == 0 &&
+ anBoolean == that.anBoolean &&
+ anChar == that.anChar &&
+ Objects.equals(anWrappedByte, that.anWrappedByte) &&
+ Objects.equals(anWrappedShort, that.anWrappedShort) &&
+ Objects.equals(anWrappedInteger, that.anWrappedInteger) &&
+ Objects.equals(anWrappedLong, that.anWrappedLong) &&
+ Objects.equals(anWrappedFloat, that.anWrappedFloat) &&
+ Objects.equals(anWrappedDouble, that.anWrappedDouble) &&
+ Objects.equals(anWrappedBoolean, that.anWrappedBoolean) &&
+ Objects.equals(anWrappedCharacter, that.anWrappedCharacter) &&
+ Objects.equals(string, that.string) &&
+ color == that.color;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(anByte, anShort, anInt, anLong, anFloat, anDouble, anBoolean, anChar, anWrappedByte, anWrappedShort,
+ anWrappedInteger,
+ anWrappedLong, anWrappedFloat, anWrappedDouble, anWrappedBoolean, anWrappedCharacter, string, color);
+ }
+
+ public static FlattenObjectRequest createFlattenObjectRequest() {
+ FlattenObjectRequest request = new FlattenObjectRequest();
+ request.setAnByte((byte) 8);
+ request.setAnShort((short) 7);
+ request.setAnInt(6);
+ request.setAnLong(5);
+ request.setAnFloat(4.4f);
+ request.setAnDouble(3.3);
+ request.setAnBoolean(true);
+ request.setAnChar('c');
+ request.setAnWrappedByte((byte) 16);
+ request.setAnWrappedShort((short) 15);
+ request.setAnWrappedInteger(14);
+ request.setAnWrappedLong(13L);
+ request.setAnWrappedFloat(12.2f);
+ request.setAnWrappedDouble(11.1);
+ request.setAnWrappedBoolean(true);
+ request.setAnWrappedCharacter('d');
+ request.setString("abc");
+ request.setColor(Color.BLUE);
+ return request;
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FlattenObjectResponse.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FlattenObjectResponse.java
new file mode 100644
index 0000000..4c9bece
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FlattenObjectResponse.java
@@ -0,0 +1,264 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class FlattenObjectResponse {
+ private byte anByte;
+
+ private short anShort;
+
+ private int anInt;
+
+ private long anLong;
+
+ private float anFloat;
+
+ private double anDouble;
+
+ private boolean anBoolean;
+
+ private char anChar;
+
+ private Byte anWrappedByte;
+
+ private Short anWrappedShort;
+
+ private Integer anWrappedInteger;
+
+ private Long anWrappedLong;
+
+ private Float anWrappedFloat;
+
+ private Double anWrappedDouble;
+
+ private Boolean anWrappedBoolean;
+
+ private Character anWrappedCharacter;
+
+ private String string;
+
+ private Color color;
+
+ public byte getAnByte() {
+ return anByte;
+ }
+
+ public void setAnByte(byte anByte) {
+ this.anByte = anByte;
+ }
+
+ public short getAnShort() {
+ return anShort;
+ }
+
+ public void setAnShort(short anShort) {
+ this.anShort = anShort;
+ }
+
+ public int getAnInt() {
+ return anInt;
+ }
+
+ public void setAnInt(int anInt) {
+ this.anInt = anInt;
+ }
+
+ public long getAnLong() {
+ return anLong;
+ }
+
+ public void setAnLong(long anLong) {
+ this.anLong = anLong;
+ }
+
+ public float getAnFloat() {
+ return anFloat;
+ }
+
+ public void setAnFloat(float anFloat) {
+ this.anFloat = anFloat;
+ }
+
+ public double getAnDouble() {
+ return anDouble;
+ }
+
+ public void setAnDouble(double anDouble) {
+ this.anDouble = anDouble;
+ }
+
+ public boolean isAnBoolean() {
+ return anBoolean;
+ }
+
+ public void setAnBoolean(boolean anBoolean) {
+ this.anBoolean = anBoolean;
+ }
+
+ public char getAnChar() {
+ return anChar;
+ }
+
+ public void setAnChar(char anChar) {
+ this.anChar = anChar;
+ }
+
+ public Byte getAnWrappedByte() {
+ return anWrappedByte;
+ }
+
+ public void setAnWrappedByte(Byte anWrappedByte) {
+ this.anWrappedByte = anWrappedByte;
+ }
+
+ public Short getAnWrappedShort() {
+ return anWrappedShort;
+ }
+
+ public void setAnWrappedShort(Short anWrappedShort) {
+ this.anWrappedShort = anWrappedShort;
+ }
+
+ public Integer getAnWrappedInteger() {
+ return anWrappedInteger;
+ }
+
+ public void setAnWrappedInteger(Integer anWrappedInteger) {
+ this.anWrappedInteger = anWrappedInteger;
+ }
+
+ public Long getAnWrappedLong() {
+ return anWrappedLong;
+ }
+
+ public void setAnWrappedLong(Long anWrappedLong) {
+ this.anWrappedLong = anWrappedLong;
+ }
+
+ public Float getAnWrappedFloat() {
+ return anWrappedFloat;
+ }
+
+ public void setAnWrappedFloat(Float anWrappedFloat) {
+ this.anWrappedFloat = anWrappedFloat;
+ }
+
+ public Double getAnWrappedDouble() {
+ return anWrappedDouble;
+ }
+
+ public void setAnWrappedDouble(Double anWrappedDouble) {
+ this.anWrappedDouble = anWrappedDouble;
+ }
+
+ public Boolean getAnWrappedBoolean() {
+ return anWrappedBoolean;
+ }
+
+ public void setAnWrappedBoolean(Boolean anWrappedBoolean) {
+ this.anWrappedBoolean = anWrappedBoolean;
+ }
+
+ public Character getAnWrappedCharacter() {
+ return anWrappedCharacter;
+ }
+
+ public void setAnWrappedCharacter(Character anWrappedCharacter) {
+ this.anWrappedCharacter = anWrappedCharacter;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("FlattenObjectResponse{");
+ sb.append("anByte=").append(anByte);
+ sb.append(", anShort=").append(anShort);
+ sb.append(", anInt=").append(anInt);
+ sb.append(", anLong=").append(anLong);
+ sb.append(", anFloat=").append(anFloat);
+ sb.append(", anDouble=").append(anDouble);
+ sb.append(", anBoolean=").append(anBoolean);
+ sb.append(", anChar=").append(anChar);
+ sb.append(", anWrappedByte=").append(anWrappedByte);
+ sb.append(", anWrappedShort=").append(anWrappedShort);
+ sb.append(", anWrappedInteger=").append(anWrappedInteger);
+ sb.append(", anWrappedLong=").append(anWrappedLong);
+ sb.append(", anWrappedFloat=").append(anWrappedFloat);
+ sb.append(", anWrappedDouble=").append(anWrappedDouble);
+ sb.append(", anWrappedBoolean=").append(anWrappedBoolean);
+ sb.append(", anWrappedCharacter=").append(anWrappedCharacter);
+ sb.append(", string='").append(string).append('\'');
+ sb.append(", color=").append(color);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FlattenObjectResponse that = (FlattenObjectResponse) o;
+ return anByte == that.anByte &&
+ anShort == that.anShort &&
+ anInt == that.anInt &&
+ anLong == that.anLong &&
+ Float.compare(that.anFloat, anFloat) == 0 &&
+ Double.compare(that.anDouble, anDouble) == 0 &&
+ anBoolean == that.anBoolean &&
+ anChar == that.anChar &&
+ Objects.equals(anWrappedByte, that.anWrappedByte) &&
+ Objects.equals(anWrappedShort, that.anWrappedShort) &&
+ Objects.equals(anWrappedInteger, that.anWrappedInteger) &&
+ Objects.equals(anWrappedLong, that.anWrappedLong) &&
+ Objects.equals(anWrappedFloat, that.anWrappedFloat) &&
+ Objects.equals(anWrappedDouble, that.anWrappedDouble) &&
+ Objects.equals(anWrappedBoolean, that.anWrappedBoolean) &&
+ Objects.equals(anWrappedCharacter, that.anWrappedCharacter) &&
+ Objects.equals(string, that.string) &&
+ color == that.color;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(anByte, anShort, anInt, anLong, anFloat, anDouble, anBoolean, anChar, anWrappedByte, anWrappedShort,
+ anWrappedInteger,
+ anWrappedLong, anWrappedFloat, anWrappedDouble, anWrappedBoolean, anWrappedCharacter, string, color);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterBeanParamRequest.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterBeanParamRequest.java
new file mode 100644
index 0000000..d528adf
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterBeanParamRequest.java
@@ -0,0 +1,118 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.List;
+import java.util.Objects;
+
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class FluentSetterBeanParamRequest {
+ private String path;
+
+ @QueryParam("query")
+ private int query;
+
+ @HeaderParam("header")
+ private String header;
+
+ @JsonIgnore
+ private List<FlattenObjectRequest> ignored;
+
+ public FluentSetterBeanParamRequest() {
+ }
+
+ public FluentSetterBeanParamRequest(String path, int query, String header) {
+ this.path = path;
+ this.query = query;
+ this.header = header;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ @PathParam("path")
+ public FluentSetterBeanParamRequest setPath(String path) {
+ this.path = path;
+ return this;
+ }
+
+ public int getQuery() {
+ return query;
+ }
+
+ public FluentSetterBeanParamRequest setQuery(int query) {
+ this.query = query;
+ return this;
+ }
+
+ public String getHeader() {
+ return header;
+ }
+
+ public FluentSetterBeanParamRequest setHeader(String header) {
+ this.header = header;
+ return this;
+ }
+
+ public List<FlattenObjectRequest> getIgnored() {
+ return ignored;
+ }
+
+ public FluentSetterBeanParamRequest setIgnored(
+ List<FlattenObjectRequest> ignored) {
+ this.ignored = ignored;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("BeanParamRequest{");
+ sb.append("path='").append(path).append('\'');
+ sb.append(", query=").append(query);
+ sb.append(", header='").append(header).append('\'');
+ sb.append(", ignored=").append(ignored);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FluentSetterBeanParamRequest that = (FluentSetterBeanParamRequest) o;
+ return query == that.query &&
+ Objects.equals(path, that.path) &&
+ Objects.equals(header, that.header) &&
+ Objects.equals(ignored, that.ignored);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(path, query, header, ignored);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterFlattenObjectRequest.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterFlattenObjectRequest.java
new file mode 100644
index 0000000..425080b
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterFlattenObjectRequest.java
@@ -0,0 +1,304 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class FluentSetterFlattenObjectRequest {
+ private byte anByte;
+
+ private short anShort;
+
+ private int anInt;
+
+ private long anLong;
+
+ private float anFloat;
+
+ private double anDouble;
+
+ private boolean anBoolean;
+
+ private char anChar;
+
+ private Byte anWrappedByte;
+
+ private Short anWrappedShort;
+
+ private Integer anWrappedInteger;
+
+ private Long anWrappedLong;
+
+ private Float anWrappedFloat;
+
+ private Double anWrappedDouble;
+
+ private Boolean anWrappedBoolean;
+
+ private Character anWrappedCharacter;
+
+ private String string;
+
+ private Color color;
+
+ public byte getAnByte() {
+ return anByte;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnByte(byte anByte) {
+ this.anByte = anByte;
+ return this;
+ }
+
+ public short getAnShort() {
+ return anShort;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnShort(short anShort) {
+ this.anShort = anShort;
+ return this;
+ }
+
+ public int getAnInt() {
+ return anInt;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnInt(int anInt) {
+ this.anInt = anInt;
+ return this;
+ }
+
+ public long getAnLong() {
+ return anLong;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnLong(long anLong) {
+ this.anLong = anLong;
+ return this;
+ }
+
+ public float getAnFloat() {
+ return anFloat;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnFloat(float anFloat) {
+ this.anFloat = anFloat;
+ return this;
+ }
+
+ public double getAnDouble() {
+ return anDouble;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnDouble(double anDouble) {
+ this.anDouble = anDouble;
+ return this;
+ }
+
+ public boolean isAnBoolean() {
+ return anBoolean;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnBoolean(boolean anBoolean) {
+ this.anBoolean = anBoolean;
+ return this;
+ }
+
+ public char getAnChar() {
+ return anChar;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnChar(char anChar) {
+ this.anChar = anChar;
+ return this;
+ }
+
+ public Byte getAnWrappedByte() {
+ return anWrappedByte;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedByte(Byte anWrappedByte) {
+ this.anWrappedByte = anWrappedByte;
+ return this;
+ }
+
+ public Short getAnWrappedShort() {
+ return anWrappedShort;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedShort(Short anWrappedShort) {
+ this.anWrappedShort = anWrappedShort;
+ return this;
+ }
+
+ public Integer getAnWrappedInteger() {
+ return anWrappedInteger;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedInteger(Integer anWrappedInteger) {
+ this.anWrappedInteger = anWrappedInteger;
+ return this;
+ }
+
+ public Long getAnWrappedLong() {
+ return anWrappedLong;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedLong(Long anWrappedLong) {
+ this.anWrappedLong = anWrappedLong;
+ return this;
+ }
+
+ public Float getAnWrappedFloat() {
+ return anWrappedFloat;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedFloat(Float anWrappedFloat) {
+ this.anWrappedFloat = anWrappedFloat;
+ return this;
+ }
+
+ public Double getAnWrappedDouble() {
+ return anWrappedDouble;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedDouble(Double anWrappedDouble) {
+ this.anWrappedDouble = anWrappedDouble;
+ return this;
+ }
+
+ public Boolean getAnWrappedBoolean() {
+ return anWrappedBoolean;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedBoolean(Boolean anWrappedBoolean) {
+ this.anWrappedBoolean = anWrappedBoolean;
+ return this;
+ }
+
+ public Character getAnWrappedCharacter() {
+ return anWrappedCharacter;
+ }
+
+ public FluentSetterFlattenObjectRequest setAnWrappedCharacter(Character anWrappedCharacter) {
+ this.anWrappedCharacter = anWrappedCharacter;
+ return this;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public FluentSetterFlattenObjectRequest setString(String string) {
+ this.string = string;
+ return this;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public FluentSetterFlattenObjectRequest setColor(Color color) {
+ this.color = color;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("FlattenObjectRequest{");
+ sb.append("anByte=").append(anByte);
+ sb.append(", anShort=").append(anShort);
+ sb.append(", anInt=").append(anInt);
+ sb.append(", anLong=").append(anLong);
+ sb.append(", anFloat=").append(anFloat);
+ sb.append(", anDouble=").append(anDouble);
+ sb.append(", anBoolean=").append(anBoolean);
+ sb.append(", anChar=").append(anChar);
+ sb.append(", anWrappedByte=").append(anWrappedByte);
+ sb.append(", anWrappedShort=").append(anWrappedShort);
+ sb.append(", anWrappedInteger=").append(anWrappedInteger);
+ sb.append(", anWrappedLong=").append(anWrappedLong);
+ sb.append(", anWrappedFloat=").append(anWrappedFloat);
+ sb.append(", anWrappedDouble=").append(anWrappedDouble);
+ sb.append(", anWrappedBoolean=").append(anWrappedBoolean);
+ sb.append(", anWrappedCharacter=").append(anWrappedCharacter);
+ sb.append(", string='").append(string).append('\'');
+ sb.append(", color=").append(color);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FluentSetterFlattenObjectRequest that = (FluentSetterFlattenObjectRequest) o;
+ return anByte == that.anByte &&
+ anShort == that.anShort &&
+ anInt == that.anInt &&
+ anLong == that.anLong &&
+ Float.compare(that.anFloat, anFloat) == 0 &&
+ Double.compare(that.anDouble, anDouble) == 0 &&
+ anBoolean == that.anBoolean &&
+ anChar == that.anChar &&
+ Objects.equals(anWrappedByte, that.anWrappedByte) &&
+ Objects.equals(anWrappedShort, that.anWrappedShort) &&
+ Objects.equals(anWrappedInteger, that.anWrappedInteger) &&
+ Objects.equals(anWrappedLong, that.anWrappedLong) &&
+ Objects.equals(anWrappedFloat, that.anWrappedFloat) &&
+ Objects.equals(anWrappedDouble, that.anWrappedDouble) &&
+ Objects.equals(anWrappedBoolean, that.anWrappedBoolean) &&
+ Objects.equals(anWrappedCharacter, that.anWrappedCharacter) &&
+ Objects.equals(string, that.string) &&
+ color == that.color;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(anByte, anShort, anInt, anLong, anFloat, anDouble, anBoolean, anChar, anWrappedByte, anWrappedShort,
+ anWrappedInteger,
+ anWrappedLong, anWrappedFloat, anWrappedDouble, anWrappedBoolean, anWrappedCharacter, string, color);
+ }
+
+ public static FluentSetterFlattenObjectRequest createFlattenObjectRequest() {
+ FluentSetterFlattenObjectRequest request = new FluentSetterFlattenObjectRequest();
+ return request.setAnByte((byte) 8)
+ .setAnShort((short) 7)
+ .setAnInt(6)
+ .setAnLong(5)
+ .setAnFloat(4.4f)
+ .setAnDouble(3.3)
+ .setAnBoolean(true)
+ .setAnChar('c')
+ .setAnWrappedByte((byte) 16)
+ .setAnWrappedShort((short) 15)
+ .setAnWrappedInteger(14)
+ .setAnWrappedLong(13L)
+ .setAnWrappedFloat(12.2f)
+ .setAnWrappedDouble(11.1)
+ .setAnWrappedBoolean(true)
+ .setAnWrappedCharacter('d')
+ .setString("abc")
+ .setColor(Color.BLUE);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterFlattenObjectResponse.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterFlattenObjectResponse.java
new file mode 100644
index 0000000..76b897c
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/FluentSetterFlattenObjectResponse.java
@@ -0,0 +1,282 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class FluentSetterFlattenObjectResponse {
+ private byte anByte;
+
+ private short anShort;
+
+ private int anInt;
+
+ private long anLong;
+
+ private float anFloat;
+
+ private double anDouble;
+
+ private boolean anBoolean;
+
+ private char anChar;
+
+ private Byte anWrappedByte;
+
+ private Short anWrappedShort;
+
+ private Integer anWrappedInteger;
+
+ private Long anWrappedLong;
+
+ private Float anWrappedFloat;
+
+ private Double anWrappedDouble;
+
+ private Boolean anWrappedBoolean;
+
+ private Character anWrappedCharacter;
+
+ private String string;
+
+ private Color color;
+
+ public byte getAnByte() {
+ return anByte;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnByte(byte anByte) {
+ this.anByte = anByte;
+ return this;
+ }
+
+ public short getAnShort() {
+ return anShort;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnShort(short anShort) {
+ this.anShort = anShort;
+ return this;
+ }
+
+ public int getAnInt() {
+ return anInt;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnInt(int anInt) {
+ this.anInt = anInt;
+ return this;
+ }
+
+ public long getAnLong() {
+ return anLong;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnLong(long anLong) {
+ this.anLong = anLong;
+ return this;
+ }
+
+ public float getAnFloat() {
+ return anFloat;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnFloat(float anFloat) {
+ this.anFloat = anFloat;
+ return this;
+ }
+
+ public double getAnDouble() {
+ return anDouble;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnDouble(double anDouble) {
+ this.anDouble = anDouble;
+ return this;
+ }
+
+ public boolean isAnBoolean() {
+ return anBoolean;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnBoolean(boolean anBoolean) {
+ this.anBoolean = anBoolean;
+ return this;
+ }
+
+ public char getAnChar() {
+ return anChar;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnChar(char anChar) {
+ this.anChar = anChar;
+ return this;
+ }
+
+ public Byte getAnWrappedByte() {
+ return anWrappedByte;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedByte(Byte anWrappedByte) {
+ this.anWrappedByte = anWrappedByte;
+ return this;
+ }
+
+ public Short getAnWrappedShort() {
+ return anWrappedShort;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedShort(Short anWrappedShort) {
+ this.anWrappedShort = anWrappedShort;
+ return this;
+ }
+
+ public Integer getAnWrappedInteger() {
+ return anWrappedInteger;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedInteger(Integer anWrappedInteger) {
+ this.anWrappedInteger = anWrappedInteger;
+ return this;
+ }
+
+ public Long getAnWrappedLong() {
+ return anWrappedLong;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedLong(Long anWrappedLong) {
+ this.anWrappedLong = anWrappedLong;
+ return this;
+ }
+
+ public Float getAnWrappedFloat() {
+ return anWrappedFloat;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedFloat(Float anWrappedFloat) {
+ this.anWrappedFloat = anWrappedFloat;
+ return this;
+ }
+
+ public Double getAnWrappedDouble() {
+ return anWrappedDouble;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedDouble(Double anWrappedDouble) {
+ this.anWrappedDouble = anWrappedDouble;
+ return this;
+ }
+
+ public Boolean getAnWrappedBoolean() {
+ return anWrappedBoolean;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedBoolean(Boolean anWrappedBoolean) {
+ this.anWrappedBoolean = anWrappedBoolean;
+ return this;
+ }
+
+ public Character getAnWrappedCharacter() {
+ return anWrappedCharacter;
+ }
+
+ public FluentSetterFlattenObjectResponse setAnWrappedCharacter(Character anWrappedCharacter) {
+ this.anWrappedCharacter = anWrappedCharacter;
+ return this;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public FluentSetterFlattenObjectResponse setString(String string) {
+ this.string = string;
+ return this;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public FluentSetterFlattenObjectResponse setColor(Color color) {
+ this.color = color;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("FlattenObjectResponse{");
+ sb.append("anByte=").append(anByte);
+ sb.append(", anShort=").append(anShort);
+ sb.append(", anInt=").append(anInt);
+ sb.append(", anLong=").append(anLong);
+ sb.append(", anFloat=").append(anFloat);
+ sb.append(", anDouble=").append(anDouble);
+ sb.append(", anBoolean=").append(anBoolean);
+ sb.append(", anChar=").append(anChar);
+ sb.append(", anWrappedByte=").append(anWrappedByte);
+ sb.append(", anWrappedShort=").append(anWrappedShort);
+ sb.append(", anWrappedInteger=").append(anWrappedInteger);
+ sb.append(", anWrappedLong=").append(anWrappedLong);
+ sb.append(", anWrappedFloat=").append(anWrappedFloat);
+ sb.append(", anWrappedDouble=").append(anWrappedDouble);
+ sb.append(", anWrappedBoolean=").append(anWrappedBoolean);
+ sb.append(", anWrappedCharacter=").append(anWrappedCharacter);
+ sb.append(", string='").append(string).append('\'');
+ sb.append(", color=").append(color);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FluentSetterFlattenObjectResponse that = (FluentSetterFlattenObjectResponse) o;
+ return anByte == that.anByte &&
+ anShort == that.anShort &&
+ anInt == that.anInt &&
+ anLong == that.anLong &&
+ Float.compare(that.anFloat, anFloat) == 0 &&
+ Double.compare(that.anDouble, anDouble) == 0 &&
+ anBoolean == that.anBoolean &&
+ anChar == that.anChar &&
+ Objects.equals(anWrappedByte, that.anWrappedByte) &&
+ Objects.equals(anWrappedShort, that.anWrappedShort) &&
+ Objects.equals(anWrappedInteger, that.anWrappedInteger) &&
+ Objects.equals(anWrappedLong, that.anWrappedLong) &&
+ Objects.equals(anWrappedFloat, that.anWrappedFloat) &&
+ Objects.equals(anWrappedDouble, that.anWrappedDouble) &&
+ Objects.equals(anWrappedBoolean, that.anWrappedBoolean) &&
+ Objects.equals(anWrappedCharacter, that.anWrappedCharacter) &&
+ Objects.equals(string, that.string) &&
+ color == that.color;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(anByte, anShort, anInt, anLong, anFloat, anDouble, anBoolean, anChar, anWrappedByte, anWrappedShort,
+ anWrappedInteger,
+ anWrappedLong, anWrappedFloat, anWrappedDouble, anWrappedBoolean, anWrappedCharacter, string, color);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/GenericObjectParam.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/GenericObjectParam.java
new file mode 100644
index 0000000..2d3228f
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/GenericObjectParam.java
@@ -0,0 +1,88 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class GenericObjectParam<T> {
+ private String string;
+ private int i;
+ private T obj;
+
+ public GenericObjectParam() {
+ }
+
+ public GenericObjectParam(String string, int i, T obj) {
+ this.string = string;
+ this.i = i;
+ this.obj = obj;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public int getI() {
+ return i;
+ }
+
+ public void setI(int i) {
+ this.i = i;
+ }
+
+ public T getObj() {
+ return obj;
+ }
+
+ public void setObj(T obj) {
+ this.obj = obj;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GenericObjectParam<?> that = (GenericObjectParam<?>) o;
+ return i == that.i &&
+ Objects.equals(string, that.string) &&
+ Objects.equals(obj, that.obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(string, i, obj);
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("GenericObjectParam{");
+ sb.append("string='").append(string).append('\'');
+ sb.append(", i=").append(i);
+ sb.append(", obj=").append(obj);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/InnerRecursiveObjectParam.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/InnerRecursiveObjectParam.java
new file mode 100644
index 0000000..e8f4390
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/InnerRecursiveObjectParam.java
@@ -0,0 +1,91 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class InnerRecursiveObjectParam {
+ private int i;
+
+ private String string;
+
+ private RecursiveObjectParam recursiveObjectParam;
+
+ public InnerRecursiveObjectParam() {
+ }
+
+ public InnerRecursiveObjectParam(int i, String string,
+ RecursiveObjectParam recursiveObjectParam) {
+ this.i = i;
+ this.string = string;
+ this.recursiveObjectParam = recursiveObjectParam;
+ }
+
+ public int getI() {
+ return i;
+ }
+
+ public void setI(int i) {
+ this.i = i;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public RecursiveObjectParam getRecursiveObjectParam() {
+ return recursiveObjectParam;
+ }
+
+ public void setRecursiveObjectParam(RecursiveObjectParam recursiveObjectParam) {
+ this.recursiveObjectParam = recursiveObjectParam;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("InnerRecursiveObjectParam{");
+ sb.append("i=").append(i);
+ sb.append(", string='").append(string).append('\'');
+ sb.append(", recursiveObjectParam=").append(recursiveObjectParam);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ InnerRecursiveObjectParam that = (InnerRecursiveObjectParam) o;
+ return i == that.i &&
+ Objects.equals(string, that.string) &&
+ Objects.equals(recursiveObjectParam, that.recursiveObjectParam);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(i, string, recursiveObjectParam);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/MultiLayerObjectParam.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/MultiLayerObjectParam.java
new file mode 100644
index 0000000..422af36
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/MultiLayerObjectParam.java
@@ -0,0 +1,92 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Date;
+import java.util.Objects;
+
+public class MultiLayerObjectParam {
+ private String string;
+
+ private Date date;
+
+ private MultiLayerObjectParam2 param2;
+
+ public MultiLayerObjectParam() {
+ }
+
+ public MultiLayerObjectParam(String string, Date date,
+ MultiLayerObjectParam2 param2) {
+ this.string = string;
+ this.date = date;
+ this.param2 = param2;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public MultiLayerObjectParam2 getParam2() {
+ return param2;
+ }
+
+ public void setParam2(MultiLayerObjectParam2 param2) {
+ this.param2 = param2;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("MultiLayerObjectParam{");
+ sb.append("string='").append(string).append('\'');
+ sb.append(", date=").append(date);
+ sb.append(", param2=").append(param2);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MultiLayerObjectParam that = (MultiLayerObjectParam) o;
+ return Objects.equals(string, that.string) &&
+ Objects.equals(date, that.date) &&
+ Objects.equals(param2, that.param2);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(string, date, param2);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/MultiLayerObjectParam2.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/MultiLayerObjectParam2.java
new file mode 100644
index 0000000..8f10152
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/MultiLayerObjectParam2.java
@@ -0,0 +1,91 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class MultiLayerObjectParam2 {
+ private String string;
+
+ private double num;
+
+ private FlattenObjectRequest flattenObject;
+
+ public MultiLayerObjectParam2() {
+ }
+
+ public MultiLayerObjectParam2(String string, double num,
+ FlattenObjectRequest flattenObject) {
+ this.string = string;
+ this.num = num;
+ this.flattenObject = flattenObject;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public double getNum() {
+ return num;
+ }
+
+ public void setNum(double num) {
+ this.num = num;
+ }
+
+ public FlattenObjectRequest getFlattenObject() {
+ return flattenObject;
+ }
+
+ public void setFlattenObject(FlattenObjectRequest flattenObject) {
+ this.flattenObject = flattenObject;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("MultiLayerObjectParam2{");
+ sb.append("string='").append(string).append('\'');
+ sb.append(", num=").append(num);
+ sb.append(", flattenObject=").append(flattenObject);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MultiLayerObjectParam2 that = (MultiLayerObjectParam2) o;
+ return Double.compare(that.num, num) == 0 &&
+ Objects.equals(string, that.string) &&
+ Objects.equals(flattenObject, that.flattenObject);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(string, num, flattenObject);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/ObjectParamTypeSchema.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/ObjectParamTypeSchema.java
new file mode 100644
index 0000000..d7474f2
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/ObjectParamTypeSchema.java
@@ -0,0 +1,37 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ObjectParamTypeSchema {
+ FlattenObjectResponse testFlattenObjectParam(FlattenObjectRequest request);
+
+ FluentSetterFlattenObjectResponse testFluentSetterFlattenObjectParam(FluentSetterFlattenObjectRequest request);
+
+ MultiLayerObjectParam testMultiLayerObjectParam(MultiLayerObjectParam request);
+
+ RecursiveObjectParam testRecursiveObjectParam(RecursiveObjectParam request);
+
+ List<GenericObjectParam<List<RecursiveObjectParam>>> testListObjectParam(
+ List<GenericObjectParam<List<RecursiveObjectParam>>> request);
+
+ Map<String, GenericObjectParam<Map<String, GenericObjectParam<RecursiveObjectParam>>>> testMapObjectParam(
+ Map<String, GenericObjectParam<Map<String, GenericObjectParam<RecursiveObjectParam>>>> request);
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/QueryObjectModel.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/QueryObjectModel.java
new file mode 100644
index 0000000..4bc2076
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/QueryObjectModel.java
@@ -0,0 +1,57 @@
+/*
+ * 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.it.schema.objectparams;
+
+public class QueryObjectModel {
+ private int index;
+
+ private String name;
+
+ public QueryObjectModel() {
+ }
+
+ public QueryObjectModel(int index, String name) {
+ this.index = index;
+ this.name = name;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public QueryObjectModel setIndex(int index) {
+ this.index = index;
+ return this;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public QueryObjectModel setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return "QueryObjectModel{" +
+ "index=" + index +
+ ", name='" + name + '\'' +
+ '}';
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/RecursiveObjectParam.java b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/RecursiveObjectParam.java
new file mode 100644
index 0000000..0cef05b
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/objectparams/RecursiveObjectParam.java
@@ -0,0 +1,120 @@
+/*
+ * 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.it.schema.objectparams;
+
+import java.util.Objects;
+
+public class RecursiveObjectParam {
+ private InnerRecursiveObjectParam innerRecursiveObjectParam;
+
+ private RecursiveObjectParam recursiveObjectParam;
+
+ private long l;
+
+ private String string;
+
+ private Color color = Color.RED; // If using highway, it's best practise to give default value to the first item. Or should take null equals to default value.
+
+ public RecursiveObjectParam() {
+ }
+
+ public RecursiveObjectParam(
+ InnerRecursiveObjectParam innerRecursiveObjectParam,
+ RecursiveObjectParam recursiveObjectParam, long l, String string,
+ Color color) {
+ this.innerRecursiveObjectParam = innerRecursiveObjectParam;
+ this.recursiveObjectParam = recursiveObjectParam;
+ this.l = l;
+ this.string = string;
+ this.color = color;
+ }
+
+ public InnerRecursiveObjectParam getInnerRecursiveObjectParam() {
+ return innerRecursiveObjectParam;
+ }
+
+ public void setInnerRecursiveObjectParam(
+ InnerRecursiveObjectParam innerRecursiveObjectParam) {
+ this.innerRecursiveObjectParam = innerRecursiveObjectParam;
+ }
+
+ public RecursiveObjectParam getRecursiveObjectParam() {
+ return recursiveObjectParam;
+ }
+
+ public void setRecursiveObjectParam(RecursiveObjectParam recursiveObjectParam) {
+ this.recursiveObjectParam = recursiveObjectParam;
+ }
+
+ public long getL() {
+ return l;
+ }
+
+ public void setL(long l) {
+ this.l = l;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RecursiveObjectParam{");
+ sb.append("innerRecursiveObjectParam=").append(innerRecursiveObjectParam);
+ sb.append(", recursiveObjectParam=").append(recursiveObjectParam);
+ sb.append(", l=").append(l);
+ sb.append(", string='").append(string).append('\'');
+ sb.append(", color=").append(color);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ RecursiveObjectParam that = (RecursiveObjectParam) o;
+ return l == that.l &&
+ Objects.equals(innerRecursiveObjectParam, that.innerRecursiveObjectParam) &&
+ Objects.equals(recursiveObjectParam, that.recursiveObjectParam) &&
+ Objects.equals(string, that.string) &&
+ color == that.color;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(innerRecursiveObjectParam, recursiveObjectParam, l, string, color);
+ }
+}
diff --git a/java-chassis-integration-tests/it-common/src/main/resources/microservice.yaml b/java-chassis-integration-tests/it-common/src/main/resources/microservice.yaml
new file mode 100644
index 0000000..07a70a9
--- /dev/null
+++ b/java-chassis-integration-tests/it-common/src/main/resources/microservice.yaml
@@ -0,0 +1,53 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+servicecomb-config-order: -10000
+
+APPLICATION_ID: integration-test
+service_description:
+ name: $invalid-name-must-be-overridden
+ version: 1.0.0
+ environment: development
+servicecomb:
+ service:
+ registry:
+ address: http://127.0.0.1:30100
+ instance:
+ healthCheck:
+ interval: 5
+ times: 3
+ request:
+ # 10 minute
+ timeout: 600000
+ rest:
+ address: 0.0.0.0:0
+ server:
+ verticle-count: 8
+ client:
+ verticle-count: 8
+ connection:
+ maxPoolSize: 30
+ highway:
+ address: 0.0.0.0:0
+ server:
+ verticle-count: 8
+ client:
+ verticle-count: 8
+ uploads:
+ directory: target
+ codec:
+ printErrorMessage: true
diff --git a/java-chassis-integration-tests/it-consumer/pom.xml b/java-chassis-integration-tests/it-consumer/pom.xml
new file mode 100644
index 0000000..51e4762
--- /dev/null
+++ b/java-chassis-integration-tests/it-consumer/pom.xml
@@ -0,0 +1,60 @@
+<?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.
+ -->
+<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">
+ <parent>
+ <artifactId>integration-tests</artifactId>
+ <groupId>org.apache.servicecomb.tests</groupId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>it-consumer</artifactId>
+ <name>Java Chassis::IT::Consumer</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicecomb.tests</groupId>
+ <artifactId>it-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup.okhttp3</groupId>
+ <artifactId>okhttp</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-launcher</artifactId>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <it.main>org.apache.servicecomb.it.ConsumerMain</it.main>
+ </properties>
+</project>
\ No newline at end of file
diff --git a/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java
new file mode 100644
index 0000000..12d8aed
--- /dev/null
+++ b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java
@@ -0,0 +1,232 @@
+/*
+ * 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.it;
+
+import org.apache.servicecomb.common.rest.HttpTransportContext;
+import org.apache.servicecomb.common.rest.VertxHttpTransportContext;
+import org.apache.servicecomb.core.SCBEngine;
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
+import org.apache.servicecomb.it.deploy.Deploys;
+import org.apache.servicecomb.it.deploy.MicroserviceDeploy;
+import org.apache.servicecomb.it.junit.ITJUnitUtils;
+import org.apache.servicecomb.it.schema.TestApiOperation;
+import org.apache.servicecomb.it.schema.generic.TestMyService;
+import org.apache.servicecomb.it.testcase.TestAcceptType;
+import org.apache.servicecomb.it.testcase.TestAnnotatedAttribute;
+import org.apache.servicecomb.it.testcase.TestApiOperationOverride;
+import org.apache.servicecomb.it.testcase.TestApiParam;
+import org.apache.servicecomb.it.testcase.TestAsyncInvoke;
+import org.apache.servicecomb.it.testcase.TestChangeTransport;
+import org.apache.servicecomb.it.testcase.TestDataTypePrimitive;
+import org.apache.servicecomb.it.testcase.TestDefaultJsonValueJaxrsSchema;
+import org.apache.servicecomb.it.testcase.TestDefaultValue;
+import org.apache.servicecomb.it.testcase.TestDownload;
+import org.apache.servicecomb.it.testcase.TestDownloadSlowStreamEdge;
+import org.apache.servicecomb.it.testcase.TestExceptionConvertEdge;
+import org.apache.servicecomb.it.testcase.TestGenericEdge;
+import org.apache.servicecomb.it.testcase.TestIgnoreMethod;
+import org.apache.servicecomb.it.testcase.TestIgnoreStaticMethod;
+import org.apache.servicecomb.it.testcase.TestJsonView;
+import org.apache.servicecomb.it.testcase.TestOptional;
+import org.apache.servicecomb.it.testcase.TestParamCodec;
+import org.apache.servicecomb.it.testcase.TestParamCodecEdge;
+import org.apache.servicecomb.it.testcase.TestRequestBodySpringMvcSchema;
+import org.apache.servicecomb.it.testcase.TestRestController;
+import org.apache.servicecomb.it.testcase.TestRestServerConfigEdge;
+import org.apache.servicecomb.it.testcase.TestRestVertxTransportConfig;
+import org.apache.servicecomb.it.testcase.TestSpringConfiguration;
+import org.apache.servicecomb.it.testcase.TestTrace;
+import org.apache.servicecomb.it.testcase.TestTraceEdge;
+import org.apache.servicecomb.it.testcase.TestTransportContext;
+import org.apache.servicecomb.it.testcase.TestUpload;
+import org.apache.servicecomb.it.testcase.base.TestGeneric;
+import org.apache.servicecomb.it.testcase.objectparams.TestJAXRSObjectParamType;
+import org.apache.servicecomb.it.testcase.objectparams.TestRPCObjectParamType;
+import org.apache.servicecomb.it.testcase.objectparams.TestSpringMVCObjectParamType;
+import org.apache.servicecomb.it.testcase.objectparams.TestSpringMVCObjectParamTypeRestOnly;
+import org.apache.servicecomb.it.testcase.publicHeaders.TestPublicHeadersEdge;
+import org.apache.servicecomb.it.testcase.thirdparty.Test3rdPartyInvocation;
+import org.apache.servicecomb.it.testcase.weak.consumer.TestSpringmvcBasic;
+import org.apache.servicecomb.transport.highway.HighwayTransportContext;
+
+public class ConsumerMain {
+ private static final ResultPrinter resultPrinter = new ResultPrinter();
+
+ private static final Deploys deploys = new Deploys();
+
+ public static boolean autoExit = true;
+
+ public static void main(String[] args) throws Throwable {
+ deploys.init();
+ deploys.getServiceCenter().ensureReady();
+
+ BeanUtils.init();
+ ITUtils.waitBootFinished();
+
+ try {
+ run();
+ } finally {
+ SCBEngine.getInstance().destroy();
+ deploys.getServiceCenter().stop();
+ }
+
+ resultPrinter.print();
+
+ if (autoExit) {
+ System.exit(0);
+ }
+ }
+
+ protected static void run() throws Throwable {
+ ITJUnitUtils.run(TestSpringConfiguration.class);
+
+ // deploy edge/zuul
+ // if not ready, will start a new instance and wait for ready
+ deploys.getEdge().ensureReady();
+ // deploys.getZuul().ensureReady(zuul);
+
+ try {
+ ITJUnitUtils.run(TestIgnoreStaticMethod.class);
+ ITJUnitUtils.run(TestIgnoreMethod.class);
+ ITJUnitUtils.run(TestApiParam.class);
+ ITJUnitUtils.run(TestApiOperation.class);
+
+ testOneProducer(deploys.getBaseProducer(), ConsumerMain::testStandalone);
+ // Running H2, there are many dependencies, like JDk version, open ssl version
+ // We can not guarantee the CI satisfy this. So do not running this test.
+// testOneProducer(deploys.getBaseHttp2Producer(), ConsumerMain::testH2Standalone);
+ testOneProducer(deploys.getBaseHttp2CProducer(), ConsumerMain::testH2CStandalone);
+
+ testOneProducer(deploys.getSpringBoot2StandaloneProducer(), ConsumerMain::testSpringBoot2Standalone);
+ testOneProducer(deploys.getSpringBoot2ServletProducer(), ConsumerMain::testSpringBoot2Servlet);
+ } finally {
+ deploys.getEdge().stop();
+ }
+ }
+
+ private static void runShareTestCases() throws Throwable {
+ ITJUnitUtils.runWithHighwayAndRest(TestPublicHeadersEdge.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestChangeTransport.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestDataTypePrimitive.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestAnnotatedAttribute.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestMyService.class);
+
+ //only rest support Json view
+ ITJUnitUtils.runWithRest(TestJsonView.class);
+
+ // only rest support default value feature
+ ITJUnitUtils.runWithRest(TestDefaultValue.class);
+ ITJUnitUtils.runWithRest(TestAcceptType.class);
+
+ ITJUnitUtils.runWithRest(TestUpload.class);
+ ITJUnitUtils.runWithRest(TestDownload.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestExceptionConvertEdge.class);
+
+ ITJUnitUtils.runWithHighwayAndRest(TestTrace.class);
+ ITJUnitUtils.run(TestTraceEdge.class);
+
+ ITJUnitUtils.runWithHighwayAndRest(TestParamCodec.class);
+ ITJUnitUtils.run(TestParamCodecEdge.class);
+
+ //generic
+ ITJUnitUtils.runWithRest(TestGeneric.class);
+ ITJUnitUtils.run(TestGenericEdge.class);
+
+ ITJUnitUtils.run(TestRequestBodySpringMvcSchema.class);
+ ITJUnitUtils.run(TestDefaultJsonValueJaxrsSchema.class);
+ ITJUnitUtils.run(TestRestController.class);
+ ITJUnitUtils.runWithRest(TestRestController.class);
+
+ ITJUnitUtils.runWithHighwayAndRest(TestAsyncInvoke.class);
+
+ ITJUnitUtils.runWithHighwayAndRest(TestOptional.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestApiOperationOverride.class);
+
+ ITJUnitUtils.runWithHighwayAndRest(TestSpringMVCObjectParamType.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestSpringMVCObjectParamTypeRestOnly.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestJAXRSObjectParamType.class);
+ ITJUnitUtils.runWithHighwayAndRest(TestRPCObjectParamType.class);
+
+ ITJUnitUtils.runWithHighwayAndRest(TestSpringmvcBasic.class);
+ }
+
+ interface ITTask {
+ void run() throws Throwable;
+ }
+
+ private static void testOneProducer(MicroserviceDeploy microserviceDeploy, ITTask task) throws Throwable {
+ microserviceDeploy.ensureReady();
+ ITJUnitUtils.addProducer(microserviceDeploy.getMicroserviceDeployDefinition().getMicroserviceName());
+
+ try {
+ task.run();
+ } finally {
+ ITJUnitUtils.popProducer();
+ microserviceDeploy.stop();
+ }
+ }
+
+ private static void testStandalone() throws Throwable {
+ runShareTestCases();
+
+ // currently not support update 3rd url, so only test once
+ ITJUnitUtils.run(Test3rdPartyInvocation.class);
+
+ // about url len, different deploy have different url len, so only test standalone
+ ITJUnitUtils.runWithRest(TestRestVertxTransportConfig.class);
+ ITJUnitUtils.run(TestRestServerConfigEdge.class);
+
+ // currently, only support vertx download
+ ITJUnitUtils.run(TestDownloadSlowStreamEdge.class);
+
+ TestTransportContext.expectName = VertxHttpTransportContext.class.getName();
+ ITJUnitUtils.runWithRest(TestTransportContext.class);
+
+ TestTransportContext.expectName = HighwayTransportContext.class.getName();
+ ITJUnitUtils.runWithHighway(TestTransportContext.class);
+ }
+
+ private static void testH2CStandalone() throws Throwable {
+ runShareTestCases();
+
+ //as setMaxInitialLineLength() is not work for http2, do not need
+ // ITJUnitUtils.runWithRest(TestRestVertxTransportConfig.class)
+ ITJUnitUtils.run(TestRestServerConfigEdge.class);
+ }
+
+ private static void testH2Standalone() throws Throwable {
+ runShareTestCases();
+
+ //as setMaxInitialLineLength() is not work for http2, do not need
+ // ITJUnitUtils.runWithRest(TestRestVertxTransportConfig.class)
+ ITJUnitUtils.run(TestRestServerConfigEdge.class);
+ }
+
+ private static void testSpringBoot2Standalone() throws Throwable {
+ runShareTestCases();
+
+ // currently, only support vertx download
+ ITJUnitUtils.run(TestDownloadSlowStreamEdge.class);
+ }
+
+ private static void testSpringBoot2Servlet() throws Throwable {
+ runShareTestCases();
+
+ TestTransportContext.expectName = HttpTransportContext.class.getName();
+ ITJUnitUtils.runWithRest(TestTransportContext.class);
+ }
+}
diff --git a/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/Consumers.java b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/Consumers.java
new file mode 100644
index 0000000..d9e6f67
--- /dev/null
+++ b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/Consumers.java
@@ -0,0 +1,88 @@
+/*
+ * 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.it;
+
+import org.apache.servicecomb.it.extend.engine.GateRestTemplate;
+import org.apache.servicecomb.it.extend.engine.ITInvoker;
+import org.apache.servicecomb.it.extend.engine.ITSCBAsyncRestTemplate;
+import org.apache.servicecomb.it.extend.engine.ITSCBRestTemplate;
+import org.apache.servicecomb.it.junit.ITJUnitUtils;
+import org.apache.servicecomb.provider.springmvc.reference.async.CseAsyncRestTemplate;
+import org.springframework.web.client.RestTemplate;
+
+public class Consumers<INTF> {
+ private String producerName;
+
+ private String schemaId;
+
+ private Class<INTF> intfCls;
+
+ private ITSCBRestTemplate scbRestTemplate;
+
+ private RestTemplate edgeRestTemplate;
+
+ private RestTemplate zuulRestTemplate;
+
+ private INTF intf;
+
+ private String transport;
+
+ private CseAsyncRestTemplate cseAsyncRestTemplate;
+
+ public Consumers(String schemaId, Class<INTF> intfCls) {
+ this.schemaId = schemaId;
+ this.intfCls = intfCls;
+ }
+
+ public void init() {
+ this.producerName = ITJUnitUtils.getProducerName();
+ this.transport = ITJUnitUtils.getTransport();
+ intf = ITInvoker.createProxy(producerName, schemaId, transport, intfCls);
+ scbRestTemplate = new ITSCBRestTemplate(schemaId).init();
+ edgeRestTemplate = GateRestTemplate.createEdgeRestTemplate(schemaId).init();
+ zuulRestTemplate = null;
+ this.cseAsyncRestTemplate = new ITSCBAsyncRestTemplate(schemaId).init();
+ }
+
+ public String getSchemaId() {
+ return schemaId;
+ }
+
+ public INTF getIntf() {
+ return intf;
+ }
+
+ public RestTemplate getSCBRestTemplate() {
+ return scbRestTemplate;
+ }
+
+ public RestTemplate getEdgeRestTemplate() {
+ return edgeRestTemplate;
+ }
+
+ public RestTemplate getZuulRestTemplate() {
+ return zuulRestTemplate;
+ }
+
+ public String getTransport() {
+ return transport;
+ }
+
+ public CseAsyncRestTemplate getCseAsyncRestTemplate() {
+ return cseAsyncRestTemplate;
+ }
+}
diff --git a/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ResultPrinter.java b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ResultPrinter.java
new file mode 100644
index 0000000..b71b49e
--- /dev/null
+++ b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ResultPrinter.java
@@ -0,0 +1,65 @@
+/*
+ * 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.it;
+
+import org.apache.servicecomb.it.junit.ITJUnitUtils;
+import org.apache.servicecomb.it.junit.SCBFailure;
+
+public class ResultPrinter {
+ private long start = System.currentTimeMillis();
+
+ public String formatTotalTime() {
+ long totalTime = System.currentTimeMillis() - start;
+ long hour = 0;
+ long minute = 0;
+ long second = 0;
+ second = totalTime / 1000;
+ if (totalTime <= 1000 && totalTime > 0) {
+ second = 1;
+ }
+ if (second > 60) {
+ minute = second / 60;
+ second = second % 60;
+ }
+ if (minute > 60) {
+ hour = minute / 60;
+ minute = minute % 60;
+ }
+ // 转换时分秒 00:00:00
+ String duration =
+ (hour >= 10 ? hour : "0" + hour) + ":" + (minute >= 10 ? minute : "0" + minute) + ":" + (second >= 10 ? second
+ : "0" + second);
+ return duration;
+ }
+
+ public void print() {
+ StringBuilder sb = new StringBuilder();
+ String totalTime = formatTotalTime();
+ for (SCBFailure failure : ITJUnitUtils.getFailures()) {
+ sb.append(String.format("%s, %s\n"
+ + "%s\n",
+ failure.getParents(),
+ failure.getDisplayName(),
+ failure.getStacktrace()));
+ }
+ sb.append(String.format("\nrun count:%d, failed count: %d, totalTime: %s.\n",
+ ITJUnitUtils.getRunCount(),
+ ITJUnitUtils.getFailures().size(),
+ totalTime));
+ System.out.println(sb);
+ }
+}
diff --git a/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/DeployDefinition.java b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/DeployDefinition.java
new file mode 100644
index 0000000..42c6d80
--- /dev/null
+++ b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/DeployDefinition.java
@@ -0,0 +1,120 @@
+/*
+ * 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.it.deploy;
+
+import io.vertx.core.json.Json;
+
+public class DeployDefinition {
+ protected String deployName;
+
+ protected String displayName;
+
+ protected String startCompleteLog;
+
+ protected String workDir;
+
+ /**
+ * <pre>
+ * edge as the example:
+ * support:
+ * 1.absolute path: /home/xxx/it-edge/it-edge-1.0.0.jar
+ * 2.relate to work dir:
+ * if work dir is /home/xxx
+ * cmd is it-edge/it-edge-1.0.0.jar
+ * 3.run in ide, cmd is it-edge/it-edge-1.0.0.jar
+ * will try: integration-tests/target/it-edge/it-edge-1.0.0.jar
+ * 4.run in ide, cmd is it-edge
+ * will try: integration-tests/target/it-edge/it-edge-1.0.0.jar
+ * </pre>
+ */
+ protected String cmd;
+
+ protected String[] args;
+
+ public String getDeployName() {
+ return deployName;
+ }
+
+ public void setDeployName(String deployName) {
+ this.deployName = deployName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getStartCompleteLog() {
+ return startCompleteLog;
+ }
+
+ public void setStartCompleteLog(String startCompleteLog) {
+ this.startCompleteLog = startCompleteLog;
+ }
+
+ public String getWorkDir() {
+ return workDir;
+ }
+
+ public void setWorkDir(String workDir) {
+ this.workDir = workDir;
+ }
+
+ public String getCmd() {
+ return cmd;
+ }
+
+ public void setCmd(String cmd) {
+ this.cmd = cmd;
+ }
+
+ public String[] getArgs() {
+ return args;
+ }
+
+ public void setArgs(String[] args) {
+ this.args = args;
+ }
+
+ public void appendArgs(String arg) {
+ String[] result = new String[args.length + 1];
+ System.arraycopy(args, 0, result, 0, args.length);
+ result[args.length] = arg;
+ this.args = result;
+ }
+
+ public void appendArgs(String[] newArgs) {
+ String[] result = new String[args.length + newArgs.length];
+ System.arraycopy(args, 0, result, 0, args.length);
+ System.arraycopy(newArgs, 0, result, args.length, newArgs.length);
+ this.args = result;
+ }
+
+ public void init() {
+ if (displayName == null) {
+ displayName = deployName;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Json.encodePrettily(this);
+ }
+}
diff --git a/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/Deploys.java b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/Deploys.java
new file mode 100644
index 0000000..2cba466
--- /dev/null
+++ b/java-chassis-integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/Deploys.java
@@ -0,0 +1,333 @@
+/*
+ * 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.it.deploy;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URL;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.SystemUtils;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Deploys {
+
+ public static final String PROPERTY_KEY_MAX_INSTANCE_HEAP_SIZE = "SCB_IT_MAX_HEAP_SIZE";
+
+ public static final String DEFAULT_MAX_INSTANCE_HEAP_SIZE = "128m";
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(Deploys.class);
+
+ private static final String DEFAULT_MICROSERVICE_VERSION = "1.0.0";
+
+ private String pomVersion;
+
+ private ServiceCenterDeploy serviceCenter;
+
+ private MicroserviceDeploy edge;
... 24388 lines suppressed ...