├── images ├── RideBanner.png ├── RideLogo.jpg ├── RideExtLogo.jpg ├── Ride_QuickStart.jpg ├── configs_schemas.png ├── resources_folder.jpg ├── Ride_Authentication.jpeg ├── localhost.properties.png ├── pom_shared_resources.jpg ├── build_and_dependencies.jpg ├── RideArchitectureLandscape.jpg └── RideAutomationArchitecture.jpg ├── sample ├── sample-service-performance-tests │ ├── project │ │ └── plugins.sbt │ ├── build.sbt │ ├── pom.xml │ └── src │ │ └── main │ │ └── scala │ │ └── com │ │ └── adobe │ │ └── ride │ │ └── sample │ │ └── performance │ │ └── SampleServiceBasicRunner.scala ├── sample-service-server │ ├── WebContent │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ ├── database │ │ │ ├── sample.db │ │ │ └── ping.html │ │ └── WEB-INF │ │ │ └── web.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── sample │ │ │ ├── ContextListener.java │ │ │ ├── RESTfulHelloWorld.java │ │ │ └── ObjectMetadata.java │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── sample-product-group-shared-resources │ ├── src │ │ ├── test │ │ │ └── java │ │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ │ └── com │ │ │ │ └── adobe │ │ │ │ └── ride │ │ │ │ └── sample │ │ │ │ └── tests │ │ │ │ └── LoadPropertiesTest.java │ │ └── main │ │ │ ├── resources │ │ │ ├── configs │ │ │ │ ├── common.properties │ │ │ │ ├── prod01.properties │ │ │ │ ├── stage01.properties │ │ │ │ ├── qe01.properties │ │ │ │ └── localhost.properties │ │ │ └── schemas │ │ │ │ ├── SampleService │ │ │ │ ├── definition_jsonapi.json │ │ │ │ ├── uber_object.json │ │ │ │ ├── object1.json │ │ │ │ ├── object2.json │ │ │ │ ├── auditor_object.json │ │ │ │ ├── array_object.json │ │ │ │ ├── array_object_2.json │ │ │ │ └── profile.json │ │ │ │ └── OtherSampleService │ │ │ │ ├── object1.json │ │ │ │ ├── object2.json │ │ │ │ └── uber_object.json │ │ │ └── java │ │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── sample │ │ │ └── types │ │ │ ├── SampleServiceObjectType.java │ │ │ └── Service.java │ └── pom.xml ├── sample-service-tests │ └── src │ │ ├── test │ │ ├── configs │ │ │ ├── dev.properties │ │ │ └── prod.properties │ │ └── java │ │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── sample │ │ │ ├── Basic_FuzzTest_IT.java │ │ │ ├── Complex_Fuzz_Test_IT.java │ │ │ └── BasicTest_IT.java │ │ └── main │ │ └── java │ │ └── com │ │ └── adobe │ │ └── ride │ │ └── sample │ │ └── Base.java ├── sample-service-extension │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── adobe │ │ │ │ └── ride │ │ │ │ └── sample │ │ │ │ ├── cloud_objects │ │ │ │ ├── SampleServiceObject1.java │ │ │ │ ├── SampleServiceObject2.java │ │ │ │ ├── ArrayObject.java │ │ │ │ ├── ProfileObject.java │ │ │ │ └── SampleServiceUberObject.java │ │ │ │ ├── types │ │ │ │ ├── CloudObjectType.java │ │ │ │ └── Service.java │ │ │ │ ├── filters │ │ │ │ └── AuthFilter.java │ │ │ │ └── core │ │ │ │ └── SampleServiceController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── sample │ │ │ └── tests │ │ │ └── ObjectCreation.java │ └── pom.xml └── build │ └── pom.xml ├── .gitignore ├── utilities ├── ride-config-util │ ├── src │ │ ├── test │ │ │ ├── resources │ │ │ │ └── configs │ │ │ │ │ ├── common.properties │ │ │ │ │ ├── config-util-compile.properties │ │ │ │ │ ├── localhost.properties │ │ │ │ │ ├── qe.properties │ │ │ │ │ ├── production.properties │ │ │ │ │ └── stage.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── adobe │ │ │ │ └── ride │ │ │ │ └── config │ │ │ │ └── management │ │ │ │ └── test │ │ │ │ ├── Service.java │ │ │ │ └── ConfigManagementTest.java │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── config │ │ │ ├── management │ │ │ ├── TestPropertyType.java │ │ │ ├── MissingPropertyException.java │ │ │ ├── FileDoesNotExistException.java │ │ │ ├── ServiceConstantsInterface.java │ │ │ ├── ILogUtils.java │ │ │ ├── NullOrEmptyListException.java │ │ │ ├── GlobalConstants.java │ │ │ ├── TestPropertiesWrapper.java │ │ │ ├── StringUtilities.java │ │ │ ├── PropertyFileConfiguration.java │ │ │ └── FileUtils.java │ │ │ └── aop │ │ │ ├── TargetService.java │ │ │ └── TargetServiceConfiguration.java │ └── pom.xml └── ride-model-util │ ├── src │ ├── test │ │ └── resources │ │ │ └── schemas │ │ │ └── TestService │ │ │ ├── simple.json │ │ │ ├── definition_jsonapi.json │ │ │ ├── entitylink.json │ │ │ ├── response_error.json │ │ │ ├── profile.json │ │ │ └── article.json │ └── main │ │ ├── java │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── utilities │ │ │ └── model │ │ │ ├── exceptions │ │ │ ├── ServiceException.java │ │ │ ├── SchemaTypeException.java │ │ │ ├── ModelSearchException.java │ │ │ ├── UnexpectedModelDefinitionException.java │ │ │ ├── UnexpectedModelPropertyFormatType.java │ │ │ ├── UnexpectedModelPropertyTypeException.java │ │ │ ├── UnexpectedSchemaTypeException.java │ │ │ └── InvalidSyncReferenceException.java │ │ │ ├── types │ │ │ └── ModelPropertyType.java │ │ │ └── ArrayCopyUtility.java │ │ └── resources │ │ └── schemas │ │ └── TestService │ │ └── article.json │ └── pom.xml ├── COPYRIGHT ├── libraries ├── ride-performance-lib │ ├── NOTICE │ ├── src │ │ └── main │ │ │ └── scala │ │ │ └── com │ │ │ └── adobe │ │ │ └── ride │ │ │ └── libraries │ │ │ └── performance │ │ │ ├── RideConnector.scala │ │ │ ├── RideServiceClient.scala │ │ │ ├── Predef.scala │ │ │ ├── RideProtocol.scala │ │ │ └── RideActionBuilder.scala │ └── pom.xml └── ride-fuzzer-lib │ ├── src │ └── main │ │ ├── resources │ │ ├── serviceSchemas │ │ │ ├── error.json │ │ │ └── serverVersion.json │ │ └── schemas │ │ │ └── api_key_error.json │ │ └── java │ │ └── com │ │ └── adobe │ │ └── ride │ │ └── libraries │ │ └── fuzzer │ │ ├── PermissionsFuzzer.java │ │ ├── types │ │ ├── RESTParamType.java │ │ └── FuzzType.java │ │ ├── exceptions │ │ └── NullPropertyValueException.java │ │ └── PathFuzzer.java │ ├── README.md │ └── pom.xml ├── ISSUE_TEMPLATE.md ├── core ├── src │ └── main │ │ ├── resources │ │ ├── log4j.properties │ │ └── log4j2.xml │ │ └── java │ │ └── com │ │ └── adobe │ │ └── ride │ │ └── core │ │ ├── types │ │ ├── LogLevel.java │ │ ├── MimeTypes.java │ │ ├── ExpectedResponse.java │ │ └── ExpectedResponseTypes.java │ │ ├── RideCore.java │ │ ├── globals │ │ ├── Headers.java │ │ ├── Constants.java │ │ └── CoreGlobals.java │ │ └── log │ │ └── TestNGCustomReporter.java └── pom.xml ├── PULL_REQUEST_TEMPLATE.md ├── CONTRIBUTING.md └── CODE_OF_CONDUCT.md /images/RideBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/RideBanner.png -------------------------------------------------------------------------------- /images/RideLogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/RideLogo.jpg -------------------------------------------------------------------------------- /images/RideExtLogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/RideExtLogo.jpg -------------------------------------------------------------------------------- /images/Ride_QuickStart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/Ride_QuickStart.jpg -------------------------------------------------------------------------------- /images/configs_schemas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/configs_schemas.png -------------------------------------------------------------------------------- /images/resources_folder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/resources_folder.jpg -------------------------------------------------------------------------------- /images/Ride_Authentication.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/Ride_Authentication.jpeg -------------------------------------------------------------------------------- /images/localhost.properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/localhost.properties.png -------------------------------------------------------------------------------- /images/pom_shared_resources.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/pom_shared_resources.jpg -------------------------------------------------------------------------------- /images/build_and_dependencies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/build_and_dependencies.jpg -------------------------------------------------------------------------------- /sample/sample-service-performance-tests/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("io.gatling" % "gatling-sbt" % "2.2.2") -------------------------------------------------------------------------------- /sample/sample-service-server/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /images/RideArchitectureLandscape.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/RideArchitectureLandscape.jpg -------------------------------------------------------------------------------- /images/RideAutomationArchitecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/images/RideAutomationArchitecture.jpg -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/test/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | **/.classpath 3 | **/.project 4 | **/.settings 5 | **/target 6 | **/test-output 7 | 8 | .idea/ 9 | **/*.iml -------------------------------------------------------------------------------- /sample/sample-service-tests/src/test/configs/dev.properties: -------------------------------------------------------------------------------- 1 | declaredServices= 2 | isProduction=false 3 | vaultEndpoint=https://vault.dev.or1.adobe.net/v1/ 4 | -------------------------------------------------------------------------------- /sample/sample-service-tests/src/test/configs/prod.properties: -------------------------------------------------------------------------------- 1 | declaredServices= 2 | isProduction=true 3 | vaultEndpoint=https://vault.dev.or1.adobe.net/v1/ 4 | -------------------------------------------------------------------------------- /sample/sample-service-server/WebContent/database/sample.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ride/HEAD/sample/sample-service-server/WebContent/database/sample.db -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/resources/configs/common.properties: -------------------------------------------------------------------------------- 1 | # you may want to include some additional shared properties here 2 | commonType="common" 3 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | © Copyright 2015-2018 Adobe. All rights reserved. 2 | 3 | Adobe holds the copyright for all the files found in this repository. 4 | 5 | See the LICENSE file for licensing information. 6 | -------------------------------------------------------------------------------- /libraries/ride-performance-lib/NOTICE: -------------------------------------------------------------------------------- 1 | This software contains code derived from the gatling-custom-protocol-sample 2 | source code at https://github.com/tg44/custom-gatling-proto-sample, 3 | licensed under Apache 2, written by Gergő Törcsvári. -------------------------------------------------------------------------------- /sample/sample-service-server/WebContent/database/ping.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

Hello World!

9 |

RESTful Service is running ... 10 | 11 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/test/resources/schemas/TestService/simple.json: -------------------------------------------------------------------------------- 1 | {"$schema":"http://json-schema.org/draft-04/schema", "title":"Profile", "type":"object", "description":"Profile", "properties":{ "title": {"type":"string","description":"User id who has created the entity."}}} -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/configs/common.properties: -------------------------------------------------------------------------------- 1 | # you may want to include some other shared properties here 2 | #authentication endpoint configuration 3 | authSchema=https 4 | authPort=443 5 | authEndpoint=authentication-endpoint.your-company.com 6 | authPath=/authentication-path/ 7 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Expected Behaviour 2 | 3 | ### Actual Behaviour 4 | 5 | ### Reproduce Scenario (including but not limited to) 6 | 7 | #### Steps to Reproduce 8 | 9 | #### Platform and Version 10 | 11 | #### Sample Code that illustrates the problem 12 | 13 | #### Logs taken while reproducing problem 14 | -------------------------------------------------------------------------------- /sample/sample-service-performance-tests/build.sbt: -------------------------------------------------------------------------------- 1 | name := "sample-service-performance-tests" 2 | 3 | version := "1.0" 4 | 5 | scalaVersion := "2.12.6" 6 | 7 | resolvers += Resolver.mavenLocal 8 | 9 | libraryDependencies ++= Seq( 10 | "com.adobe.ride.libraries" % "ride-performance-lib" % "0.0.1-SNAPSHOT", 11 | "com.adobe.ride.sample" % "sample-service-extension" % "0.0.1-SNAPSHOT" 12 | ) -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/resources/serviceSchemas/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "fuzzer error schema", 4 | "type": "object", 5 | "description": "this is the schema the response for a REST call that returns an error", 6 | "required": ["code", "message"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "code": {"type" : "string"}, 10 | "message": {"type" : "string"} 11 | } 12 | } -------------------------------------------------------------------------------- /utilities/ride-model-util/src/test/resources/schemas/TestService/definition_jsonapi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "JSONAPI specifier definition", 4 | "description": "This is the schema for the jsonapi specifier on requests and responses", 5 | "type": "object", 6 | "required": [ 7 | "version" 8 | ], 9 | "properties": { 10 | "version": { 11 | "type": "string" 12 | } 13 | }, 14 | "additionalProperties": false 15 | } -------------------------------------------------------------------------------- /utilities/ride-model-util/src/test/resources/schemas/TestService/entitylink.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "definitions": {}, 4 | "title" : "Entity Link", 5 | "type": "object", 6 | "description": "this is the J34.2 schema for an article entity link", 7 | "required":["href"], 8 | "additionalProperties": false, 9 | "properties": { 10 | "href": { "type": "string", "format":"uri" }, 11 | "type": { "type": "string" } 12 | } 13 | } -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/resources/schemas/api_key_error.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "API Key Header error schema", 4 | "type": "object", 5 | "description": "This is the schema response for a REST call that uses the API-Key header incorrectly", 6 | "required": ["error_code", "message"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "error_code": {"type" : "string"}, 10 | "message": {"type" : "string"} 11 | } 12 | } -------------------------------------------------------------------------------- /core/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | #use stdout in dev env 2 | log4j.rootLogger=INFO,stdout 3 | 4 | log4j.logger.com.adobe=INFO 5 | log4j.logger.org.springframework=WARN 6 | log4j.logger.com.adobe.ride.search=DEBUG 7 | 8 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 9 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 10 | log4j.appender.stdout.layout.ConversionPattern=%d{MM-dd-yyyy HH:mm:ss} %.8t %-7p %X{requestLogId} %C{1}(%M:%L) - %m%n 11 | log4j.appender.stdout.Threshold=ALL 12 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/definition_jsonapi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "title": "JSONAPI specifier definition", 4 | "description": "This is the schema for the jsonapi specifier on requests and responses", 5 | "type": "object", 6 | "required": [ 7 | "version" 8 | ], 9 | "properties": { 10 | "version": { 11 | "type": "string" 12 | } 13 | }, 14 | "additionalProperties": false 15 | } -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/OtherSampleService/object1.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "cloud sub_object1", 4 | "type": "object", 5 | "description": "sub_object", 6 | "required": ["name", "type"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "type": { "enum" : ["type1", "type2", "type3"]}, 10 | "name": { "type" : "string", "minLength": 3, "maxLength": 30}, 11 | "objectCode": { "type" : "integer", "minimum":1, "maximum":5} 12 | } 13 | } -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/OtherSampleService/object2.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "cloud sub_object2", 4 | "type": "object", 5 | "description": "sub_object", 6 | "required": ["name", "type"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "type": { "enum" : ["type1", "type2", "type3"]}, 10 | "name": { "type" : "string", "minLength": 3, "maxLength": 30}, 11 | "objectCode": { "type" : "integer", "minimum":1, "maximum":5} 12 | } 13 | } -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/OtherSampleService/uber_object.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "uber cloud object", 4 | "type": "object", 5 | "description": "content holder", 6 | "required": ["name", "type"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "type": { "enum" : ["type1", "type2", "type3"]}, 10 | "name": { "type" : "string", "minLength": 3, "maxLength": 30}, 11 | "objectCode": { "type" : "integer", "minimum":1, "maximum":5} 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/uber_object.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "uber cloud object", 4 | "type": "object", 5 | "description": "content holder", 6 | "required": ["name", "type"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "type": { "enum" : ["type1", "type2", "type3"]}, 10 | "name": { "type" : "string", "pattern":"^[a-zA-z0-9]", "minLength": 3, "maxLength": 30}, 11 | "objectCode": { "type" : "integer", "minimum":1, "maximum":5} 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/object1.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "cloud sub_object1", 4 | "type": "object", 5 | "description": "sub_object", 6 | "required": ["name", "type"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "type": { "enum" : ["type1", "type2", "type3"]}, 10 | "name": { "type" : "string", "pattern":"^[a-zA-z0-9]{3,30}"}, 11 | "objectCode": { "type" : "integer", "minimum":1, "maximum":5}, 12 | "thisProperty": { "type" : "string"} 13 | } 14 | } -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/object2.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "cloud sub_object2", 4 | "type": "object", 5 | "description": "sub_object", 6 | "required": ["name", "type"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "type": { "enum" : ["type1", "type2", "type3"]}, 10 | "name": { "type" : "string", "pattern":"^[a-zA-z0-9]", "minLength": 3, "maxLength": 30}, 11 | "objectCode": { "type" : "integer", "minimum":1, "maximum":5}, 12 | "thatProperty": { "type" : "string"} 13 | } 14 | } -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/resources/configs/config-util-compile.properties: -------------------------------------------------------------------------------- 1 | # test service key/value pair landscape properties. 2 | # In this case, this would create a base service path of http://localhost:443/my-common-base-path-if-needed 3 | # Model your service k/v pairs similarly, but name them something else to avoid collision in the framework. 4 | declaredServices=TestService,OtherService 5 | isProduction=false 6 | 7 | TestService.schema=https 8 | TestService.port=443 9 | TestService.endpoint=localhost 10 | TestService.basePath=/my-common-base-path-if-needed 11 | 12 | OtherService.schema=https 13 | OtherService.port=443 14 | OtherService.endpoint=localhost 15 | OtherService.basePath=/my-common-base-path-if-needed -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/resources/serviceSchemas/serverVersion.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "title" : "target fuzzer server version", 4 | "type": "object", 5 | "description": "this is the schema the response in a version check", 6 | "required": ["projectVersion"], 7 | "additionalProperties": true, 8 | "properties": { 9 | "projectName": { "type": "string" }, 10 | "projectVersion": { "type": "string" }, 11 | "buildInfo": { "type": "string" }, 12 | "versionNumber": { "type": "string" }, 13 | "branchName": { "type": "string" }, 14 | "cycleNumber": { "type": "string" }, 15 | "gitCommit": { "type": "string" }, 16 | "buildDate": { "type": "string" } 17 | } 18 | } -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/java/com/adobe/ride/libraries/fuzzer/PermissionsFuzzer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.libraries.fuzzer; 14 | 15 | /** 16 | * 17 | * @author tedcasey 18 | * 19 | */ 20 | 21 | public class PermissionsFuzzer { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/configs/prod01.properties: -------------------------------------------------------------------------------- 1 | # Sample service key/value pair landscape properties. 2 | # The config-util constructs a path of http://sample.ride.adobe.com:8080/sample-service-server/rest 3 | # when these properties are invoked with a command line flag of -Dtarget=prod01. 4 | # Model your service k/v pairs similarly, but name them uniquely to avoid collision in the framework. 5 | declaredServices=SampleService,OtherSampleService 6 | isProduction=true 7 | 8 | #SampleService 9 | SampleService.schema=http 10 | SampleService.port=8080 11 | SampleService.endpoint=sample.ride.adobe.com 12 | SampleService.basePath=/sample-service-server/rest 13 | 14 | #OtherSampleService 15 | OtherSampleService.schema=http 16 | OtherSampleService.port=8080 17 | OtherSampleService.endpoint=other-sample.ride.adobe.com 18 | OtherSampleService.basePath=/my-common-base-path-if-needed 19 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/TestPropertyType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * 17 | * @author hook 18 | * 19 | */ 20 | public enum TestPropertyType { 21 | environment, service, common, master 22 | } 23 | -------------------------------------------------------------------------------- /libraries/ride-performance-lib/src/main/scala/com/adobe/ride/libraries/performance/RideConnector.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.ride.libraries.performance 13 | 14 | /** 15 | * @author tedcasey 16 | */ 17 | class Ride(testclass: RideServiceClient) { 18 | def connect() = new RideActionBuilder(testclass) 19 | } -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/configs/stage01.properties: -------------------------------------------------------------------------------- 1 | # Sample service key/value pair landscape properties. 2 | # The config-util constructs a path of http://stage.sample.ride.adobe.com:8080/sample-service-server/rest 3 | # when these properties are invoked with a command line flag of -Dtarget=stage01. 4 | # Model your service k/v pairs similarly, but name them uniquely to avoid collision in the framework. 5 | declaredServices=SampleService,OtherSampleService 6 | isProduction=false 7 | 8 | #SampleService 9 | SampleService.schema=http 10 | SampleService.port=8080 11 | SampleService.endpoint=stage.sample.ride.adobe.com 12 | SampleService.basePath=/sample-service-server/rest 13 | 14 | #OtherSampleService 15 | OtherSampleService.schema=http 16 | OtherSampleService.port=8080 17 | OtherSampleService.endpoint=stage.sample.ride.adobe.com 18 | OtherSampleService.basePath=/my-common-base-path-if-needed -------------------------------------------------------------------------------- /libraries/ride-performance-lib/src/main/scala/com/adobe/ride/libraries/performance/RideServiceClient.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.ride.libraries.performance 13 | 14 | /** 15 | * @author tedcasey 16 | */ 17 | trait RideServiceClient { 18 | def scenario : String 19 | def connections : Int 20 | def run() 21 | } 22 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/configs/qe01.properties: -------------------------------------------------------------------------------- 1 | # Sample service key/value pair landscape properties. 2 | # This creates a base service path of http://qe-sample-service.adobe.com:8080/sample-service-server/rest for the SampleService service when a command line flag of -Dtarget=qe01 is used in the mvn call. 3 | # when invoking a test which consumes this automation extension 4 | # Model your service k/v pairs similarly, but name them uniquely to avoid collision in the framework. 5 | declaredServices=SampleService,OtherSampleService 6 | isProduction=false 7 | 8 | #SampleService 9 | SampleService.schema=https 10 | SampleService.port=8080 11 | SampleService.endpoint=qe-sample-service.adobe.com 12 | SampleService.basePath=/sample-service-server/rest 13 | 14 | #OtherSampleService 15 | OtherService.schema=https 16 | OtherService.port=8080 17 | OtherService.endpoint=qe-other-sample-service.adobe.com 18 | OtherService.basePath=/my-common-base-path-if-needed -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/java/com/adobe/ride/libraries/fuzzer/types/RESTParamType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.libraries.fuzzer.types; 14 | 15 | /** 16 | * Various types of paramters which can potentially be fuzzed. 17 | * 18 | * @author tedcasey 19 | * 20 | */ 21 | public enum RESTParamType { 22 | FORM, HEADER, PATH, QUERY, MATRIX, BODY 23 | } 24 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/configs/localhost.properties: -------------------------------------------------------------------------------- 1 | # Sample service key/value pair landscape properties. 2 | # This creates a base service path of http://localhost:8080/sample-service-server/rest for the SampleService service when a command line flag of -Dtarget=localhost is used in the mvn call (localhost is used in the default) 3 | # when invoking a test which consumes this automation extension 4 | # Model your service k/v pairs similarly, but name them uniquely to avoid collision in the framework. 5 | declaredServices=SampleService,OtherSampleService 6 | isProduction=false 7 | 8 | # SampleService 9 | SampleService.schema=http 10 | SampleService.port=8080 11 | SampleService.endpoint=localhost 12 | SampleService.basePath=/sample-service-server/rest 13 | 14 | #OtherSampleService 15 | OtherSampleService.schema=http 16 | OtherSampleService.port=8080 17 | OtherSampleService.endpoint=localhost 18 | OtherSampleService.basePath=/other-sample-service-server/rest 19 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/java/com/adobe/ride/config/management/test/Service.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management.test; 14 | 15 | public class Service { 16 | public static final String TEST_SERVICE = "TestService"; 17 | 18 | public static String[] values() { 19 | String[] return_array = {TEST_SERVICE}; 20 | return return_array; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/resources/configs/localhost.properties: -------------------------------------------------------------------------------- 1 | # Test service key/value pair landscape properties. 2 | # In this case, this would create a base service path of http://qe.someservice.com:443/my-common-base-path-if-needed when a command line flag of -Dtarget=TestService is used in the mvn call 3 | # Model your service k/v pairs similarly, but name them something else to avoid collision in the framework. 4 | # Replace sample values below with real values 5 | declaredServices=TestService,OtherService 6 | isProduction=false 7 | 8 | TestService.schema=https 9 | TestService.port=443 10 | TestService.endpoint=localhost 11 | TestService.path=/my-common-base-path-if-needed 12 | TestService.defaultUser=testuser-qe@someservice.com 13 | TestService.defaultPassword=somepassword 14 | 15 | OtherService.schema=https 16 | OtherService.port=443 17 | TestService.endpoint=localhost 18 | TestService.path=/my-common-base-path-if-needed 19 | TestService.defaultUser=other-testuser-qe@someotherservice.com 20 | TestService.defaultPassword=somepassword -------------------------------------------------------------------------------- /libraries/ride-performance-lib/src/main/scala/com/adobe/ride/libraries/performance/Predef.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.ride.libraries.performance 13 | 14 | /** 15 | * @author tedcasey 16 | */ 17 | object Predef { 18 | val ride = RideProtocolBuilder 19 | 20 | implicit def rideBuilderToProtocol(builder: RideProtocolBuilder): RideProtocol = builder.build() 21 | 22 | def ride(testClass: RideServiceClient) = new Ride(testClass) 23 | } 24 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/resources/configs/qe.properties: -------------------------------------------------------------------------------- 1 | # Test service key/value pair landscape properties. 2 | # In this case, this would create a base service path of http://qe.someservice.com:443/my-common-base-path-if-needed when a command line flag of -Dtarget=TestService is used in the mvn call 3 | # Model your service k/v pairs similarly, but name them something else to avoid collision in the framework. 4 | # Replace sample values below with real values 5 | declaredServices=TestService,OtherService 6 | isProduction=false 7 | 8 | TestService.schema=https 9 | TestService.port=443 10 | TestService.endpoint=qe.someservice.com 11 | TestService.path=/my-common-base-path-if-needed 12 | TestService.defaultUser=testuser-qe@someservice.com 13 | TestService.defaultPassword=somepassword 14 | 15 | OtherService.schema=https 16 | OtherService.port=443 17 | TestService.endpoint=qe.someotherservice.com 18 | TestService.path=/my-common-base-path-if-needed 19 | TestService.defaultUser=other-testuser-qe@someotherservice.com 20 | TestService.defaultPassword=somepassword -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/resources/configs/production.properties: -------------------------------------------------------------------------------- 1 | # Test service key/value pair landscape properties. 2 | # In this case, this would create a base service path of http://www.someservice.com:443/my-common-base-path-if-needed when a command line flag of -Dtarget=TestService is used in the mvn call 3 | # Model your service k/v pairs similarly, but name them something else to avoid collision in the framework. 4 | # Replace sample values below with real values 5 | declaredServices=TestService,OtherService 6 | isProduction=true 7 | 8 | TestService.schema=https 9 | TestService.port=443 10 | TestService.endpoint=www.someservice.com 11 | TestService.path=/my-common-base-path-if-needed 12 | TestService.defaultUser=prodUser@someservice.com 13 | TestService.defaultPassword=somepassword 14 | 15 | OtherService.schema=https 16 | OtherService.port=443 17 | TestService.endpoint=www.someotherservice.com 18 | TestService.path=/my-common-base-path-if-needed 19 | TestService.defaultUser=other-user-stage@someotherservice.com 20 | TestService.defaultPassword=somepassword -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/resources/configs/stage.properties: -------------------------------------------------------------------------------- 1 | # Test service key/value pair landscape properties. 2 | # In this case, this would create a base service path of http://stage.someservice.com:443/my-common-base-path-if-needed when a command line flag of -Dtarget=TestService is used in the mvn call 3 | # Model your service k/v pairs similarly, but name them something else to avoid collision in the framework. 4 | # Replace sample values below with real values 5 | declaredServices=TestService,OtherService 6 | isProduction=false 7 | 8 | TestService.schema=https 9 | TestService.port=443 10 | TestService.endpoint=stage.someservice.com 11 | TestService.path=/my-common-base-path-if-needed 12 | TestService.defaultUser=testuser-stage@someservice.com 13 | TestService.defaultPassword=somepassword 14 | 15 | OtherService.schema=https 16 | OtherService.port=443 17 | TestService.endpoint=stage.someotherservice.com 18 | TestService.path=/my-common-base-path-if-needed 19 | TestService.defaultUser=other-testuser-stage@someotherservice.com 20 | TestService.defaultPassword=somepassword -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/java/com/adobe/ride/sample/types/SampleServiceObjectType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.types; 14 | 15 | public enum SampleServiceObjectType { 16 | TYPE1("type1"), TYPE2("type2"), TYPE3("type3"); 17 | 18 | private final String value; 19 | 20 | private SampleServiceObjectType(String type) { 21 | this.value = type; 22 | } 23 | 24 | public String toString() { 25 | return this.value; 26 | } 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/ServiceException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | /** 16 | * @author tedcasey 17 | * 18 | */ 19 | public abstract class ServiceException extends Exception { 20 | private static final long serialVersionUID = 1454365816289571680L; 21 | 22 | /** 23 | * @param string error string 24 | */ 25 | public ServiceException(String string) { 26 | super(string); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/auditor_object.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "title": "ObservePoint Report Audit Status Request Schema", 4 | "description": "This is the schema for the audit status reporting API - POST to /engine/audits/:id", 5 | "type": "object", 6 | "required": [ 7 | "data", "jsonapi" 8 | ], 9 | "properties": { 10 | "data": { 11 | "type": "object", 12 | "required": [ 13 | "attributes" 14 | ], 15 | "properties": { 16 | "attributes": { 17 | "$ref": "#/definitions/requestAttributes" 18 | } 19 | } 20 | }, 21 | "jsonapi": { "$ref": "resource:/schemas/SampleService/definition_jsonapi.json"} 22 | }, 23 | "additionalProperties": false, 24 | "definitions": { 25 | "requestAttributes": { 26 | "type": "object", 27 | "required": [ 28 | "status" 29 | ], 30 | "properties": { 31 | "status": { 32 | "type": "string", 33 | "enum": ["complete"] 34 | } 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/java/com/adobe/ride/sample/types/Service.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.types; 14 | 15 | /** 16 | * @author tedcasey 17 | */ 18 | public class Service { 19 | public static final String SAMPLE_SERVICE = "SampleService"; 20 | public static final String OTHER_SAMPLE_SERVICE = "OtherSampleService"; 21 | 22 | public static String[] values() { 23 | String[] return_array = {SAMPLE_SERVICE, OTHER_SAMPLE_SERVICE}; 24 | return return_array; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/cloud_objects/SampleServiceObject1.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.cloud_objects; 14 | 15 | import com.adobe.ride.sample.types.CloudObjectType; 16 | 17 | /** 18 | * 19 | * @author tedcasey 20 | * 21 | */ 22 | public class SampleServiceObject1 extends SampleServiceUberObject { 23 | 24 | public SampleServiceObject1(String objectName, boolean initRequiredOnly) { 25 | super(CloudObjectType.OBJECT1, objectName, initRequiredOnly); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/aop/TargetService.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.aop; 14 | 15 | import java.lang.annotation.ElementType; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | 20 | /** 21 | * @author jpettit 22 | * 23 | */ 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.TYPE, ElementType.METHOD}) 27 | public @interface TargetService { 28 | String value(); 29 | } 30 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/MissingPropertyException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * 17 | * @author hook 18 | * 19 | */ 20 | public class MissingPropertyException extends RuntimeException { 21 | 22 | private static final long serialVersionUID = 8953476767590874422L; 23 | 24 | public MissingPropertyException() { 25 | super(); 26 | } 27 | 28 | public MissingPropertyException(String message) { 29 | super(message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/java/com/adobe/ride/libraries/fuzzer/types/FuzzType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.libraries.fuzzer.types; 14 | 15 | /** 16 | * Enum for the various fuzzing types. 17 | * 18 | * @author tedcasey 19 | * 20 | */ 21 | public enum FuzzType { 22 | VALID, INVALID, HACK; 23 | 24 | public static FuzzType eval(String string) { 25 | for (FuzzType t : FuzzType.values()) { 26 | if (string.equalsIgnoreCase(t.toString())) { 27 | return t; 28 | } 29 | } 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/FileDoesNotExistException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * The Class FileDoesNotExistException 17 | * 18 | * @author hook 19 | */ 20 | public class FileDoesNotExistException extends RuntimeException { 21 | 22 | private static final long serialVersionUID = 7669804565448997776L; 23 | 24 | public FileDoesNotExistException() { 25 | super(); 26 | } 27 | 28 | public FileDoesNotExistException(String message) { 29 | super(message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/SchemaTypeException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import com.adobe.ride.utilities.model.types.ModelPropertyType; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class SchemaTypeException extends ServiceException { 22 | /** 23 | * 24 | */ 25 | private static final long serialVersionUID = 1777547102260769787L; 26 | 27 | public SchemaTypeException(ModelPropertyType type) { 28 | super("Attempted method on valid on schemas of type" + type.toString()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/ServiceConstantsInterface.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * 17 | * @author jpettit, tedcasey 18 | */ 19 | public interface ServiceConstantsInterface { 20 | 21 | // general property file driven constants 22 | public static final String TARGET_TEST_ENVIRONMENT_KEY = "target"; 23 | 24 | // common property file driven constants 25 | public static final String TEST_COMMON_PROPERTY_FILE_NAME = "common.properties"; 26 | 27 | public static final String DEFAULT_USER = "defaultUser"; 28 | public static final String DEFAULT_PASS = "defaultPass"; 29 | } 30 | -------------------------------------------------------------------------------- /sample/sample-service-server/src/main/java/com/adobe/ride/sample/ContextListener.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import javax.servlet.ServletContextEvent; 16 | import javax.servlet.ServletContextListener; 17 | 18 | /** 19 | * 20 | * @author tedcasey 21 | * 22 | */ 23 | public class ContextListener implements ServletContextListener { 24 | 25 | @Override 26 | public void contextInitialized(ServletContextEvent servletContextEvent) { 27 | System.out.println("Starting up!"); 28 | } 29 | 30 | @Override 31 | public void contextDestroyed(ServletContextEvent servletContextEvent) { 32 | System.out.println("Shutting down!"); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/ILogUtils.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * 17 | * @author hook 18 | * 19 | */ 20 | public interface ILogUtils { 21 | // log with method name 22 | void error(String methodName, String message); 23 | 24 | void error(String message, Exception exp); 25 | 26 | void info(String methodName, String message); 27 | 28 | void warning(String methodName, String message); 29 | 30 | // simple logging 31 | void error(String message); 32 | 33 | void error(Exception exp); 34 | 35 | void info(String message); 36 | 37 | void warning(String message); 38 | } 39 | -------------------------------------------------------------------------------- /sample/sample-service-server/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | sample-service-server 8 | 9 | 10 | index.html 11 | index.htm 12 | index.jsp 13 | default.html 14 | default.htm 15 | default.jsp 16 | 17 | 18 | 19 | sample-service-server 20 | com.sun.jersey.spi.container.servlet.ServletContainer 21 | 22 | com.sun.jersey.config.property.packages 23 | com.adobe.ride.sample 24 | 25 | 1 26 | 27 | 28 | 29 | sample-service-server 30 | /rest/* 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/types/LogLevel.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.types; 14 | 15 | /** 16 | * Enum of log levels in the framework 17 | * 18 | * @author tedcasey 19 | * 20 | */ 21 | public enum LogLevel { 22 | ALL("all"), ON_FAILURE("onFailure"), CUSTOM("custom"), NONE("none"); 23 | 24 | private final String value; 25 | 26 | private LogLevel(String value) { 27 | this.value = value; 28 | } 29 | 30 | public String toString() { 31 | return value; 32 | } 33 | 34 | public static LogLevel parse(String type) { 35 | for (LogLevel t : LogLevel.values()) { 36 | if (t.value.equalsIgnoreCase(type)) { 37 | return t; 38 | } 39 | } 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sample/sample-service-server/src/main/java/com/adobe/ride/sample/RESTfulHelloWorld.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import java.util.Date; 16 | 17 | import javax.ws.rs.GET; 18 | import javax.ws.rs.Path; 19 | // import javax.ws.rs.PathParam; 20 | import javax.ws.rs.Produces; 21 | import javax.ws.rs.core.Response; 22 | 23 | /** 24 | * 25 | * @author tedcasey 26 | * 27 | */ 28 | @Path("/hello") 29 | public class RESTfulHelloWorld { 30 | @GET 31 | @Produces("text/html") 32 | public Response getStartingPage() { 33 | String output = "

Hello World!

" + "

RESTful Service is running ...
Ping @ " 34 | + new Date().toString() + ""; 35 | return Response.status(200).entity(output).build(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/cloud_objects/SampleServiceObject2.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.cloud_objects; 14 | 15 | import com.adobe.ride.sample.types.CloudObjectType; 16 | 17 | /** 18 | * 19 | * @author tedcasey 20 | * 21 | */ 22 | public class SampleServiceObject2 extends SampleServiceUberObject { 23 | 24 | public SampleServiceObject2(String objectName, boolean initRequiredOnly) { 25 | super(CloudObjectType.OBJECT2, objectName, initRequiredOnly); 26 | } 27 | 28 | public String getThatProperty(String value) { 29 | return getProperty("thatProperty").toString(); 30 | } 31 | 32 | public void setThatProperty(String value) { 33 | setProperty("thatProperty", value); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/test/resources/schemas/TestService/response_error.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "Response ERROR Response Schema", 4 | "description": "This is the schema for the ERROR response", 5 | "type": "object", 6 | "required": [ 7 | "errors", 8 | "jsonapi" 9 | ], 10 | "properties": { 11 | "errors": { 12 | "$ref": "#/definitions/errors" 13 | }, 14 | "jsonapi": { 15 | "$ref": "definition_jsonapi.json" 16 | } 17 | }, 18 | "additionalProperties": false, 19 | "definitions": { 20 | 21 | "errors": { 22 | "type": "array", 23 | "items": {"$ref": "#/definitions/errorItem"} 24 | }, 25 | 26 | "errorItem": { 27 | "type": "object", 28 | "required": [ 29 | "status", 30 | "title" 31 | ], 32 | "properties": { 33 | "status": { 34 | "type": "number" 35 | }, 36 | "title": { 37 | "type": "string" 38 | }, 39 | "detail": { 40 | "type": "string" 41 | }, 42 | "source": { 43 | "type": "object", 44 | "properties": { 45 | "pointer": { 46 | "type": "string" 47 | } 48 | }, 49 | "additionalProperties": false 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/NullOrEmptyListException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * The Class NullOrEmptyCollectionException 17 | * 18 | * @author hook, tedcasey(class rename only) 19 | */ 20 | public class NullOrEmptyListException extends RuntimeException { 21 | 22 | private static final long serialVersionUID = 5574215035775258726L; 23 | 24 | /** 25 | * Instantiates a new null or empty list exception. 26 | */ 27 | public NullOrEmptyListException() { 28 | super(); 29 | } 30 | 31 | /** 32 | * Instantiates a new null or empty list exception. 33 | * 34 | * @param message the message 35 | */ 36 | public NullOrEmptyListException(String message) { 37 | super(message); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sample/sample-service-tests/src/test/java/com/adobe/ride/sample/Basic_FuzzTest_IT.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import java.util.UUID; 16 | 17 | import org.testng.annotations.Factory; 18 | 19 | import com.adobe.ride.libraries.fuzzer.MetadataFuzzer; 20 | import com.adobe.ride.sample.cloud_objects.SampleServiceObject1; 21 | import com.adobe.ride.sample.types.Service; 22 | 23 | /** 24 | * 25 | * @author tedcasey 26 | * 27 | */ 28 | public class Basic_FuzzTest_IT { 29 | 30 | @Factory 31 | public Object[] fuzzObjectMetadata_IT() throws Exception { 32 | String itemName = UUID.randomUUID().toString(); 33 | SampleServiceObject1 object1 = new SampleServiceObject1(itemName, false); 34 | return new Object[] {new MetadataFuzzer(Service.SAMPLE_SERVICE.toString(), object1)}; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sample/sample-service-tests/src/test/java/com/adobe/ride/sample/Complex_Fuzz_Test_IT.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import java.util.UUID; 16 | 17 | import org.testng.annotations.Factory; 18 | import com.adobe.ride.libraries.fuzzer.MetadataFuzzer; 19 | // import com.adobe.ride.sample.cloud_objects.SampleServiceObject1; 20 | import com.adobe.ride.sample.cloud_objects.ProfileObject; 21 | import com.adobe.ride.sample.types.Service; 22 | 23 | /** 24 | * 25 | * @author tedcasey 26 | * 27 | */ 28 | public class Complex_Fuzz_Test_IT { 29 | 30 | @Factory 31 | public Object[] fuzzObjectMetadata_IT() throws Exception { 32 | String itemName = UUID.randomUUID().toString(); 33 | ProfileObject object1 = new ProfileObject(itemName, false); 34 | return new Object[] {new MetadataFuzzer(Service.SAMPLE_SERVICE.toString(), object1)}; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.ride.sample 7 | sample-parent 8 | 0.0.1-SNAPSHOT 9 | ../build/pom.xml 10 | 11 | 12 | sample-product-group-shared-resources 13 | sample-product-group-shared-resources 14 | An example of a shared resources project that is used by the sample extension project to show how this model would be used. 15 | 16 | 17 | 18 | junit 19 | junit 20 | 4.13.1 21 | 22 | 23 | commons-configuration 24 | commons-configuration 25 | 1.6 26 | 27 | 28 | commons-io 29 | commons-io 30 | 2.4 31 | 32 | 33 | com.google.code.findbugs 34 | annotations 35 | 3.0.0 36 | 37 | 38 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/types/CloudObjectType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.types; 14 | 15 | /** 16 | * An enumeration of the object types used by the sample ride extension. 17 | * 18 | * @author mstockbr, tedcasey 19 | * 20 | */ 21 | public enum CloudObjectType { 22 | ARRAY_OBJECT("array_object"), UBER_OBJECT("uber_object"), OBJECT1("object1"), OBJECT2( 23 | "object2"), PROFILE_OBJECT("profile"); 24 | 25 | private final String value; 26 | 27 | private CloudObjectType(String value) { 28 | this.value = value; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return value; 34 | } 35 | 36 | public static CloudObjectType parse(String type) { 37 | for (CloudObjectType t : CloudObjectType.values()) { 38 | if (t.value.equalsIgnoreCase(type)) { 39 | return t; 40 | } 41 | } 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/types/ModelPropertyType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.types; 14 | 15 | /** 16 | * Enumeration of types used to create metadata based on json-based schema 17 | * 18 | * @author tedcasey 19 | * 20 | */ 21 | public enum ModelPropertyType { 22 | PATTERN, ANYOF, ARRAY, BOOLEAN, BYTE, DATE, DATETIME, EMAIL, REF_DEFINITION, REF_SCHEMA, REF_DATA, ENUM, INTEGER, IPV4, IPV6, NULL, NUMBER, OBJECT, STRING, SYNC, TIMESTAMP, URI, URI_REF; 23 | 24 | /** 25 | * Return enum based on eval of string value 26 | * 27 | * @param string value 28 | * @return ModelPropertyType 29 | */ 30 | public static ModelPropertyType eval(String string) { 31 | for (ModelPropertyType t : ModelPropertyType.values()) { 32 | if (string.equalsIgnoreCase(t.toString())) { 33 | return t; 34 | } 35 | } 36 | return null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sample/build/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.adobe.ride.sample 5 | sample-parent 6 | 0.0.1-SNAPSHOT 7 | pom 8 | sample-parent 9 | Adobe Ride Samples Parent Pom 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 16 | 17 | 18 | 19 | maven2-repository.java.net 20 | Java.net Repository for Maven 21 | https://download.java.net/maven/2/ 22 | default 23 | 24 | 25 | central 26 | Central Repository 27 | https://repo.maven.apache.org/maven2 28 | default 29 | 30 | false 31 | 32 | 33 | 34 | jitpack.io 35 | https://jitpack.io 36 | 37 | 38 | 39 | 40 | ../sample-product-group-shared-resources 41 | ../sample-service-extension 42 | ../sample-service-server 43 | 44 | 45 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/types/MimeTypes.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.types; 14 | 15 | /** 16 | * An enumeration of common mime types. 17 | * 18 | * @author jpettit 19 | * 20 | */ 21 | public enum MimeTypes { 22 | JPEG("image/jpeg"), 23 | PNG("image/png"), 24 | BMP("image/bmp"), 25 | TIFF("image/tiff"), 26 | MP4("video/mp4"), 27 | MPEG("video/mpeg"), 28 | APP_JSON("application/JSON"), 29 | APP_ZIP("application/ZIP"), 30 | ARTICLE_ZIP("application/vnd.adobe.article+zip"), 31 | FOLIO_ZIP("application/vnd.adobe.folio+zip"), 32 | SYMBOL_LINK("application/vnd.adobe.symboliclink+json"), 33 | TTF("application/x-font-ttf"), 34 | OTF("application/x-font-opentype"), 35 | WOFF("application/x-font-woff"); 36 | 37 | private final String value; 38 | 39 | private MimeTypes(String type) { 40 | this.value = type; 41 | } 42 | 43 | public String toString() { 44 | return this.value; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/cloud_objects/ArrayObject.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.cloud_objects; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | import com.adobe.ride.sample.types.CloudObjectType; 18 | import com.adobe.ride.sample.types.Service; 19 | import com.adobe.ride.utilities.model.ModelObject; 20 | 21 | /** 22 | * 23 | * @author tedcasey 24 | * 25 | */ 26 | public class ArrayObject extends ModelObject { 27 | 28 | public ArrayObject(String objectName, boolean initRequiredOnly) { 29 | super(Service.SAMPLE_SERVICE.toString(), CloudObjectType.ARRAY_OBJECT.toString(), objectName, 30 | initRequiredOnly); 31 | buildValidModelInstance(); 32 | } 33 | 34 | public JSONObject getItemAt(int index) { 35 | return getDataAtItemsIndex(index); 36 | } 37 | 38 | public void setItemAt(int index, JSONObject item) { 39 | setDataAtItemsIndex(index, item); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/array_object.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "definitions": {}, 4 | "id": "http://example.com/example.json", 5 | "type": "array", 6 | "items": { 7 | "id": "/items", 8 | "properties": { 9 | "record": { 10 | "default": "string", 11 | "description": "An explanation about the purpose of this instance.", 12 | "examples": [ 13 | "string" 14 | ], 15 | "id": "/items/properties/record", 16 | "title": "The record schema.", 17 | "type": "string" 18 | }, 19 | "sourceId": { 20 | "default": "string", 21 | "description": "An explanation about the purpose of this instance.", 22 | "examples": [ 23 | "string" 24 | ], 25 | "id": "/items/properties/sourceId", 26 | "title": "The sourceid schema.", 27 | "type": "string" 28 | }, 29 | "timestamp": { "type": "string", "pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$", "format": "date-time", "description":"last modified time in yyyy-MM-dd'T'HH:mm:ssZ format", "mutable":false, "searchable":true }, 30 | "xid": { 31 | "default": "string", 32 | "description": "An explanation about the purpose of this instance.", 33 | "examples": [ 34 | "string" 35 | ], 36 | "id": "/items/properties/xid", 37 | "title": "The xid schema.", 38 | "type": "string" 39 | } 40 | }, 41 | "type": "object" 42 | } 43 | } -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/types/Service.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.types; 14 | 15 | /** 16 | * An enumeration of services targeted by the sample extension. 17 | * 18 | * @author mstockbr, tedcasey 19 | * 20 | */ 21 | public enum Service { 22 | SAMPLE_SERVICE("SampleService"); 23 | // It is possible you'd want to create a group extension with multiple services represented in 24 | // that group. In that case you'd probably have multiple controllers annotated with different 25 | // values here. 26 | 27 | private final String value; 28 | 29 | private Service(String value) { 30 | this.value = value; 31 | } 32 | 33 | public String toString() { 34 | return value; 35 | } 36 | 37 | public static Service parse(String type) { 38 | for (Service t : Service.values()) { 39 | if (t.value.equalsIgnoreCase(type)) { 40 | return t; 41 | } 42 | } 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/GlobalConstants.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | /** 16 | * Non instantiable utility class for storing global service key constants. 17 | * 18 | * @author jpettit, tedcasey 19 | */ 20 | public class GlobalConstants { 21 | 22 | 23 | // general property file driven constants 24 | public static final String TARGET_TEST_ENVIRONMENT_KEY = "target"; 25 | // common property file driven constants 26 | public static final String TEST_COMMON_PROPERTY_FILE_NAME = "common.properties"; 27 | private static boolean inProduction = false; 28 | 29 | /** 30 | * Private constructor - prevent instantiation 31 | */ 32 | private GlobalConstants() {} 33 | 34 | public static boolean inProduction() { 35 | return inProduction; 36 | } 37 | 38 | public static void setInProduction(boolean inProduction) { 39 | GlobalConstants.inProduction = inProduction; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/ModelSearchException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class ModelSearchException extends ServiceException { 22 | private static final long serialVersionUID = -7300846632775868274L; 23 | private JSONObject targetObject; 24 | 25 | /** 26 | * @param obj JSONObject with unexpected format 27 | * @param property not found 28 | */ 29 | public ModelSearchException(JSONObject obj, String property) { 30 | super("Unable to find property " + property + " on object: " + obj.toString()); 31 | this.targetObject = obj; 32 | } 33 | 34 | /** 35 | * Returns the JSONObject associated with the error. 36 | * 37 | * @return object which generated the error. 38 | */ 39 | public JSONObject getTargetObject() { 40 | return targetObject; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/UnexpectedModelDefinitionException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class UnexpectedModelDefinitionException extends ServiceException { 22 | private static final long serialVersionUID = 5092502614792311159L; 23 | private JSONObject targetObject; 24 | 25 | /** 26 | * @param obj JSONObject with unexpected definition 27 | */ 28 | public UnexpectedModelDefinitionException(JSONObject obj) { 29 | super("Encountered unexpected model definition when loading model: " + obj.toString()); 30 | this.targetObject = obj; 31 | } 32 | 33 | /** 34 | * Returns the JSONObject associated with the error. 35 | * 36 | * @return object which generated the error. 37 | */ 38 | public JSONObject getTargetObject() { 39 | return targetObject; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/UnexpectedModelPropertyFormatType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class UnexpectedModelPropertyFormatType extends ServiceException { 22 | private static final long serialVersionUID = -7712442119802652134L; 23 | private JSONObject targetObject; 24 | 25 | /** 26 | * @param obj JSONObject with unexpected format 27 | */ 28 | public UnexpectedModelPropertyFormatType(JSONObject obj) { 29 | super("Encountered unexpected model property format when loading model: " + obj.toString()); 30 | this.targetObject = obj; 31 | } 32 | 33 | /** 34 | * Returns the JSONObject associated with the error. 35 | * 36 | * @return object which generated the error. 37 | */ 38 | public JSONObject getTargetObject() { 39 | return targetObject; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/UnexpectedModelPropertyTypeException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class UnexpectedModelPropertyTypeException extends ServiceException { 22 | private static final long serialVersionUID = -627944750054655950L; 23 | private JSONObject targetObject; 24 | 25 | /** 26 | * @param obj JSONObject with unexpected format 27 | */ 28 | public UnexpectedModelPropertyTypeException(JSONObject obj) { 29 | super("Encountered unexpected model property type when loading model: " + obj.toString()); 30 | this.targetObject = obj; 31 | } 32 | 33 | /** 34 | * Returns the JSONObject associated with the error. 35 | * 36 | * @return object which generated the error. 37 | */ 38 | public JSONObject getTargetObject() { 39 | return targetObject; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/UnexpectedSchemaTypeException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class UnexpectedSchemaTypeException extends ServiceException { 22 | 23 | private static final long serialVersionUID = 3229815211562219065L; 24 | private JSONObject targetObject; 25 | 26 | /** 27 | * @param obj JSONObject with unexpected format 28 | */ 29 | public UnexpectedSchemaTypeException(JSONObject obj) { 30 | super("Encountered unexpected or null schema type when attempting to load model: " 31 | + obj.toString()); 32 | this.targetObject = obj; 33 | } 34 | 35 | /** 36 | * Returns the JSONObject associated with the error. 37 | * 38 | * @return object which generated the error. 39 | */ 40 | public JSONObject getTargetObject() { 41 | return targetObject; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/README.md: -------------------------------------------------------------------------------- 1 | # Fuzzer Test Util Library 2 | 3 | This library is a set of classes that allows users to fuzz various portions of their REST calls for fault testing. When utilized the classes will throw all fuzzed data sets at the target and ensure that a 4xx response is returned. 4 | 5 | There is currently one active fuzzer library: 6 | 7 | - Metadata Fuzzer - Used to fuzz the json payload of a REST API call. 8 | 9 | There are a number of Work in progress fuzzer libraries: 10 | - Path Fuzzer - used to fuzz arbitrary urls. 11 | - Header Fuzzer - used to fuzz arbitrary header 12 | - (Coming Soon) Query Param Fuzzer - used to fuzz arbitrary query parameters. 13 | 14 | ### Basic Usage 15 | 16 | There are 3 main things that need to be added to any test that uses the fuzzer lib 17 | 18 | * TargetService name 19 | * The TestNG Factory annotation to test methods 20 | * The test method needs to return at the minimum an Object array. 21 | 22 | The example code below shows how to use each one in practice. 23 | 24 | 25 | #### Fuzz metadata 26 | 27 | This class constructor takes one argument - an entity instance. 28 | 29 | ``` 30 | 31 | 32 | public class FuzzArticleMetadata_IT { 33 | 34 | private static Base base = Base.INSTANCE; 35 | 36 | @Factory 37 | public MetadataFuzzer[] testObjectMetadata_IT() throws Exception{ 38 | String objId = base.getId(); 39 | MyCustomModelObject myObj = new MyCustomModelObject(false, objId, UUID.randomUUID().toString()); 40 | return new MetadataFuzzer[]{ 41 | new MetadataFuzzer(myObj) 42 | }; 43 | } 44 | 45 | } 46 | 47 | ``` 48 | 49 | -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/java/com/adobe/ride/libraries/fuzzer/exceptions/NullPropertyValueException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.libraries.fuzzer.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | public class NullPropertyValueException extends Exception { 18 | private JSONObject targetObject; 19 | 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = -4954707057674770277L; 24 | 25 | /** 26 | * @param obj JSONObject with unexpected format 27 | * @param property not found 28 | */ 29 | public NullPropertyValueException(JSONObject obj, String property) { 30 | super("The target property '"+property+"' either does not exist in the target instance or has a null value"); 31 | this.targetObject = obj; 32 | } 33 | 34 | /** 35 | * Returns the JSONObject associated with the error. 36 | * 37 | * @return object which generated the error. 38 | */ 39 | public JSONObject getTargetObject() { 40 | return targetObject; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/RideCore.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | import java.util.logging.Logger; 18 | 19 | import org.json.simple.parser.JSONParser; 20 | 21 | import com.adobe.ride.utilities.model.ModelObject; 22 | import io.restassured.builder.RequestSpecBuilder; 23 | import io.restassured.filter.Filter; 24 | 25 | public class RideCore { 26 | public static final Logger logger = Logger.getLogger(ModelObject.class.getName()); 27 | public static final JSONParser parser = new JSONParser(); 28 | 29 | public static RequestSpecBuilder nullCheckAndAddFilters(RequestSpecBuilder reqBuilder, Filter... filters) { 30 | List filterList = new ArrayList(); 31 | if(filters != null) { 32 | for(Filter f : filters) { 33 | if(f != null) { 34 | filterList.add(f); 35 | } 36 | } 37 | } 38 | if(filterList.size() > 0 ) { 39 | reqBuilder.addFilters(filterList); 40 | } 41 | 42 | return reqBuilder; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/exceptions/InvalidSyncReferenceException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model.exceptions; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | /** 18 | * @author tedcasey 19 | * 20 | */ 21 | public class InvalidSyncReferenceException extends ServiceException { 22 | private static final long serialVersionUID = 5092502614792311159L; 23 | private JSONObject targetObject; 24 | 25 | /** 26 | * @param obj JSONObject with unexpected definition 27 | * @param pattern regex pattern in object 28 | */ 29 | public InvalidSyncReferenceException(JSONObject obj, String pattern) { 30 | super("Encountered unexpected sync path when loading - model: " + obj.toString() + ", pattern: " 31 | + pattern); 32 | this.targetObject = obj; 33 | } 34 | 35 | /** 36 | * Returns the JSONObject associated with the error. 37 | * 38 | * @return object which generated the error. 39 | */ 40 | public JSONObject getTargetObject() { 41 | return targetObject; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/array_object_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "title": "/query/{source} - response", 4 | "type": "array", 5 | "description": "rule set information", 6 | "items": { 7 | "properties": { 8 | "clientId": { 9 | "description": "clientId", 10 | "type": "string" 11 | }, 12 | "category": { 13 | "description": "category", 14 | "type": "string" 15 | }, 16 | "version": { 17 | "description": "yyyy-MM-dd_HH:mm:ss format", 18 | "type": "string", 19 | "pattern": "^\\d{4}-\\d{2}-\\d{2}_\\d{2}:\\d{2}:\\d{2}$", 20 | "format": "date-time", 21 | "mutable": false, 22 | "searchable": true 23 | }, 24 | "exportedTs": { 25 | "description": "exportedTs", 26 | "type": "integer" 27 | }, 28 | "exportedSegments": { 29 | "description": "exportedSegments", 30 | "type": "integer" 31 | }, 32 | "translatedSegments": { 33 | "description": "translatedSegments", 34 | "type": "integer" 35 | }, 36 | "packageSize": { 37 | "description": "packageSize", 38 | "type": "integer" 39 | }, 40 | "publishedTs": { 41 | "description": "publishedTs", 42 | "type": "integer" 43 | }, 44 | "packageUrl": { 45 | "description": "packageUrl", 46 | "type": "string" 47 | }, 48 | "id": { 49 | "description": "id", 50 | "type": "string" 51 | } 52 | }, 53 | "required": [ 54 | "clientId", 55 | "category", 56 | "version", 57 | "exportedTs", 58 | "exportedSegments", 59 | "translatedSegments", 60 | "packageSize", 61 | "publishedTs", 62 | "id" 63 | ], 64 | "type": "object" 65 | } 66 | } -------------------------------------------------------------------------------- /sample/sample-service-server/WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sample-service-server 4 | 5 | index.html 6 | index.htm 7 | index.jsp 8 | default.html 9 | default.htm 10 | default.jsp 11 | 12 | 13 | sample-service-server 14 | org.glassfish.jersey.servlet.ServletContainer 15 | 16 | jersey.config.server.provider.packages 17 | com.adobe.ride.sample 18 | 19 | 1 20 | 21 | 22 | 23 | com.adobe.ride.sample.ContextListener 24 | 25 | 26 | 27 | sample-service-server 28 | /rest/* 29 | 30 | 31 | JAX-RS Tools Generated - Do not modify 32 | JAX-RS Servlet 33 | org.glassfish.jersey.servlet.ServletContainer 34 | 1 35 | 36 | 37 | JAX-RS Servlet 38 | /jaxrs/* 39 | 40 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/filters/AuthFilter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.filters; 14 | 15 | import org.apache.commons.lang3.Validate; 16 | 17 | import io.restassured.filter.Filter; 18 | import io.restassured.filter.FilterContext; 19 | import io.restassured.http.Header; 20 | import io.restassured.response.Response; 21 | import io.restassured.specification.FilterableRequestSpecification; 22 | import io.restassured.specification.FilterableResponseSpecification; 23 | 24 | /** 25 | * @author tedcasey 26 | * 27 | */ 28 | public class AuthFilter implements Filter { 29 | 30 | public AuthFilter(String callingServiceName) { 31 | Validate.notNull(callingServiceName); 32 | } 33 | 34 | public AuthFilter() {} 35 | 36 | public Response filter(FilterableRequestSpecification requestSpec, 37 | FilterableResponseSpecification responseSpec, FilterContext ctx) { 38 | 39 | if (!requestSpec.getHeaders().hasHeaderWithName("Authorization")) { 40 | 41 | // Token retrieved from some code invoked here 42 | String token = "somesupersecrettoken"; 43 | requestSpec.header(new Header("Authorization", token)); 44 | } 45 | 46 | final Response response = ctx.next(requestSpec, responseSpec); 47 | 48 | return response; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](http://opensource.adobe.com/cla.html). 40 | - [ ] My code follows the code style of this project. 41 | - [ ] My change requires a change to the documentation. 42 | - [ ] I have updated the documentation accordingly. 43 | - [ ] I have read the **CONTRIBUTING** document. 44 | - [ ] I have added tests to cover my changes. 45 | - [ ] All new and existing tests passed. 46 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/java/com/adobe/ride/utilities/model/ArrayCopyUtility.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.utilities.model; 14 | 15 | /** 16 | * A class containing static utility methods. 17 | * 18 | * @author stlarson 19 | * 20 | */ 21 | 22 | public class ArrayCopyUtility { 23 | 24 | /** 25 | * Copies an array using an interim temporary array so that the original internal representation 26 | * isn't stored in an external mutable object. 27 | * 28 | * @param source The source array to be copied 29 | * @return String[] A string array containing the copied source array 30 | */ 31 | public static String[] copyStringArray(String[] source) { 32 | if (source != null) { 33 | String[] dest = new String[source.length]; 34 | System.arraycopy(source, 0, dest, 0, source.length); 35 | return dest; 36 | } 37 | return null; 38 | } 39 | 40 | /** 41 | * Copies a byte array using an interim temporary array so that the original internal 42 | * representation isn't stored in an external mutable object. 43 | * 44 | * @param source The source array to be copied 45 | * @return byte[] A byte array containing the copied source array 46 | */ 47 | public static byte[] copyArray(byte[] source) { 48 | if (source != null) { 49 | byte[] dest = new byte[source.length]; 50 | System.arraycopy(source, 0, dest, 0, source.length); 51 | return dest; 52 | } 53 | return null; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/TestPropertiesWrapper.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | import java.util.Map; 16 | 17 | /** 18 | * 19 | * @author hook 20 | * 21 | */ 22 | public class TestPropertiesWrapper { 23 | private String propertyFileName; 24 | private Map testProperties = null; 25 | 26 | public TestPropertiesWrapper(Map testProperties) { 27 | Validation.isNullOrEmptyMap(testProperties); 28 | 29 | this.testProperties = testProperties; 30 | } 31 | 32 | public String getPropertyFileName() { 33 | return propertyFileName; 34 | } 35 | 36 | public Map getTestProperties() { 37 | return testProperties; 38 | } 39 | 40 | public void setPropertyFileName(String propertyFileName) { 41 | this.propertyFileName = propertyFileName; 42 | } 43 | 44 | public Object getProperty(String key, Object defaultKey) { 45 | if (!testProperties.containsKey(key)) { 46 | return defaultKey; 47 | } 48 | 49 | Object property = testProperties.get(key); 50 | 51 | if (property == null 52 | || (property.getClass().equals(String.class) && property.toString().isEmpty())) { 53 | return defaultKey; 54 | } 55 | 56 | return testProperties.get(key); 57 | } 58 | 59 | public Object getProperty(String key) { 60 | Object property = null; 61 | 62 | if (!testProperties.containsKey(key)) { 63 | return property; 64 | } 65 | 66 | property = testProperties.get(key); 67 | return property; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/test/java/com/adobe/ride/sample/tests/ObjectCreation.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.tests; 14 | 15 | import java.io.IOException; 16 | 17 | import org.json.simple.parser.ParseException; 18 | import org.junit.Assert; 19 | import org.junit.Test; 20 | 21 | import com.adobe.ride.sample.cloud_objects.SampleServiceObject1; 22 | import com.adobe.ride.sample.cloud_objects.SampleServiceObject2; 23 | import com.adobe.ride.utilities.model.exceptions.UnexpectedModelDefinitionException; 24 | import com.adobe.ride.utilities.model.exceptions.UnexpectedModelPropertyTypeException; 25 | import com.adobe.ride.utilities.model.exceptions.UnexpectedSchemaTypeException; 26 | 27 | /** 28 | * 29 | * @author tedcasey 30 | * 31 | */ 32 | public class ObjectCreation { 33 | 34 | @Test 35 | public void testCreateObject1Type() 36 | throws UnexpectedModelPropertyTypeException, UnexpectedModelDefinitionException, IOException, 37 | ParseException, UnexpectedSchemaTypeException { 38 | SampleServiceObject1 testObj = new SampleServiceObject1("object/object1", false); 39 | 40 | testObj.dumpObject(); 41 | 42 | Assert.assertNotNull(testObj.getObjectMetadata()); 43 | } 44 | 45 | @Test 46 | public void testCreateObject2Type() 47 | throws UnexpectedModelPropertyTypeException, UnexpectedModelDefinitionException, IOException, 48 | ParseException, UnexpectedSchemaTypeException { 49 | SampleServiceObject2 testObj = new SampleServiceObject2("/object/object2", false); 50 | 51 | testObj.dumpObject(); 52 | 53 | Assert.assertNotNull(testObj.getObjectMetadata()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /libraries/ride-performance-lib/src/main/scala/com/adobe/ride/libraries/performance/RideProtocol.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.ride.libraries.performance 13 | 14 | import akka.actor.ActorSystem 15 | import io.gatling.core 16 | import io.gatling.core.CoreComponents 17 | import io.gatling.core.config.GatlingConfiguration 18 | import io.gatling.core.protocol.{Protocol, ProtocolComponents, ProtocolKey} 19 | import io.gatling.core.session.Session 20 | 21 | /** 22 | * @author tedcasey 23 | */ 24 | class RideProtocol() extends Protocol { 25 | type Components = RideComponents 26 | } 27 | 28 | object RideProtocol { 29 | def apply() = new RideProtocol() 30 | 31 | val RideProtocolKey = new ProtocolKey { 32 | 33 | type Protocol = RideProtocol 34 | type Components = RideComponents 35 | 36 | override def protocolClass: Class[core.protocol.Protocol] = classOf[RideProtocol].asInstanceOf[Class[io.gatling.core.protocol.Protocol]] 37 | 38 | override def defaultProtocolValue(configuration: GatlingConfiguration): RideProtocol = throw new IllegalStateException("Can't provide a default value for UpperProtocol") 39 | 40 | override def newComponents(system: ActorSystem, coreComponents: CoreComponents): RideProtocol => RideComponents = { 41 | rideProtocol => RideComponents(rideProtocol) 42 | } 43 | } 44 | } 45 | 46 | case class RideComponents(rideProtocol: RideProtocol) extends ProtocolComponents { 47 | def onStart: Option[Session => Session] = None 48 | 49 | def onExit: Option[Session => Unit] = None 50 | } 51 | 52 | case class RideProtocolBuilder() { 53 | def build() = RideProtocol() 54 | } 55 | 56 | object RideProtocolBuilder { 57 | def protocol() = RideProtocolBuilder() 58 | } 59 | -------------------------------------------------------------------------------- /libraries/ride-performance-lib/src/main/scala/com/adobe/ride/libraries/performance/RideActionBuilder.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.ride.libraries.performance 13 | 14 | import io.gatling.commons.stats.OK 15 | import io.gatling.core.action.builder.ActionBuilder 16 | import io.gatling.core.action.{Action, ExitableAction} 17 | import io.gatling.core.protocol.ProtocolComponentsRegistry 18 | import io.gatling.core.session.Session 19 | import io.gatling.core.stats.StatsEngine 20 | import io.gatling.core.stats.message.ResponseTimings 21 | import io.gatling.core.structure.ScenarioContext 22 | import io.gatling.core.util.NameGen 23 | 24 | /** 25 | * @author: tedcasey 26 | */ 27 | class RideActionBuilder(testclass: RideServiceClient) extends ActionBuilder { 28 | private def components(protocolComponentsRegistry: ProtocolComponentsRegistry) = 29 | protocolComponentsRegistry.components(RideProtocol.RideProtocolKey) 30 | 31 | override def build(ctx: ScenarioContext, next: Action): Action = { 32 | import ctx._ 33 | val statsEngine = coreComponents.statsEngine 34 | val rideComponents = components(protocolComponentsRegistry) 35 | new RideConnect(rideComponents.rideProtocol, statsEngine, next, testclass) 36 | } 37 | } 38 | 39 | /** 40 | * @author tedcasey 41 | */ 42 | class RideConnect(protocol: RideProtocol, val statsEngine: StatsEngine, val next: Action, testClass: RideServiceClient) extends ExitableAction with NameGen { 43 | override def name: String = genName("rideConnect") 44 | 45 | override def execute(session: Session) = { 46 | val start = System.currentTimeMillis 47 | testClass.run 48 | val end = System.currentTimeMillis 49 | val timings = ResponseTimings(start, end) 50 | statsEngine.logResponse(session, name, timings, OK, None, None) 51 | next ! session 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/globals/Headers.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.globals; 14 | 15 | /** 16 | * 17 | * @author tedcasey 18 | * 19 | */ 20 | public class Headers { 21 | 22 | public static final String JSON_CONTENT_TYPE = "application/json;charset=UTF-8"; 23 | public static final String JSON_CONTENT_NO_CHARSET_TYPE = "application/json"; 24 | public static final String XML_CONTENT_TYPE = "application/xml"; 25 | public static final String PROTOBUF_CONTENT_TYPE = "application/json;charset=UTF-8"; 26 | public static final String DEFAULT_CONTENT_TYPE = JSON_CONTENT_TYPE; 27 | public static final String DEFAULT_API_KEY = "adobe-cloud-automation-default-key"; 28 | 29 | public static HeaderItem CONTENT_TYPE = new HeaderItem("Content-Type", DEFAULT_CONTENT_TYPE); 30 | public static HeaderItem ACCEPT = new HeaderItem("Accept", DEFAULT_CONTENT_TYPE); 31 | public static HeaderItem CONTENT_LENGTH = new HeaderItem("Content-Length", ""); 32 | public static HeaderItem CONTENT_MD5 = new HeaderItem("Content-MD5", ""); 33 | public static HeaderItem ORIGIN = new HeaderItem("Origin", ""); 34 | public static HeaderItem AUTHORIZATION = new HeaderItem("Authorization", ""); 35 | 36 | public static HeaderItem CLIENT_API_KEY = new HeaderItem("x-api-key", DEFAULT_API_KEY); 37 | 38 | public static class HeaderItem { 39 | private String headerName; 40 | private String defaultValue; 41 | 42 | public HeaderItem(String headerName, String defaultValue) { 43 | this.headerName = headerName; 44 | this.defaultValue = defaultValue; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return headerName; 50 | } 51 | 52 | public String defaultValue() { 53 | return defaultValue; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sample/sample-service-server/src/main/java/com/adobe/ride/sample/ObjectMetadata.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import com.adobe.ride.sample.types.SampleServiceObjectType; 16 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 17 | 18 | /** 19 | * @author boshea, tedcasey 20 | * 21 | */ 22 | 23 | @JsonIgnoreProperties(ignoreUnknown = true) 24 | public class ObjectMetadata { 25 | 26 | private SampleServiceObjectType type; 27 | public static final String TYPE = "type"; 28 | 29 | private String name; 30 | public static final String NAME = "name"; 31 | 32 | private int objectCode; 33 | public static final String OBJECT_CODE = "objectCode"; 34 | 35 | private String thisProperty; 36 | public static final String THIS_PROPERTY = "thisProperty"; 37 | 38 | private String thatProperty; 39 | public static final String THAT_PROPERTY = "thatProperty"; 40 | 41 | public ObjectMetadata() {} 42 | 43 | public SampleServiceObjectType getType() { 44 | return type; 45 | } 46 | 47 | public void setType(SampleServiceObjectType type) { 48 | this.type = type; 49 | } 50 | 51 | public String getName() { 52 | return name; 53 | } 54 | 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | public int getObjectCode() { 60 | return objectCode; 61 | } 62 | 63 | public void setObjectCode(int objectCode) { 64 | this.objectCode = objectCode; 65 | } 66 | 67 | public String getThisProperty() { 68 | return thisProperty; 69 | } 70 | 71 | public void setThisProperty(String thisProperty) { 72 | this.thisProperty = thisProperty; 73 | } 74 | 75 | public String getThatProperty() { 76 | return thatProperty; 77 | } 78 | 79 | public void setThatProperty(String thatProperty) { 80 | this.thatProperty = thatProperty; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, 10 | you are expected to uphold this code. Please report unacceptable behavior to 11 | [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com). 12 | 13 | ## Have A Question? 14 | 15 | Start by filing an issue. The existing committers on this project work to reach 16 | consensus around project direction and issue solutions within issue threads 17 | (when appropriate). 18 | 19 | ## Contributor License Agreement 20 | 21 | All third-party contributions to this project must be accompanied by a signed contributor 22 | license agreement. This gives Adobe permission to redistribute your contributions 23 | as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html). You 24 | only need to submit an Adobe CLA one time, so if you have submitted one previously, 25 | you are good to go! 26 | 27 | ## Code Reviews 28 | 29 | When contributing to the framework, please follow the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). 30 | Formatting files can be downloaded [here](https://github.com/google/styleguide) for import into Eclipse or IntelliJ. 31 | 32 | All submissions should come in the form of pull requests and need to be reviewed 33 | by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) 34 | for more information on sending pull requests. 35 | 36 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when 37 | submitting a pull request! 38 | 39 | ## From Contributor To Committer 40 | 41 | We love contributions from our community! If you'd like to go a step beyond contributor 42 | and become a committer with full write access and a say in the project, you must 43 | be invited to the project. The existing committers employ an internal nomination 44 | process that must reach lazy consensus (silence is approval) before invitations 45 | are issued. If you feel you are qualified and want to get more deeply involved, 46 | feel free to reach out to existing committers to have a conversation about that. 47 | 48 | ## Security Issues 49 | 50 | Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html) 51 | -------------------------------------------------------------------------------- /utilities/ride-config-util/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.ride 7 | ride-parent 8 | 0.0.1-SNAPSHOT 9 | ../../build/pom.xml 10 | 11 | 12 | ride-config-util 13 | jar 14 | ride-config-util 15 | Utility to help configure environment for test run. 16 | 17 | 18 | 19 | 20 | org.apache.maven.plugins 21 | maven-resources-plugin 22 | 2.7 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-site-plugin 27 | 3.6 28 | 29 | 30 | 31 | org.codehaus.mojo 32 | findbugs-maven-plugin 33 | 3.0.0 34 | 35 | 36 | org.codehaus.mojo 37 | cobertura-maven-plugin 38 | 2.6 39 | 40 | 41 | xml 42 | html 43 | 44 | 45 | 46 | 47 | 48 | org.apache.maven.plugins 49 | maven-javadoc-plugin 50 | 2.10 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-surefire-report-plugin 55 | 2.17 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | src/main/resources 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/cloud_objects/ProfileObject.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.cloud_objects; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | import com.adobe.ride.sample.types.CloudObjectType; 18 | import com.adobe.ride.sample.types.Service; 19 | import com.adobe.ride.utilities.model.ModelObject; 20 | import com.fasterxml.jackson.core.JsonProcessingException; 21 | 22 | /** 23 | * 24 | * @author tedcasey 25 | */ 26 | public class ProfileObject extends ModelObject { 27 | 28 | protected JSONObject remoteMetadata; 29 | 30 | public ProfileObject(String objectName, boolean initRequiredOnly) { 31 | super(Service.SAMPLE_SERVICE.toString(), CloudObjectType.PROFILE_OBJECT.toString(), objectName, 32 | initRequiredOnly); 33 | //buildValidModelInstance(); 34 | } 35 | 36 | public JSONObject getRemoteProperties() { 37 | return remoteMetadata; 38 | } 39 | 40 | public void syncDataToServer() { 41 | setObjectMetadata(remoteMetadata); 42 | } 43 | 44 | public void dumpObject() throws JsonProcessingException { 45 | prettyPrintToConsole(getObjectMetadata()); 46 | } 47 | 48 | public String getPath() { 49 | return getObjectPath(); 50 | } 51 | 52 | public void setPath(String objectPath) { 53 | setObjectPath(objectPath); 54 | } 55 | 56 | public JSONObject getMetadata() { 57 | return getObjectMetadata(); 58 | } 59 | 60 | public void setMetadata(JSONObject data) { 61 | setObjectMetadata(data); 62 | } 63 | 64 | public String getName() { 65 | return super.getObjectName(); 66 | } 67 | 68 | public void setName(String objectName) { 69 | super.setObjectName(objectName); 70 | } 71 | 72 | public void setProperty(String property, Object value) { 73 | setObjectMetadataProperty(property, value); 74 | } 75 | 76 | public Object getProperty(String property) { 77 | return getObjectMetadataProperty(property); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/globals/Constants.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.globals; 14 | 15 | import java.nio.ByteBuffer; 16 | import java.util.Random; 17 | import java.util.UUID; 18 | 19 | /** 20 | * List of common test constants 21 | * 22 | * @author mstockbr, nkrishna 23 | */ 24 | public class Constants { 25 | 26 | public static final String DEFAULT_CLIENT_NAME = "TBD"; 27 | public static final String DEFAULT_CLIENT_VERSION = "0.0.1"; 28 | public static final String DEFAULT_PRODUCT_ID = "your domain"; 29 | public static final String DEFAULT_CONTENT_TYPE = "application/json;charset=UTF-8"; 30 | public static final String JSON_CONTENT_NO_CHARSET_TYPE = "application/json"; 31 | public static final String PROTOBUF_CONTENT_TYPE = "application/octet-stream"; 32 | 33 | // Test Run Profile Names 34 | public static final String SMOKE = "smoke"; 35 | public static final String ACCEPTANCE = "acceptance"; 36 | public static final String CERTIFICATION = "certification"; 37 | public static final String INTEGRATION = "integration"; 38 | public static final String PERFORMANCE = "performance"; 39 | 40 | private static long defaultSessionID = (new Random()).nextLong(); 41 | private static int defaultRequestID = 0; 42 | 43 | public static long defaultSessionID() { 44 | return defaultSessionID; 45 | } 46 | 47 | public static long generateNewSessionID() { 48 | defaultSessionID = (new Random(defaultSessionID)).nextLong(); 49 | return defaultSessionID; 50 | } 51 | 52 | public static int defaultRequestID() { 53 | return defaultRequestID++; 54 | } 55 | 56 | public static UUID fromLong(long id) { 57 | byte[] bytes = ByteBuffer.allocate(Long.SIZE).putLong(id).array(); 58 | return UUID.nameUUIDFromBytes(bytes); 59 | } 60 | 61 | public static UUID fromInt(int id) { 62 | byte[] bytes = ByteBuffer.allocate(Integer.SIZE).putInt(id).array(); 63 | return UUID.nameUUIDFromBytes(bytes); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/test/java/com/adobe/ride/sample/tests/LoadPropertiesTest.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.tests; 14 | 15 | import java.io.IOException; 16 | import java.io.InputStream; 17 | import java.util.Properties; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | 22 | /** 23 | * 24 | * @author tedcasey 25 | * 26 | */ 27 | public class LoadPropertiesTest { 28 | 29 | @Test 30 | public void testLoadProperties() throws IOException { 31 | Properties prop = new Properties(); 32 | InputStream input = null; 33 | 34 | input = getClass().getClassLoader().getResourceAsStream("configs/localhost.properties"); 35 | 36 | // load properties file 37 | prop.load(input); 38 | String[] declaredServices = prop.getProperty("declaredServices").split(","); 39 | 40 | for (int i = 0; i < declaredServices.length; i++) { 41 | testAndDumpConfig(prop, declaredServices[i]); 42 | } 43 | 44 | } 45 | 46 | private void testAndDumpConfig(Properties prop, String service) { 47 | String schema = prop.getProperty(service + ".schema"); 48 | String port = prop.getProperty(service + ".port"); 49 | String endpoint = prop.getProperty(service + ".endpoint"); 50 | String basePath = prop.getProperty(service + ".basePath"); 51 | // String user = prop.getProperty(service+".defaultUser"); 52 | // String password = prop.getProperty(service+".defaultPassword"); 53 | 54 | // get the property value and print it out 55 | Assert.assertEquals(schema, "http"); 56 | Assert.assertEquals(port, "8080"); 57 | Assert.assertNotNull(endpoint); 58 | Assert.assertNotNull(basePath); 59 | // Assert.assertNotNull(user); 60 | // Assert.assertEquals(password, "userPassword"); 61 | 62 | System.out.println(""); 63 | System.out.println(service + " Schema: " + schema); 64 | System.out.println(service + " Port: " + port); 65 | System.out.println(service + " Endpoint: " + endpoint); 66 | System.out.println(service + " Path: " + basePath); 67 | // System.out.println(service+" defaultUser: "+user); 68 | // System.out.println(service+" defaultPassword: "+password); 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/types/ExpectedResponse.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.types; 14 | 15 | import io.restassured.builder.ResponseSpecBuilder; 16 | import io.restassured.specification.ResponseSpecification; 17 | 18 | /** 19 | * 20 | * @author tedcasey 21 | * 22 | */ 23 | public class ExpectedResponse { 24 | 25 | public static final ResponseSpecification OK_RESPONSE = 26 | ExpectedResponseTypes.OK.getResponseSpecification(); 27 | public static final ResponseSpecification DELETED_RESPONSE = 28 | ExpectedResponseTypes.DELETED.getResponseSpecification(); 29 | public static final ResponseSpecification CREATED_RESPONSE = 30 | ExpectedResponseTypes.CREATED.getResponseSpecification(); 31 | public static final ResponseSpecification NOT_FOUND_RESPONSE = 32 | ExpectedResponseTypes.NOT_FOUND.getResponseSpecification(); 33 | public static final ResponseSpecification NOT_AUTH_RESPONSE = 34 | ExpectedResponseTypes.UNAUTHORIZED.getResponseSpecification(); 35 | public static final ResponseSpecification NOT_ALLOWED = 36 | ExpectedResponseTypes.METHOD_NOT_ALLOWED.getResponseSpecification(); 37 | public static final ResponseSpecification NOT_ACCEPTABLE_RESPONSE = 38 | ExpectedResponseTypes.NOT_ACCEPTABLE.getResponseSpecification(); 39 | public static final ResponseSpecification BAD_REQ_RESPONSE = 40 | ExpectedResponseTypes.BAD_REQUEST.getResponseSpecification(); 41 | public static final ResponseSpecification CONFLICT_RESPONSE = 42 | ExpectedResponseTypes.CONFLICT.getResponseSpecification(); 43 | public static final ResponseSpecification FORBIDDEN_RESPONSE = 44 | ExpectedResponseTypes.FORBIDDEN.getResponseSpecification(); 45 | public static final ResponseSpecification ACCEPTED_RESPONSE = 46 | ExpectedResponseTypes.ACCEPTED.getResponseSpecification(); 47 | public static final ResponseSpecification UNSUPPORTED_MEDIA_TYPE_RESPONSE = 48 | ExpectedResponseTypes.UNSUPPORTED_MEDIA_TYPE.getResponseSpecification(); 49 | public static final ResponseSpecification UNPROCESSABLE_ENTITY_RESPONSE = 50 | ExpectedResponseTypes.UNPROCESSABLE_ENTITY.getResponseSpecification(); 51 | public static final ResponseSpecification NO_RESPONSE = new ResponseSpecBuilder().build(); 52 | } 53 | -------------------------------------------------------------------------------- /sample/sample-service-performance-tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.adobe.ride.sample 8 | sample-parent 9 | 0.0.1-SNAPSHOT 10 | ../build/pom.xml 11 | 12 | 13 | sample-service-performance-tests 14 | sample-service-performance-tests 15 | Test which utilize the sample extension and Ride performance-lib to display how to write performance tests. 16 | 17 | 18 | 19 | UTF-8 20 | 2.12.6 21 | 3.3.2 22 | 23 | 24 | 25 | 26 | com.adobe.ride 27 | ride-performance-lib 28 | 0.0.1-SNAPSHOT 29 | 30 | 31 | com.adobe.ride.sample 32 | sample-service-extension 33 | 0.0.1-SNAPSHOT 34 | 35 | 36 | 37 | 38 | src/main/scala 39 | src/test/scala 40 | 41 | 42 | 43 | 44 | net.alchim31.maven 45 | scala-maven-plugin 46 | ${scala-maven-plugin.version} 47 | 48 | plugin 49 | ${scala.version} 50 | 51 | -optimize 52 | -target:jvm-1.8 53 | 54 | 55 | -source 56 | 1.8 57 | -target 58 | 1.8 59 | 60 | 61 | 62 | 63 | 64 | runPerformance 65 | 66 | com.adobe.ride.sample.performance.SampleServiceBasicRunner 67 | 68 | -Xms256m 69 | -Dtarget=${target} 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/globals/CoreGlobals.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.globals; 14 | 15 | import com.adobe.ride.core.types.LogLevel; 16 | 17 | import io.restassured.config.LogConfig; 18 | 19 | /** 20 | * Class to store global static constants available at runtime for all test which leverage the 21 | * framework. 22 | * 23 | * @author tedcasey 24 | * 25 | */ 26 | public class CoreGlobals { 27 | 28 | public static CoreGlobals INSTANCE = new CoreGlobals(); 29 | private final static String COMMAND_LINE_PROPERTY_APIKEY = "apiKey"; 30 | private final static String COMMAND_LINE_PROPERTY_LOG_LEVEL = "logLevel"; 31 | private final static String COMMAND_LINE_PROPERTY_TARGET = "target"; 32 | private String target; 33 | private String APIKey; 34 | private LogLevel logLevel; 35 | private LogConfig customLogConfig; 36 | 37 | protected CoreGlobals() { 38 | this.target = System.getProperty(COMMAND_LINE_PROPERTY_TARGET); 39 | 40 | // set apiKey to default if not specified 41 | if (System.getProperty(COMMAND_LINE_PROPERTY_APIKEY) != null) { 42 | APIKey = System.getProperty(COMMAND_LINE_PROPERTY_APIKEY); 43 | } else { 44 | APIKey = Headers.CLIENT_API_KEY.defaultValue(); 45 | } 46 | 47 | // set Rest-Assured loging to "all" if not specified 48 | if (System.getProperty(COMMAND_LINE_PROPERTY_LOG_LEVEL) != null) { 49 | if (null != LogLevel.valueOf(System.getProperty(COMMAND_LINE_PROPERTY_LOG_LEVEL))) { 50 | setLogLevel(LogLevel.valueOf(System.getProperty(COMMAND_LINE_PROPERTY_LOG_LEVEL))); 51 | } else { 52 | setLogLevel(LogLevel.ALL); 53 | } 54 | } else { 55 | setLogLevel(LogLevel.ALL); 56 | } 57 | } 58 | 59 | public String getAPIKey() { 60 | return APIKey; 61 | } 62 | 63 | public void setAPIKey(String key) { 64 | APIKey = key; 65 | } 66 | 67 | public LogLevel getLogLevel() { 68 | return logLevel; 69 | } 70 | 71 | public void setLogLevel(LogLevel logLevel) { 72 | this.logLevel = logLevel; 73 | } 74 | 75 | public LogConfig getCustomLogConfig() { 76 | return customLogConfig; 77 | } 78 | 79 | public void setCustomLogConfig(LogConfig customLogConfig) { 80 | this.customLogConfig = customLogConfig; 81 | } 82 | 83 | public String getTarget() { 84 | return target; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /utilities/ride-model-util/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.ride 7 | ride-parent 8 | 0.0.1-SNAPSHOT 9 | ../../build/pom.xml 10 | 11 | 12 | ride-model-util 13 | jar 14 | ride-model-util 15 | Utility designed for json schema handling and object production 16 | 17 | 18 | 19 | com.googlecode.json-simple 20 | json-simple 21 | 1.1 22 | 23 | 24 | org.apache.directory.studio 25 | org.apache.commons.lang 26 | 2.6 27 | 28 | 29 | com.github.mifmif 30 | generex 31 | 1.0.2 32 | 33 | 34 | commons-codec 35 | commons-codec 36 | 1.10 37 | 38 | 39 | 40 | 41 | 42 | org.apache.maven.plugins 43 | maven-site-plugin 44 | 3.4 45 | 46 | 47 | 48 | org.codehaus.mojo 49 | findbugs-maven-plugin 50 | 3.0.0 51 | 52 | 53 | org.codehaus.mojo 54 | cobertura-maven-plugin 55 | 2.6 56 | 57 | 58 | xml 59 | html 60 | 61 | 62 | 63 | 64 | 65 | org.apache.maven.plugins 66 | maven-javadoc-plugin 67 | 2.10.1 68 | 69 | 70 | org.apache.maven.plugins 71 | maven-surefire-report-plugin 72 | 2.17 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/StringUtilities.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | import java.nio.ByteBuffer; 16 | import java.nio.charset.CharacterCodingException; 17 | import java.nio.charset.Charset; 18 | import java.nio.charset.CharsetDecoder; 19 | import java.nio.charset.StandardCharsets; 20 | 21 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 22 | 23 | /** 24 | * 25 | * @author hook 26 | * 27 | */ 28 | public class StringUtilities { 29 | 30 | public static final String SECTIONS_MIN_VIEWER_VERSION = "22.0.0"; 31 | public static final String IS_TRUSTED_CONTENT_MIN_VIEWER_VERSION = "25.0.0"; 32 | 33 | public static boolean isEmpty(String value) { 34 | return (value == null || value.trim().isEmpty()); 35 | } 36 | 37 | public static long safeParseLong(final Object value, final long defaultValue) { 38 | 39 | if (value == null) { 40 | return defaultValue; 41 | } 42 | 43 | if (value.getClass().equals(String.class)) { 44 | if (value.toString().isEmpty()) { 45 | return defaultValue; 46 | } 47 | 48 | return Long.parseLong((String) value); 49 | } 50 | 51 | if (value.getClass().equals(Integer.class)) { 52 | return (Integer) value; 53 | } 54 | 55 | if (value.getClass().equals(Long.class)) { 56 | return (Long) value; 57 | } 58 | 59 | return defaultValue; 60 | } 61 | 62 | 63 | public static int safeParseInteger(final String value, final int defaultValue) { 64 | 65 | return (isEmpty(value)) ? defaultValue : Integer.parseInt(value); 66 | } 67 | 68 | public static boolean safeParseBoolean(final String value, final boolean defaultValue) { 69 | return (isEmpty(value)) ? defaultValue : Boolean.parseBoolean(value); 70 | } 71 | 72 | @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", 73 | justification = "This was not authored by QE and may be refactored at a later time.") 74 | public static boolean isStringValidUTF8(String input) { 75 | Validation.isNullOrEmptyParameter("input", input); 76 | 77 | Charset encoding = StandardCharsets.UTF_8; 78 | CharsetDecoder cs = Charset.forName(encoding.name()).newDecoder(); 79 | 80 | try { 81 | cs.decode(ByteBuffer.wrap(input.getBytes())); 82 | return true; 83 | } catch (CharacterCodingException e) { 84 | return false; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /sample/sample-service-performance-tests/src/main/scala/com/adobe/ride/sample/performance/SampleServiceBasicRunner.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | /** 13 | * @author tedcasey 14 | */ 15 | package com.adobe.ride.sample.performance 16 | 17 | import io.gatling.app.Gatling 18 | import io.gatling.core.config.GatlingPropertiesBuilder 19 | import io.gatling.core.Predef._ 20 | 21 | import com.adobe.ride.core.types.ExpectedResponse 22 | 23 | import com.adobe.ride.libraries.performance.Predef._ 24 | import com.adobe.ride.libraries.performance.RideServiceClient 25 | 26 | import java.util.UUID 27 | 28 | import com.adobe.ride.sample.cloud_objects.SampleServiceObject1 29 | import com.adobe.ride.sample.core.SampleServiceController 30 | 31 | object SampleServiceBasicRunner { 32 | 33 | def main(args: Array[String]) { 34 | val simClass = classOf[RideSim].getName 35 | 36 | val props = new GatlingPropertiesBuilder 37 | props.simulationClass(simClass) 38 | Gatling.fromMap(props.build) 39 | } 40 | 41 | class RideSim extends Simulation { 42 | val rideProtocol = ride.protocol() 43 | // (4) Change the name of the Sample Service client constructor here to match the class name you use on line 39 below 44 | val testClass = new SampleServiceClient() 45 | val scn = scenario(testClass.scenario).exec(ride(testClass).connect) 46 | setUp( 47 | scn.inject(atOnceUsers(testClass.connections))).protocols(rideProtocol) 48 | } 49 | } 50 | 51 | // (1) Change the name of the SampleClient class to whatever you are testing. ForExample - ServiceThatImTestingClient extends RideServiceClient 52 | class SampleServiceClient extends RideServiceClient { 53 | // (2) Set the name of the report and number of simulated users 54 | val scenario: String = "ZenActionsSimulation" //Name to use in Gatling reports 55 | val connections: Int = 5 //Number of concurrent users to run this performance test 56 | 57 | def run = { 58 | 59 | // (3) This is where your Ride test code should reside. Replace all of the sample code below with your Ride code. 60 | // Note that this is Scala code, so you'll need to modify your normal Ride test code to look like the scala syntax illustrated below 61 | val itemName: String = UUID.randomUUID().toString() 62 | val testObject: SampleServiceObject1 = new SampleServiceObject1(itemName, false) 63 | 64 | SampleServiceController.createOrUpdateObject(testObject.getObjectPath(), testObject, ExpectedResponse.CREATED_RESPONSE, true) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/cloud_objects/SampleServiceUberObject.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.cloud_objects; 14 | 15 | import org.json.simple.JSONObject; 16 | 17 | import com.adobe.ride.sample.types.CloudObjectType; 18 | import com.adobe.ride.sample.types.Service; 19 | import com.adobe.ride.utilities.model.ModelObject; 20 | import com.fasterxml.jackson.core.JsonProcessingException; 21 | 22 | /** 23 | * Notes: This is SampleUberObject, which you may want to have for your extension, if you have a lot 24 | * of repetitive methods in your objects. Because of encapsultation, in order to get to the 25 | * ModelObject methods you may need in your subclasses, you may want to override some of the methods 26 | * in the superclass (modelobject), but you don't have to do it this way. It may make more sense to 27 | * have all of your objects draw directly from the ModelObject. 28 | * 29 | * @author tedcasey 30 | * 31 | */ 32 | public class SampleServiceUberObject extends ModelObject { 33 | 34 | protected JSONObject remoteMetadata; 35 | 36 | public SampleServiceUberObject(CloudObjectType type, String objectName, 37 | boolean initRequiredOnly) { 38 | super(Service.SAMPLE_SERVICE.toString(), type.toString(), objectName, initRequiredOnly); 39 | buildValidModelInstance(); 40 | } 41 | 42 | public JSONObject getRemoteProperties() { 43 | return remoteMetadata; 44 | } 45 | 46 | public void syncDataToServer() { 47 | setObjectMetadata(remoteMetadata); 48 | } 49 | 50 | public void dumpObject() throws JsonProcessingException { 51 | prettyPrintToConsole(getObjectMetadata()); 52 | } 53 | 54 | public String getPath() { 55 | return getObjectPath(); 56 | } 57 | 58 | public void setPath(String objectPath) { 59 | setObjectPath(objectPath); 60 | } 61 | 62 | public JSONObject getMetadata() { 63 | return getObjectMetadata(); 64 | } 65 | 66 | public void setMetadata(JSONObject data) { 67 | setObjectMetadata(data); 68 | } 69 | 70 | public String getName() { 71 | return super.getObjectName(); 72 | } 73 | 74 | public void setName(String objectName) { 75 | super.setObjectName(objectName); 76 | } 77 | 78 | public void setProperty(String property, Object value) { 79 | setObjectMetadataProperty(property, value); 80 | } 81 | 82 | public Object getProperty(String property) { 83 | return getObjectMetadataProperty(property); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /sample/sample-service-tests/src/main/java/com/adobe/ride/sample/Base.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import com.adobe.ride.core.globals.CoreGlobals; 16 | import com.adobe.ride.core.types.ExpectedResponseTypes; 17 | 18 | import io.restassured.builder.ResponseSpecBuilder; 19 | import io.restassured.specification.ResponseSpecification; 20 | 21 | /** 22 | * 23 | * @author tedcasey 24 | * 25 | */ 26 | public class Base { 27 | // Base singleton 28 | public static final Base INSTANCE = new Base(); 29 | 30 | public final ResponseSpecification OK_RESPONSE = 31 | ExpectedResponseTypes.OK.getResponseSpecification(); 32 | public final ResponseSpecification DELETED_RESPONSE = 33 | ExpectedResponseTypes.DELETED.getResponseSpecification(); 34 | public final ResponseSpecification CREATED_RESPONSE = 35 | ExpectedResponseTypes.CREATED.getResponseSpecification(); 36 | public final ResponseSpecification NOT_FOUND_RESPONSE = 37 | ExpectedResponseTypes.NOT_FOUND.getResponseSpecification(); 38 | public final ResponseSpecification NOT_AUTH_RESPONSE = 39 | ExpectedResponseTypes.UNAUTHORIZED.getResponseSpecification(); 40 | public final ResponseSpecification BAD_REQ_RESPONSE = 41 | ExpectedResponseTypes.BAD_REQUEST.getResponseSpecification(); 42 | public final ResponseSpecification CONFLICT_RESPONSE = 43 | ExpectedResponseTypes.CONFLICT.getResponseSpecification(); 44 | public final ResponseSpecification FORBIDDEN_RESPONSE = 45 | ExpectedResponseTypes.FORBIDDEN.getResponseSpecification(); 46 | public final ResponseSpecification ACCEPTED_RESPONSE = 47 | ExpectedResponseTypes.ACCEPTED.getResponseSpecification(); 48 | public ResponseSpecification NO_RESPONSE = new ResponseSpecBuilder().build(); 49 | 50 | public String environment; 51 | public final String QE01_TARGET = "qe01"; 52 | public final String STAGE01_TARGET = "stage01"; 53 | public final String PROD01_TARGET = "prod01"; 54 | 55 | public Base() { 56 | CoreGlobals.INSTANCE.setAPIKey("Sample"); 57 | environment = CoreGlobals.INSTANCE.getTarget(); 58 | /*- 59 | System.out.println("ENVIRONMENT: " + environment); 60 | // setup static reusable object 61 | if (environment.equals(PROD01_TARGET)) { 62 | // Do Something special 63 | } else if (environment.equals(STAGE01_TARGET)) { 64 | // Do Something different 65 | } else { 66 | // And now for something completely different 67 | } 68 | */ 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/log/TestNGCustomReporter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.log; 14 | 15 | import java.util.List; 16 | import java.util.Map; 17 | import java.util.Set; 18 | 19 | import org.testng.IReporter; 20 | import org.testng.IResultMap; 21 | import org.testng.ISuite; 22 | import org.testng.ISuiteResult; 23 | import org.testng.ITestContext; 24 | import org.testng.ITestResult; 25 | import org.testng.Reporter; 26 | import org.testng.xml.XmlSuite; 27 | 28 | /* 29 | * authors: stlarson, tedcasey 30 | */ 31 | 32 | public class TestNGCustomReporter implements IReporter { 33 | 34 | public void generateReport(List xmlSuites, List suites, 35 | String outputDirectory) { 36 | print("Suites run: " + suites.size()); 37 | for (ISuite suite : suites) { 38 | print("Suite: " + suite.getName()); 39 | Map suiteResults = suite.getResults(); 40 | for (String testName : suiteResults.keySet()) { 41 | print("Test:" + testName); 42 | ISuiteResult suiteResult = suiteResults.get(testName); 43 | ITestContext testContext = suiteResult.getTestContext(); 44 | print("Failed:" + testContext.getFailedTests().size()); 45 | IResultMap failedResult = testContext.getFailedTests(); 46 | Set testsFailed = failedResult.getAllResults(); 47 | for (ITestResult testResult : testsFailed) { 48 | print("--------------------------------------"); 49 | print("Failed Test: " + testResult.getName()); 50 | print("Reason: " + testResult.getThrowable().getMessage()); 51 | String sanitized = 52 | Reporter.getOutput(testResult).toString().replace("[", "").replace("]", ""); 53 | print(sanitized); 54 | } 55 | IResultMap passResult = testContext.getPassedTests(); 56 | Set testsPassed = passResult.getAllResults(); 57 | print(" Passed>" + testsPassed.size()); 58 | for (ITestResult testResult : testsPassed) { 59 | print(" " + testResult.getName() + ">took " 60 | + (testResult.getEndMillis() - testResult.getStartMillis()) + "ms"); 61 | } 62 | IResultMap skippedResult = testContext.getSkippedTests(); 63 | Set testsSkipped = skippedResult.getAllResults(); 64 | print(" Skipped>" + testsSkipped.size()); 65 | for (ITestResult testResult : testsSkipped) { 66 | print(" " + testResult.getName()); 67 | } 68 | 69 | } 70 | } 71 | } 72 | 73 | private void print(String text) { 74 | System.out.println(text); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/test/java/com/adobe/ride/config/management/test/ConfigManagementTest.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management.test; 14 | 15 | import static com.adobe.ride.config.management.ServiceConstantsInterface.TARGET_TEST_ENVIRONMENT_KEY; 16 | import static org.testng.Assert.assertEquals; 17 | 18 | import java.io.IOException; 19 | import java.io.InputStream; 20 | import java.lang.annotation.Annotation; 21 | import java.lang.reflect.Method; 22 | import java.util.Properties; 23 | 24 | import org.testng.annotations.Test; 25 | 26 | import com.adobe.ride.config.aop.TargetService; 27 | import com.adobe.ride.config.aop.TargetServiceConfiguration; 28 | import com.adobe.ride.config.management.TestProperties; 29 | 30 | /** 31 | * @author jpettit, tedcasey 32 | * 33 | */ 34 | public class ConfigManagementTest { 35 | 36 | private Properties prop; 37 | 38 | public void loadResFile() throws IOException { 39 | prop = new Properties(); 40 | InputStream input = null; 41 | 42 | String environment = System.getProperty(TARGET_TEST_ENVIRONMENT_KEY, "localhost"); 43 | input = 44 | getClass().getClassLoader().getResourceAsStream("configs/" + environment + ".properties"); 45 | prop.load(input); 46 | } 47 | 48 | @Test(suiteName = "smoke", groups = "integration", enabled = true) 49 | public void testAnnotationUsage() throws IOException { 50 | loadResFile(); 51 | Method m; 52 | try { 53 | m = this.getClass().getMethod("testAnnotationUsage"); 54 | 55 | for (Annotation a : m.getAnnotations()) { 56 | if (a instanceof TargetService) { 57 | TargetService t = (TargetService) a; 58 | String service_name = t.value(); 59 | TestProperties tp = TestProperties.getInstance(); 60 | TargetServiceConfiguration targetService = tp.getTargetServiceConfig(service_name); 61 | assertEquals(targetService.schema(), prop 62 | .getProperty(t.value().concat(".").concat(TargetServiceConfiguration.SCHEMA_KEY))); 63 | assertEquals(targetService.endpoint(), prop 64 | .getProperty(t.value().concat(".").concat(TargetServiceConfiguration.ENDPOINT_KEY))); 65 | assertEquals(targetService.port(), Integer.parseInt( 66 | prop.getProperty(t.value().concat(".").concat(TargetServiceConfiguration.PORT_KEY)))); 67 | assertEquals(targetService.basePath(), prop 68 | .getProperty(t.value().concat(".").concat(TargetServiceConfiguration.BASE_PATH_KEY))); 69 | } 70 | } 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (SecurityException e) { 74 | e.printStackTrace(); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /sample/sample-service-extension/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.ride.sample 7 | sample-parent 8 | 0.0.1-SNAPSHOT 9 | ../build/pom.xml 10 | 11 | 12 | sample-service-extension 13 | jar 14 | sample-service-extension 15 | Sample Extension of the Adobe Ride Automation Framework 16 | 17 | 18 | 0.0.1-SNAPSHOT 19 | 20 | 21 | 22 | 23 | com.adobe.ride 24 | ride-core 25 | 0.0.1-SNAPSHOT 26 | 27 | 28 | com.adobe.ride.sample 29 | sample-product-group-shared-resources 30 | 0.0.1-SNAPSHOT 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-site-plugin 39 | 3.7.1 40 | 41 | 42 | 43 | org.codehaus.mojo 44 | findbugs-maven-plugin 45 | 3.0.0 46 | 47 | 48 | org.codehaus.mojo 49 | cobertura-maven-plugin 50 | 2.6 51 | 52 | 53 | xml 54 | html 55 | 56 | 57 | 58 | 59 | 60 | org.apache.maven.plugins 61 | maven-javadoc-plugin 62 | 2.10 63 | 64 | 65 | org.apache.maven.plugins 66 | maven-surefire-report-plugin 67 | 2.17 68 | 69 | 70 | 71 | 72 | 73 | org.apache.maven.plugins 74 | maven-remote-resources-plugin 75 | 1.5 76 | 77 | 78 | com.adobe.ride.sample:sample-product-group-shared-resources:${data.model.version} 79 | 80 | 81 | 82 | 83 | 84 | process 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/PropertyFileConfiguration.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | import java.io.InputStream; 16 | import java.util.HashMap; 17 | import java.util.Iterator; 18 | import java.util.Map; 19 | import org.apache.commons.configuration.ConfigurationException; 20 | import org.apache.commons.configuration.PropertiesConfiguration; 21 | 22 | /** 23 | * 24 | * @author hook 25 | * 26 | */ 27 | public class PropertyFileConfiguration { 28 | 29 | private PropertiesConfiguration propertiesConfiguration = null; 30 | private String configurationPath = null; 31 | 32 | public PropertyFileConfiguration(String configurationPath) throws ConfigurationException { 33 | Validation.isNullOrEmptyParameter("configurationPath", configurationPath); 34 | 35 | this.configurationPath = configurationPath; 36 | 37 | InputStream in = getClass().getResourceAsStream(configurationPath); 38 | 39 | propertiesConfiguration = new PropertiesConfiguration(); 40 | try { 41 | propertiesConfiguration.load(in); 42 | } catch (Exception e) { 43 | System.err.println("unable to load file: " + configurationPath); 44 | e.printStackTrace(); 45 | } 46 | } 47 | 48 | public void reload() throws ConfigurationException { 49 | propertiesConfiguration.clear(); 50 | propertiesConfiguration.reload(); 51 | } 52 | 53 | public String getConfigurationPath() { 54 | return configurationPath; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | StringBuilder propertyValues = new StringBuilder(); 60 | for (Iterator it = propertiesConfiguration.getKeys(); it.hasNext();) { 61 | String key = (String) it.next(); 62 | Object value = propertiesConfiguration.getProperty(key); 63 | propertyValues.append("key=" + key + " value=" + value.toString()); 64 | } 65 | 66 | return propertyValues.toString(); 67 | } 68 | 69 | @SuppressWarnings("unchecked") 70 | public Map getAllProperties() throws ConfigurationException { 71 | 72 | Map map = new HashMap(); 73 | 74 | for (Iterator it = propertiesConfiguration.getKeys(); it.hasNext();) { 75 | String key = (String) it.next(); 76 | if (!map.containsKey(key)) { 77 | map.put(key, (T) propertiesConfiguration.getProperty(key)); 78 | } 79 | } 80 | 81 | return map; 82 | } 83 | 84 | @SuppressWarnings("unchecked") 85 | public T getProperty(String key) { 86 | Validation.isNullOrEmptyParameter("key", key); 87 | 88 | if (propertiesConfiguration != null) { 89 | T value = (T) propertiesConfiguration.getProperty(key); 90 | return value; 91 | } 92 | 93 | throw new MissingPropertyException("Cannot locate property with key=" + key); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /core/src/main/java/com/adobe/ride/core/types/ExpectedResponseTypes.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.core.types; 14 | 15 | import static org.apache.http.HttpStatus.SC_ACCEPTED; 16 | import static org.apache.http.HttpStatus.SC_BAD_REQUEST; 17 | import static org.apache.http.HttpStatus.SC_CONFLICT; 18 | import static org.apache.http.HttpStatus.SC_CREATED; 19 | import static org.apache.http.HttpStatus.SC_FORBIDDEN; 20 | import static org.apache.http.HttpStatus.SC_GATEWAY_TIMEOUT; 21 | import static org.apache.http.HttpStatus.SC_LOCKED; 22 | import static org.apache.http.HttpStatus.SC_METHOD_NOT_ALLOWED; 23 | import static org.apache.http.HttpStatus.SC_NOT_ACCEPTABLE; 24 | import static org.apache.http.HttpStatus.SC_NOT_FOUND; 25 | import static org.apache.http.HttpStatus.SC_NO_CONTENT; 26 | import static org.apache.http.HttpStatus.SC_OK; 27 | import static org.apache.http.HttpStatus.SC_REQUEST_TOO_LONG; 28 | import static org.apache.http.HttpStatus.SC_SERVICE_UNAVAILABLE; 29 | import static org.apache.http.HttpStatus.SC_UNAUTHORIZED; 30 | import static org.apache.http.HttpStatus.SC_UNPROCESSABLE_ENTITY; 31 | import static org.apache.http.HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE; 32 | 33 | import io.restassured.builder.ResponseSpecBuilder; 34 | import io.restassured.specification.ResponseSpecification; 35 | 36 | /** 37 | * @author jpettit 38 | * 39 | */ 40 | public enum ExpectedResponseTypes { 41 | 42 | // Any response code 43 | ANY(-1), 44 | 45 | // 2xx Response Codes 46 | /** 200 **/ 47 | OK(SC_OK), 48 | /** 201 **/ 49 | CREATED(SC_CREATED), 50 | /** 202 **/ 51 | ACCEPTED(SC_ACCEPTED), 52 | /** 204 **/ 53 | DELETED(SC_NO_CONTENT), 54 | 55 | // 4xx Response Codes 56 | /** 400 **/ 57 | BAD_REQUEST(SC_BAD_REQUEST), 58 | /** 401 **/ 59 | UNAUTHORIZED(SC_UNAUTHORIZED), 60 | /** 403 **/ 61 | FORBIDDEN(SC_FORBIDDEN), 62 | /** 404 **/ 63 | NOT_FOUND(SC_NOT_FOUND), 64 | /** 405 **/ 65 | METHOD_NOT_ALLOWED(SC_METHOD_NOT_ALLOWED), 66 | /** 406 **/ 67 | NOT_ACCEPTABLE(SC_NOT_ACCEPTABLE), 68 | /** 409 **/ 69 | CONFLICT(SC_CONFLICT), 70 | /** 413 **/ 71 | REQUEST_TOO_LONG(SC_REQUEST_TOO_LONG), 72 | /** 415 **/ 73 | UNSUPPORTED_MEDIA_TYPE(SC_UNSUPPORTED_MEDIA_TYPE), 74 | /** 422 **/ 75 | UNPROCESSABLE_ENTITY(SC_UNPROCESSABLE_ENTITY), 76 | /** 423 **/ 77 | LOCKED(SC_LOCKED), 78 | 79 | // 5xx Response Codes 80 | /** 503 **/ 81 | SERVICE_UNAVAILABLE(SC_SERVICE_UNAVAILABLE), 82 | /** 504 **/ 83 | GATEWAY_TIMEOUT(SC_GATEWAY_TIMEOUT); 84 | 85 | private ExpectedResponseTypes(int status) { 86 | ResponseSpecBuilder bldr = new ResponseSpecBuilder(); 87 | if (status != -1) { 88 | bldr.expectStatusCode(status); 89 | } 90 | this.response = bldr.build(); 91 | } 92 | 93 | public ResponseSpecification getResponseSpecification() { 94 | return this.response; 95 | } 96 | 97 | private ResponseSpecification response; 98 | } 99 | -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/src/main/java/com/adobe/ride/libraries/fuzzer/PathFuzzer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.libraries.fuzzer; 14 | 15 | import org.testng.annotations.Factory; 16 | import org.testng.annotations.Test; 17 | import com.adobe.ride.libraries.fuzzer.engines.PathEngine; 18 | import io.restassured.builder.RequestSpecBuilder; 19 | import io.restassured.http.Method; 20 | 21 | /** 22 | * Class for fuzzing paths for arbitrary urls 23 | * 24 | * Work in Progress 25 | * 26 | * @author tedcasey 27 | * 28 | */ 29 | @Test 30 | public class PathFuzzer { 31 | protected String serviceName; 32 | protected String fuzzPath; 33 | protected Method RESTmethod; 34 | private RequestSpecBuilder requestSpecBldr; 35 | private String[] pathSet; 36 | private Object[][] fuzzSet; 37 | 38 | /** 39 | * Constructor for the Path Fuzzer. 40 | * 41 | * @param serviceName name of the target service, which is a mapping to the config folder in the 42 | * project resources 43 | * @param reqSpec RequestSpecBuilder to be passed in the REST call sent to the core 44 | * @param pathToBeFuzzed standard REST api path 45 | * @param method http action to be invoked (i.e. POST, GET, etc.) 46 | */ 47 | public PathFuzzer(String serviceName, RequestSpecBuilder reqSpec, String pathToBeFuzzed, 48 | Method method) { 49 | this.serviceName = serviceName; 50 | requestSpecBldr = reqSpec; 51 | requestSpecBldr.setUrlEncodingEnabled(true); 52 | RESTmethod = method; 53 | // Remove leading slash, if passed 54 | fuzzPath = 55 | (pathToBeFuzzed.startsWith("/")) ? pathToBeFuzzed.substring(1, pathToBeFuzzed.length() - 1) 56 | : pathToBeFuzzed; 57 | // splt path for fuzzing path parts 58 | pathSet = fuzzPath.split("/"); 59 | fuzzSet = populatePropertiesSet(pathSet); 60 | 61 | fuzzPath = pathToBeFuzzed; 62 | } 63 | 64 | /** 65 | * Method which turns the path into a dataprovider for the fuzzer to use. 66 | * 67 | * @param pathSet Array with the split pieces of the path 68 | * @return 69 | */ 70 | private Object[][] populatePropertiesSet(String[] pathSet) { 71 | Object[][] popTemp = new Object[pathSet.length][2]; 72 | for (int i = 0; i < pathSet.length; i++) { 73 | popTemp[i][0] = fuzzPath; 74 | popTemp[i][1] = pathSet[i]; 75 | } 76 | return popTemp; 77 | } 78 | 79 | /** 80 | * Method with drives the data to the engine. 81 | * 82 | * @return Object[] 83 | */ 84 | @Factory 85 | public Object[] fuzzPath() { 86 | Object[] result = new Object[fuzzSet.length]; 87 | for (int i = 0; i < fuzzSet.length; i++) { 88 | String path = fuzzSet[i][0].toString(); 89 | String target = fuzzSet[i][1].toString(); 90 | result[i] = new PathEngine(serviceName, requestSpecBldr, path, target, RESTmethod); 91 | } 92 | return result; 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/test/resources/schemas/TestService/profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "definitions": { 4 | "record": { 5 | "type": "object", 6 | "required": [ 7 | "person", 8 | "addresses" 9 | ], 10 | "additionalProperties": false, 11 | "properties": { 12 | "person": { 13 | "$ref": "#/definitions/person" 14 | }, 15 | "addresses": { 16 | "type": "array", 17 | "items": { 18 | "properties": { 19 | "address": { 20 | "$ref": "#/definitions/address" 21 | } 22 | }, 23 | "type": "object" 24 | } 25 | } 26 | } 27 | }, 28 | "person": { 29 | "type": "object", 30 | "required": [ 31 | "firstName" 32 | ], 33 | "additionalProperties": false, 34 | "properties": { 35 | "firstName": { 36 | "type": "string" 37 | }, 38 | "lastName": { 39 | "type": "string" 40 | }, 41 | "birthDay": { 42 | "type": "integer" 43 | }, 44 | "birthMonth": { 45 | "type": "integer" 46 | }, 47 | "birthYear": { 48 | "type": "integer" 49 | }, 50 | "gender": { 51 | "enum": [ 52 | "female", 53 | "male", 54 | "dts" 55 | ] 56 | }, 57 | "audit": { 58 | "$ref": "#/definitions/audit" 59 | } 60 | } 61 | }, 62 | "address": { 63 | "type": "object", 64 | "required": [ 65 | "city" 66 | ], 67 | "additionalProperties": false, 68 | "properties": { 69 | "street1": { 70 | "type": "string" 71 | }, 72 | "street2": { 73 | "type": "string" 74 | }, 75 | "city": { 76 | "type": "string" 77 | } 78 | } 79 | }, 80 | "audit": { 81 | "type": "object", 82 | "required": [ 83 | "createdOn" 84 | ], 85 | "additionalProperties": false, 86 | "properties": { 87 | "createdOn": { 88 | "type": "string", 89 | "format": "date-time", 90 | "description": "creation time in yyyy-MM-ddTHH:mm:ssZ format", 91 | "mutable": false, 92 | "searchable": true 93 | }, 94 | "modifiedOn": { 95 | "type": "string", 96 | "format": "date-time", 97 | "description": "modification time in yyyy-MM-ddTHH:mm:ssZ format", 98 | "mutable": false, 99 | "searchable": true 100 | }, 101 | "createdByUser": { 102 | "$ref": "#/definitions/createdBy" 103 | } 104 | } 105 | }, 106 | "createdBy": { 107 | "type": "object", 108 | "required": [ 109 | "id", 110 | "username", 111 | "fullName", 112 | "authentication" 113 | ], 114 | "additionalProperties": false, 115 | "properties": { 116 | "id": { 117 | "type": "string" 118 | }, 119 | "username": { 120 | "type": "string", 121 | "format": "email" 122 | }, 123 | "fullName": { 124 | "type": "string" 125 | }, 126 | "authentication": { 127 | "enum": [ 128 | "oauth", 129 | "ldap" 130 | ] 131 | } 132 | } 133 | } 134 | }, 135 | "type": "array", 136 | "items": { 137 | "properties": { 138 | "record": { 139 | "$ref": "#/definitions/record" 140 | }, 141 | "xid": { 142 | "type": "string" 143 | }, 144 | "sourceId": { 145 | "type": "string" 146 | }, 147 | "timestamp": { 148 | "type": "string", 149 | "format": "timestamp", 150 | "description": "custom format will need to be handled in modelObject" 151 | } 152 | }, 153 | "type": "object" 154 | } 155 | } -------------------------------------------------------------------------------- /libraries/ride-performance-lib/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | 7 | com.adobe.ride 8 | ride-parent 9 | 0.0.1-SNAPSHOT 10 | ../../build/pom.xml 11 | 12 | 13 | ride-performance-lib 14 | 15 | 16 | 2.12.6 17 | 2.3.1 18 | 19 | 20 | 21 | 22 | io.gatling 23 | gatling-app 24 | ${gatling.version} 25 | 26 | 27 | 28 | org.scala-lang 29 | scala-library 30 | 31 | 32 | 33 | 34 | io.gatling.highcharts 35 | gatling-charts-highcharts 36 | ${gatling.version} 37 | 38 | 39 | org.scala-lang 40 | scala-library 41 | 42 | 43 | 44 | 45 | org.scala-lang.modules 46 | scala-parser-combinators_2.12 47 | 1.1.0 48 | 49 | 50 | 51 | 52 | 53 | src/main/scala 54 | src/test/scala 55 | 56 | 57 | 58 | net.alchim31.maven 59 | scala-maven-plugin 60 | 3.3.2 61 | 62 | 63 | 64 | compile 65 | testCompile 66 | 67 | 68 | 69 | -dependencyfile 70 | ${project.build.directory}/.scala_dependencies 71 | 72 | 73 | 74 | 75 | attach-javadocs 76 | 77 | doc-jar 78 | 79 | 80 | 81 | 82 | 83 | org.apache.maven.plugins 84 | maven-surefire-plugin 85 | 2.18.1 86 | 87 | false 88 | true 89 | 90 | 91 | 92 | **/*Test.* 93 | **/*Suite.* 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /sample/sample-product-group-shared-resources/src/main/resources/schemas/SampleService/profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "definitions": { 4 | "record": { 5 | "type": "object", 6 | "required": [ 7 | "person", 8 | "addresses" 9 | ], 10 | "additionalProperties": false, 11 | "properties": { 12 | "person": { 13 | "$ref": "#/definitions/person" 14 | }, 15 | "addresses": { 16 | "type": "array", 17 | "items": { 18 | "properties": { 19 | "address": { 20 | "$ref": "#/definitions/address" 21 | } 22 | }, 23 | "type": "object" 24 | } 25 | } 26 | } 27 | }, 28 | "person": { 29 | "type": "object", 30 | "required": [ 31 | "firstName" 32 | ], 33 | "additionalProperties": false, 34 | "properties": { 35 | "firstName": { 36 | "type": "string" 37 | }, 38 | "lastName": { 39 | "type": "string" 40 | }, 41 | "birthDay": { 42 | "type": "integer" 43 | }, 44 | "birthMonth": { 45 | "type": "integer" 46 | }, 47 | "birthYear": { 48 | "type": "integer" 49 | }, 50 | "gender": { 51 | "enum": [ 52 | "female", 53 | "male", 54 | "dts" 55 | ] 56 | }, 57 | "audit": { 58 | "$ref": "#/definitions/audit" 59 | } 60 | } 61 | }, 62 | "address": { 63 | "type": "object", 64 | "required": [ 65 | "city" 66 | ], 67 | "additionalProperties": false, 68 | "properties": { 69 | "street1": { 70 | "type": "string" 71 | }, 72 | "street2": { 73 | "type": "string" 74 | }, 75 | "city": { 76 | "type": "string" 77 | } 78 | } 79 | }, 80 | "audit": { 81 | "type": "object", 82 | "required": [ 83 | "createdOn" 84 | ], 85 | "additionalProperties": false, 86 | "properties": { 87 | "createdOn": { 88 | "type": "string", 89 | "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$", 90 | "format": "date-time", 91 | "description": "creation time in yyyy-MM-dd'T'HH:mm:ssZ format", 92 | "mutable": false, 93 | "searchable": true 94 | }, 95 | "modifiedOn": { 96 | "type": "string", 97 | "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$", 98 | "format": "date-time", 99 | "description": "modification time in yyyy-MM-dd'T'HH:mm:ssZ format", 100 | "mutable": false, 101 | "searchable": true 102 | }, 103 | "createdByUser": { 104 | "$ref": "#/definitions/createdBy" 105 | } 106 | } 107 | }, 108 | "createdBy": { 109 | "type": "object", 110 | "required": [ 111 | "id", 112 | "username", 113 | "fullName", 114 | "authentication" 115 | ], 116 | "additionalProperties": false, 117 | "properties": { 118 | "id": { 119 | "type": "string" 120 | }, 121 | "username": { 122 | "type": "string", 123 | "format": "email" 124 | }, 125 | "fullName": { 126 | "type": "string" 127 | }, 128 | "authentication": { 129 | "enum": [ 130 | "oauth", 131 | "ldap" 132 | ] 133 | } 134 | } 135 | } 136 | }, 137 | "type": "array", 138 | "items": { 139 | "properties": { 140 | "record": { 141 | "$ref": "#/definitions/record" 142 | }, 143 | "xid": { 144 | "type": "string" 145 | }, 146 | "sourceId": { 147 | "type": "string" 148 | }, 149 | "timestamp": { 150 | "type": "string", 151 | "format": "timestamp", 152 | "description": "custom format will need to be handled in modelObject" 153 | } 154 | }, 155 | "type": "object" 156 | } 157 | } -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/aop/TargetServiceConfiguration.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.aop; 14 | 15 | /** 16 | * Enumeration for easy access to target service configurations loaded from environment property 17 | * files. 18 | * 19 | * @author jpettit, tedcasey 20 | */ 21 | public class TargetServiceConfiguration { 22 | 23 | public static final String SCHEMA_KEY = "schema"; 24 | public static final String ENDPOINT_KEY = "endpoint"; 25 | public static final String PORT_KEY = "port"; 26 | public static final String BASE_PATH_KEY = "basePath"; 27 | 28 | private final String serviceName; 29 | private final String schema; 30 | private final String endpoint; 31 | private final int port; 32 | private final String basePath; 33 | private final String serviceURL; 34 | 35 | /** 36 | * Constructor for the TargetServiceConfiguration class. All of these arguments will be passed in 37 | * from the properties files as part of the config-util workflow. 38 | * 39 | * @param serviceName name of the service, which is a mapping to the config folder in resources 40 | * @param schema internet protocol schema used in the endpoint (i.e. http, https, etc.) 41 | * @param endpoint endpoint of the service 42 | * @param port port the service uses (i.e. 80, 443, etc.) 43 | * @param basePath if warranted ("/" for no base path) 44 | */ 45 | public TargetServiceConfiguration(String serviceName, String schema, String endpoint, String port, 46 | String basePath) { 47 | this.serviceName = serviceName; 48 | this.schema = schema; 49 | this.endpoint = endpoint; 50 | this.port = Integer.parseInt(port); 51 | this.basePath = basePath; 52 | this.serviceURL = schema + "://" + endpoint + ":" + port + basePath; 53 | } 54 | 55 | /** 56 | * Returns the name of the service url being constructed. 57 | * 58 | * @return String 59 | */ 60 | public String serviceName() { 61 | return serviceName; 62 | } 63 | 64 | /** 65 | * Returns the schema of the service url being constructed. 66 | * 67 | * @return String 68 | */ 69 | public String schema() { 70 | return schema; 71 | } 72 | 73 | /** 74 | * Returns the endpoint of the service url being constructed. 75 | * 76 | * @return String 77 | */ 78 | public String endpoint() { 79 | return endpoint; 80 | } 81 | 82 | /** 83 | * Returns the port of the service url being constructed. 84 | * 85 | * @return String 86 | */ 87 | public int port() { 88 | return port; 89 | } 90 | 91 | /** 92 | * Returns the base path of the service url being constructed. 93 | * 94 | * @return String 95 | */ 96 | public String basePath() { 97 | return basePath; 98 | } 99 | 100 | /** 101 | * Returns the base uri of the service url being constructed. 102 | * 103 | * @return String 104 | */ 105 | public String getBaseURI() { 106 | return schema + "://" + endpoint; 107 | } 108 | 109 | /** 110 | * Returns the full url being constructed. 111 | * 112 | * @return String 113 | */ 114 | public String getURL() { 115 | return serviceURL; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /libraries/ride-fuzzer-lib/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.ride 7 | ride-parent 8 | 0.0.1-SNAPSHOT 9 | ../../build/pom.xml 10 | 11 | 12 | ride-fuzzer-lib 13 | jar 14 | ride-fuzzer-lib 15 | Library to fuzz various components of a REST API 16 | 17 | 18 | 19 | com.adobe.ride 20 | ride-core 21 | ${project.parent.version} 22 | 23 | 24 | 25 | 26 | 27 | certification 28 | 29 | false 30 | 31 | 32 | 33 | 34 | org.apache.maven.plugins 35 | maven-failsafe-plugin 36 | 2.18.1 37 | 38 | certification 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-site-plugin 51 | 3.4 52 | 53 | 54 | 55 | org.codehaus.mojo 56 | findbugs-maven-plugin 57 | 3.0.0 58 | 59 | 60 | org.codehaus.mojo 61 | cobertura-maven-plugin 62 | 63 | 64 | xml 65 | html 66 | 67 | 68 | 69 | 70 | 71 | org.apache.maven.plugins 72 | maven-javadoc-plugin 73 | 2.10 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-surefire-report-plugin 78 | 2.17 79 | 80 | 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-surefire-plugin 86 | 2.18 87 | 88 | integration 89 | 90 | 91 | 92 | 93 | test 94 | 95 | 96 | 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-failsafe-plugin 101 | 2.18 102 | 103 | 104 | **/*IntegrationTest.java 105 | 106 | 107 | 108 | 109 | 110 | integration-test 111 | verify 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /utilities/ride-config-util/src/main/java/com/adobe/ride/config/management/FileUtils.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.config.management; 14 | 15 | import java.io.Closeable; 16 | import java.io.File; 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.nio.ByteBuffer; 20 | import java.nio.charset.Charset; 21 | import java.nio.charset.StandardCharsets; 22 | import java.nio.file.Files; 23 | import java.nio.file.NoSuchFileException; 24 | import java.nio.file.Paths; 25 | 26 | import org.apache.commons.io.IOUtils; 27 | 28 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 29 | 30 | /** 31 | * 32 | * @author hook 33 | * 34 | */ 35 | public class FileUtils { 36 | public static String getUserHome() { 37 | String dir = System.getProperty("user.home"); 38 | return dir; 39 | } 40 | 41 | public static String getUserDirectory() { 42 | return System.getProperty("user.dir"); 43 | } 44 | 45 | public static void validate(String filePath) { 46 | File file = new File(filePath); 47 | validate(file); 48 | } 49 | 50 | @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH", 51 | justification = "This wasn't authored by QE and may be refactored at a later date.") 52 | public static void validate(File file) { 53 | if (file == null || !file.exists()) { 54 | throw new FileDoesNotExistException( 55 | String.format("file: %s does not exist", file.getAbsolutePath())); 56 | } 57 | } 58 | 59 | public static void closeQuietly(ILogUtils log, Closeable stream) { 60 | if (stream != null) { 61 | try { 62 | stream.close(); 63 | stream = null; 64 | } catch (IOException e) { 65 | if (log != null) 66 | log.error(e); 67 | } 68 | } 69 | } 70 | 71 | public static void closeQuietly(Closeable stream) { 72 | if (stream != null) { 73 | try { 74 | stream.close(); 75 | stream = null; 76 | } catch (IOException e) { 77 | // no logging context 78 | } 79 | } 80 | } 81 | 82 | public synchronized static void deleteFileQuietly(ILogUtils log, File file) { 83 | if (file != null && file.exists()) { 84 | try { 85 | file.delete(); 86 | } catch (SecurityException e) { 87 | if (log != null) 88 | log.error(e); 89 | } 90 | } 91 | } 92 | 93 | public synchronized static void deleteFileQuietly(File file) { 94 | if (file != null && file.exists()) { 95 | try { 96 | file.delete(); 97 | } catch (SecurityException e) { 98 | // no logging context 99 | } 100 | } 101 | } 102 | 103 | public synchronized static String readFileAsUTF8(String path) 104 | throws NoSuchFileException, IOException { 105 | Validation.isNullOrEmptyParameter("path", path); 106 | 107 | Charset encoding = StandardCharsets.UTF_8; 108 | 109 | return readFile(path, encoding); 110 | } 111 | 112 | public synchronized static String readFile(String path, Charset encoding) 113 | throws NoSuchFileException, IOException { 114 | Validation.isNullOrEmptyParameter("path", path); 115 | Validation.isNullOrEmptyParameter("encoding", encoding); 116 | 117 | byte[] encoded = Files.readAllBytes(Paths.get(path)); 118 | return encoding.decode(ByteBuffer.wrap(encoded)).toString(); 119 | } 120 | 121 | public synchronized static String writeFileDataToStringAsUTF8(InputStream inputStream) 122 | throws IOException { 123 | Validation.isNullOrEmptyParameter("inputStream", inputStream); 124 | 125 | Charset encoding = StandardCharsets.UTF_8; 126 | 127 | String data = IOUtils.toString(inputStream, encoding); 128 | return data; 129 | } 130 | 131 | public synchronized static String writeFileDataToString(InputStream inputStream, Charset encoding) 132 | throws IOException { 133 | Validation.isNullOrEmptyParameter("inputStream", inputStream); 134 | Validation.isNullOrEmptyParameter("encoding", encoding); 135 | 136 | String data = IOUtils.toString(inputStream, encoding); 137 | return data; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /sample/sample-service-extension/src/main/java/com/adobe/ride/sample/core/SampleServiceController.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample.core; 14 | 15 | import org.apache.http.HttpHeaders; 16 | import com.adobe.ride.core.controllers.RestApiController; 17 | import com.adobe.ride.core.types.MimeTypes; 18 | import com.adobe.ride.sample.filters.AuthFilter; 19 | import com.adobe.ride.sample.types.Service; 20 | import com.adobe.ride.utilities.model.ModelObject; 21 | 22 | import io.restassured.builder.RequestSpecBuilder; 23 | import io.restassured.filter.Filter; 24 | import io.restassured.http.Method; 25 | import io.restassured.response.Response; 26 | import io.restassured.specification.ResponseSpecification; 27 | 28 | /** 29 | * 30 | * @author tedcasey 31 | * 32 | */ 33 | public class SampleServiceController extends RestApiController { 34 | 35 | public static final Filter filter = new AuthFilter("SampleService"); 36 | 37 | public enum ObjectType { 38 | OBJECT, ARRAY; 39 | } 40 | 41 | protected static RequestSpecBuilder getDefaultReqSpecBuilder(Filter... filters) { 42 | RequestSpecBuilder builder; 43 | builder = RestApiController.getRequestBuilder(true, filters); 44 | builder.addHeader(HttpHeaders.ACCEPT, MimeTypes.APP_JSON.toString()); 45 | builder.addHeader(HttpHeaders.CONTENT_TYPE, MimeTypes.APP_JSON.toString()); 46 | return builder; 47 | } 48 | 49 | public static Response createOrUpdate(String objectPath, ModelObject object, 50 | ResponseSpecification expectedResponse) { 51 | return callCore(ObjectType.OBJECT, objectPath, object, expectedResponse, Method.PUT, false); 52 | } 53 | 54 | public static Response createOrUpdateObject(String objectPath, ModelObject object, 55 | ResponseSpecification expectedResponse, boolean addAuthorization) { 56 | return callCore(ObjectType.OBJECT, objectPath, object, expectedResponse, Method.PUT, 57 | addAuthorization); 58 | } 59 | 60 | public static Response createOrUpdateArrayObject(String objectPath, ModelObject object, 61 | ResponseSpecification expectedResponse, boolean addAuthorization) { 62 | return callCore(ObjectType.ARRAY, objectPath, object, expectedResponse, Method.PUT, 63 | addAuthorization); 64 | } 65 | 66 | public static Response get(String objectPath, ModelObject object, 67 | ResponseSpecification expectedResponse) { 68 | return callCore(ObjectType.OBJECT, objectPath, object, expectedResponse, Method.GET, false); 69 | } 70 | 71 | public static Response get(String objectPath, ModelObject object, 72 | ResponseSpecification expectedResponse, boolean addAuthorization) { 73 | return callCore(ObjectType.OBJECT, objectPath, object, expectedResponse, Method.GET, 74 | addAuthorization); 75 | } 76 | 77 | public static Response delete(String objectPath, ModelObject object, 78 | ResponseSpecification expectedResponse) { 79 | return callCore(ObjectType.OBJECT, objectPath, object, expectedResponse, Method.DELETE, false); 80 | } 81 | 82 | public static Response delete(String objectPath, ModelObject object, 83 | ResponseSpecification expectedResponse, boolean addAuthorization) { 84 | return callCore(ObjectType.OBJECT, objectPath, object, expectedResponse, Method.DELETE, 85 | addAuthorization); 86 | } 87 | 88 | private static Response callCore(ObjectType type, String objectPath, ModelObject object, 89 | ResponseSpecification expectedResponse, Method method, boolean addAuthorization) { 90 | RequestSpecBuilder reqBuilder = getDefaultReqSpecBuilder(); 91 | if (method != Method.GET) { 92 | if (type == ObjectType.OBJECT) { 93 | reqBuilder.setBody(object.getObjectMetadata()); 94 | } else { 95 | reqBuilder.setBody(object.getObjectItems()); 96 | } 97 | } 98 | Response response = null; 99 | if (addAuthorization) { 100 | response = fireRestCall(Service.SAMPLE_SERVICE.toString(), objectPath, reqBuilder, 101 | expectedResponse, method, filter); 102 | } else { 103 | response = fireRestCall(Service.SAMPLE_SERVICE.toString(), objectPath, reqBuilder, 104 | expectedResponse, method); 105 | } 106 | return response; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /sample/sample-service-tests/src/test/java/com/adobe/ride/sample/BasicTest_IT.java: -------------------------------------------------------------------------------- 1 | /*- 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | package com.adobe.ride.sample; 14 | 15 | import java.util.UUID; 16 | import org.testng.annotations.Test; 17 | import com.adobe.ride.core.types.ExpectedResponse; 18 | import com.adobe.ride.sample.cloud_objects.ArrayObject; 19 | import com.adobe.ride.sample.cloud_objects.ProfileObject; 20 | import com.adobe.ride.sample.cloud_objects.SampleServiceObject1; 21 | import com.adobe.ride.sample.cloud_objects.SampleServiceObject2; 22 | import com.adobe.ride.sample.core.SampleServiceController; 23 | import io.restassured.builder.ResponseSpecBuilder; 24 | import io.restassured.module.jsv.JsonSchemaValidator; 25 | import io.restassured.specification.ResponseSpecification; 26 | 27 | /** 28 | * 29 | * @author tedcasey 30 | * 31 | */ 32 | public class BasicTest_IT { 33 | 34 | @Test(groups = {"smoke", "acceptance"}) 35 | public void testAuthenticatedCalltoServer() { 36 | String itemName = UUID.randomUUID().toString(); 37 | // Create Object 38 | SampleServiceObject1 testObject = new SampleServiceObject1(itemName, false); 39 | SampleServiceController.createOrUpdateObject(testObject.getObjectPath(), testObject, 40 | ExpectedResponse.CREATED_RESPONSE, true); 41 | } 42 | 43 | @Test(groups = {"smoke", "acceptance"}) 44 | public void testValidateResponseAgainstSchema() { 45 | String itemName = UUID.randomUUID().toString(); 46 | // Create Object 47 | SampleServiceObject1 testObject = new SampleServiceObject1(itemName, false); 48 | 49 | ResponseSpecBuilder response = new ResponseSpecBuilder(); 50 | response.expectStatusCode(201); 51 | response.expectBody(JsonSchemaValidator.matchesJsonSchema(testObject.getModelString())); 52 | ResponseSpecification responseSpec = response.build(); 53 | 54 | SampleServiceController.createOrUpdateObject(testObject.getObjectPath(), testObject, 55 | responseSpec, false); 56 | } 57 | 58 | @Test(groups = {"smoke", "acceptance"}) 59 | public void runBasicArrayObjectTest() { 60 | String itemName = UUID.randomUUID().toString(); 61 | ArrayObject testObject = new ArrayObject(itemName, false); 62 | 63 | ResponseSpecBuilder response = new ResponseSpecBuilder(); 64 | response.expectStatusCode(201); 65 | 66 | ResponseSpecification expected = response.build(); 67 | 68 | // Temporary boolean flag added to call to indicate that we want to authenticate 69 | // this call 70 | SampleServiceController.createOrUpdateArrayObject(testObject.getObjectPath(), testObject, 71 | expected, false); 72 | } 73 | 74 | @Test(groups = {"smoke", "acceptance"}, enabled = false) 75 | public void runSyncdObjectTest() { 76 | String itemName = UUID.randomUUID().toString(); 77 | // Create Object 78 | SampleServiceObject2 testObject = new SampleServiceObject2(itemName, false); 79 | // Send Object To Server 80 | SampleServiceController.createOrUpdateObject(testObject.getObjectPath(), testObject, 81 | ExpectedResponse.CREATED_RESPONSE, false); 82 | } 83 | 84 | @Test(groups = {"smoke", "acceptance"}) 85 | public void runComplexObjectTest() { 86 | String itemName = UUID.randomUUID().toString(); 87 | // Create Object 88 | ProfileObject testObject = new ProfileObject(itemName, false); 89 | testObject.buildValidModelInstance(); 90 | // Send Object To Server 91 | SampleServiceController.createOrUpdateArrayObject(testObject.getObjectPath(), testObject, 92 | ExpectedResponse.CREATED_RESPONSE, false); 93 | } 94 | 95 | @Test 96 | public void createObjUpdateAndDeleteObject() { 97 | // Create Object 98 | String itemName = UUID.randomUUID().toString(); 99 | SampleServiceObject1 testObject = new SampleServiceObject1(itemName, false); 100 | SampleServiceController.createOrUpdate(testObject.getObjectPath(), testObject, 101 | ExpectedResponse.CREATED_RESPONSE); 102 | 103 | // Update Object 104 | testObject.setProperty("thisProperty", "fred"); 105 | SampleServiceController.createOrUpdate(testObject.getObjectPath(), testObject, 106 | ExpectedResponse.OK_RESPONSE); 107 | 108 | // Delete Object 109 | SampleServiceController.delete(testObject.getObjectPath(), testObject, 110 | ExpectedResponse.DELETED_RESPONSE); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/main/resources/schemas/TestService/article.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "definitions": { 4 | "imagelink": { 5 | "type":"object", 6 | "required":["href"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "width": { "type": "integer", "minimum":16, "maximum":2048}, 10 | "height":{ "type": "integer", "minimum":16, "maximum":2048}, 11 | "href": { "type": "string", "format":"uri" }, 12 | "type": { "type": "string" } 13 | } 14 | }, 15 | "entitylink": { 16 | "type":"object", 17 | "required":["href"], 18 | "additionalProperties": false, 19 | "properties": { 20 | "href": { "type": "string", "format":"uri" }, 21 | "type": { "type": "string" } 22 | } 23 | }, 24 | "contentlink": { 25 | "type":"object", 26 | "required":["href"], 27 | "additionalProperties": false, 28 | "properties": { 29 | "href": { "type": "string", "format":"uri" }, 30 | "type": { "type": "string" } 31 | } 32 | } 33 | }, 34 | "title" : "Article schema", 35 | "type": "object", 36 | "description": "Schema for an article.", 37 | "required": ["entityName", "entityType"], 38 | "additionalProperties": false, 39 | "properties": { 40 | "publicationId": { "type" : "string", "pattern": "^[0-9a-zA-Z]{1}[0-9a-zA-Z._-]{0,62}[0-9a-zA-Z]{1}$", "mutable":false }, 41 | "entityId": { "type" : "string", "pattern": "^urn:[0-9a-zA-Z]{1}[0-9a-zA-Z.-]{0,62}[0-9a-zA-Z]{1}:article:[0-9a-zA-Z]{1}[0-9a-zA-Z._-]{0,62}[0-9a-zA-Z]{1}$", "description" : "urn:{publicationName}:{entityType}:{entityName}", "mutable":false }, 42 | "entityType": { "type" : "string", "pattern" : "article", "mutable":false, "searchable":true }, 43 | "entityName": { "type": "string", "pattern": "^[0-9a-zA-Z]{1}[0-9a-zA-Z._-]{0,62}[0-9a-zA-Z]{1}$", "mutable":false, "searchable":true }, 44 | "version": { "type": "string", "pattern": "^[0-9]{12,13}$", "mutable":false }, 45 | "url": { "type": "string", "format" : "uri" }, 46 | "created": { "type": "string", "format": "date-time", "description":"creation time in yyyy-MM-ddTHH:mm:ssZ format", "mutable":false, "searchable":true }, 47 | "modified": { "type": "string", "format": "date-time", "description":"last modified time in yyyy-MM-ddTHH:mm:ssZ format", "mutable":false, "searchable":true }, 48 | "published": { "type": "string", "format": "date-time", "description":"last published time in yyyy-MM-ddTHH:mm:ssZ format", "searchable":true }, 49 | 50 | "_links": 51 | { 52 | "type": "object", 53 | "additionalProperties": false, 54 | "properties": { 55 | "contentUrl": { "$ref":"#/definitions/contentlink", "mutable":false }, 56 | "thumbnail": { "$ref":"#/definitions/imagelink", "imagelink":true }, 57 | "socialSharing": { "$ref":"#/definitions/imagelink", "imagelink":true }, 58 | "collections" : { "type" : "array", "items": { "$ref":"#/definitions/entitylink" }, "mutable":false }, 59 | "relatedContent" : { "type" : "array", "items": { "$ref":"#/definitions/entitylink" } }, 60 | "articleFolio" : { "$ref":"#/definitions/contentlink" } 61 | } 62 | }, 63 | 64 | "title": { "type" : "string", "maxLength" : 250, "minLength" : 1, "searchable":true }, 65 | "shortTitle": { "type": "string", "maxLength" : 140, "minLength" : 1, "description":"An abbreviated article title for usage on smaller screens such as in the phone layout.", "searchable":true }, 66 | "abstract": { "type" : "string", "maxLength" : 400, "minLength" : 1, "searchable":true }, 67 | "shortAbstract": { "type" : "string", "maxLength" : 250, "minLength" : 1, "searchable":true }, 68 | "keywords" : { "type" : "array", "items": { "type": "string", "maxLength" : 40, "minLength" : 1 }, "minItems":1, "uniqueItems": true, "searchable":true }, 69 | "internalKeywords" : { "type" : "array", "items": { "type": "string", "maxLength" : 40, "minLength" : 1 }, "minItems":1, "uniqueItems": true }, 70 | "productIds": { "type": "array", "items": { "type": "string" } }, 71 | "department": { "type": "string", "searchable":true }, 72 | "category": { "type": "string", "maxLength": 40, "searchable":true }, 73 | "importance": { "enum" : ["low", "normal", "high"] }, 74 | "socialShareUrl" : { "type": "string", "format": "uri", "maxLength": 150 }, 75 | "publishStatus": { "enum" : ["unpublished", "publishing", "published"] }, 76 | 77 | "author": { "type": "string", "maxLength": 100, "searchable":true }, 78 | "authorUrl": { "type": "string", "format": "uri", "maxLength": 150 }, 79 | "articleText": { "type": "string", "maxLength": 2000 }, 80 | "suggestedKeywords" : { "type" : "array", "items": { "type": "string", "maxLength" : 40, "minLength" : 1 }, "minItems":1, "uniqueItems": true }, 81 | "suggestedCategory": { "type": "string", "maxLength": 40 }, 82 | "isAd": { "type": "boolean" }, 83 | "adType" : { "enum" :["static", "eft"] }, 84 | "adCategory": { "type": "string", "maxLength": 40 }, 85 | "advertiser": { "type":"string", "maxLength": 40 }, 86 | "language": { "enum" : ["zh-CN", "zh-TW", "cs-CZ", "da-DK", "nl-NL", "en-GB", "en-US", "fi-FI", "fr-FR", "de-DE", "hu-HU", "it-IT", "ja-JP", "ko-KR", "no-NO", "pl-PL", "pt-BR", "ru-RU", "es-ES", "sv-SE", "tr-TR", "uk-UA" ] }, 87 | "accessState" : { "enum": [ "free", "metered", "protected" ] }, 88 | "hideFromBrowsePage" : { "type": "boolean" } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /utilities/ride-model-util/src/test/resources/schemas/TestService/article.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "definitions": { 4 | "imagelink": { 5 | "type":"object", 6 | "required":["href"], 7 | "additionalProperties": false, 8 | "properties": { 9 | "width": { "type": "integer", "minimum":16, "maximum":2048}, 10 | "height":{ "type": "integer", "minimum":16, "maximum":2048}, 11 | "href": { "type": "string", "format":"uri" }, 12 | "type": { "type": "string" } 13 | } 14 | }, 15 | "contentlink": { 16 | "type":"object", 17 | "required":["href"], 18 | "additionalProperties": false, 19 | "properties": { 20 | "href": { "type": "string", "format":"uri" }, 21 | "type": { "type": "string" } 22 | } 23 | } 24 | }, 25 | "title" : "Article schema", 26 | "type": "object", 27 | "description": "Schema for an article.", 28 | "required": ["entityName", "entityType"], 29 | "additionalProperties": false, 30 | "properties": { 31 | "publicationId": { "type" : "string", "pattern": "^[0-9a-zA-Z]{1}[0-9a-zA-Z._-]{0,62}[0-9a-zA-Z]{1}$", "mutable":false }, 32 | "entityId": { "type" : "string", "pattern": "^urn:[0-9a-zA-Z]{1}[0-9a-zA-Z.-]{0,62}[0-9a-zA-Z]{1}:article:[0-9a-zA-Z]{1}[0-9a-zA-Z._-]{0,62}[0-9a-zA-Z]{1}$", "description" : "urn:{publicationName}:{entityType}:{entityName}", "mutable":false }, 33 | "entityType": { "type" : "string", "pattern" : "article", "mutable":false, "searchable":true }, 34 | "entityName": { "type": "string", "pattern": "^[0-9a-zA-Z]{1}[0-9a-zA-Z._-]{0,62}[0-9a-zA-Z]{1}$", "mutable":false, "searchable":true }, 35 | "version": { "type": "string", "pattern": "^[0-9]{12,13}$", "mutable":false }, 36 | "url": {"type": "string", "format" : "uri", "maxLength": 2048 }, 37 | "created": { "type": "string", "format": "date-time", "description":"creation time in yyyy-MM-ddTHH:mm:ssZ format", "mutable":false, "searchable":true }, 38 | "modified": { "type": "string", "format": "date-time", "description":"last modified time in yyyy-MM-ddTHH:mm:ssZ format", "mutable":false, "searchable":true }, 39 | "published": { "type": "string", "format": "date-time", "description":"last published time in yyyy-MM-ddTHH:mm:ssZ format", "searchable":true }, 40 | "syncdUrl": { "type": "string", "sync" : "{$path:/publicationId}/article/{$path:/entityName};version={$path:/version}" }, 41 | "_links": 42 | { 43 | "type": "object", 44 | "additionalProperties": false, 45 | "properties": { 46 | "contentUrl": { "$ref":"#/definitions/contentlink", "mutable":false }, 47 | "thumbnail": { "$ref":"#/definitions/imagelink", "imagelink":true }, 48 | "socialSharing": { "$ref":"#/definitions/imagelink", "imagelink":true }, 49 | "collections" : { "type" : "array", "items": { "$ref":"entitylink.json" }, "mutable":false }, 50 | "relatedContent" : { "type" : "array", "items": { "$ref":"entitylink.json" } }, 51 | "articleFolio" : { "$ref":"#/definitions/contentlink" } 52 | } 53 | }, 54 | 55 | "title": { "type" : "string", "maxLength" : 250, "minLength" : 1, "searchable":true }, 56 | "shortTitle": { "type": "string", "maxLength" : 140, "minLength" : 1, "description":"An abbreviated article title", "searchable":true }, 57 | "abstract": { "type" : "string", "maxLength" : 400, "minLength" : 1, "searchable":true }, 58 | "shortAbstract": { "type" : "string", "maxLength" : 250, "minLength" : 1, "searchable":true }, 59 | "keywords" : { "type" : "array", "items": { "type": "string", "maxLength" : 40, "minLength" : 1 }, "minItems":1, "uniqueItems": true, "searchable":true }, 60 | "internalKeywords" : { "type" : "array", "items": { "type": "string", "maxLength" : 40, "minLength": 1 }, "minItems": 1, "uniqueItems": true }, 61 | "productIds": { "type": "array", "items": { "type": "string" } }, 62 | "department": { "type": "string", "searchable":true }, 63 | "category": { "type": "string", "maxLength": 40, "searchable":true }, 64 | "importance": { "enum" : ["low", "normal", "high"] }, 65 | "socialShareUrl" : { "type": "string", "format": "uri", "maxLength": 150 }, 66 | "publishStatus": { "enum" : ["unpublished", "publishing", "published"] }, 67 | "authorInfo": { 68 | "type":"object", 69 | "additionalProperties":false, 70 | "properties":{ 71 | "name":{ "type": "string", "maxLength": 100, "searchable":true }, 72 | "authorUrl": { "type": "string", "sync": "{$path:/url}/author/{$path:/authorInfo/name}", "maxLength": 150 }, 73 | "otherArticles": { "type": "array", "sync": "{$path:/_links/relatedContent}", "maxLength": 150 } 74 | } 75 | }, 76 | "articleText": { "type": "string", "maxLength": 2000 }, 77 | "suggestedKeywords" : { "type" : "array", "items": { "type": "string", "maxLength" : 40, "minLength" : 1 }, "minItems":1, "uniqueItems": true }, 78 | "suggestedCategory": { "type": "string", "maxLength": 40 }, 79 | "isAd": { "type": "boolean" }, 80 | "adType" : { "enum" :["static", "eft"] }, 81 | "adCategory": { "type": "string", "maxLength": 40 }, 82 | "advertiser": { "type":"string", "maxLength": 40 }, 83 | "language": { "enum" : ["zh-CN", "zh-TW", "cs-CZ", "da-DK", "nl-NL", "en-GB", "en-US", "fi-FI", "fr-FR", "de-DE", "hu-HU", "it-IT", "ja-JP", "ko-KR", "no-NO", "pl-PL", "pt-BR", "ru-RU", "es-ES", "sv-SE", "tr-TR", "uk-UA" ] }, 84 | "accessState" : { "enum": [ "free", "metered", "protected" ] }, 85 | "hideFromBrowsePage" : { "type": "boolean" } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /core/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.ride 7 | ride-parent 8 | 0.0.1-SNAPSHOT 9 | ../build/pom.xml 10 | 11 | 12 | ride-core 13 | jar 14 | 15 | ride-core 16 | 17 | https://github.com/adobe/ride 18 | 19 | 20 | UTF-8 21 | 22 | 23 | 24 | 25 | 26 | com.adobe.ride 27 | ride-model-util 28 | ${project.parent.version} 29 | compile 30 | 31 | 32 | com.adobe.ride 33 | ride-config-util 34 | ${project.parent.version} 35 | 36 | 37 | com.cedarsoftware 38 | json-io 39 | 2.9.4 40 | 41 | 42 | org.uncommons 43 | reportng 44 | 1.1.4 45 | test 46 | 47 | 48 | org.testng 49 | testng 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-invoker-plugin 60 | 1.7 61 | 62 | true 63 | ${project.build.directory}/it 64 | 65 | */pom.xml 66 | 67 | verify 68 | ${project.build.directory}/local-repo 69 | src/it/settings.xml 70 | 71 | clean 72 | package 73 | 74 | 75 | 76 | 77 | run 78 | 79 | run 80 | 81 | 82 | 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-surefire-plugin 87 | 2.12.4 88 | 89 | 90 | unit-tests 91 | test 92 | 93 | test 94 | 95 | 96 | 97 | true 98 | 99 | 100 | 101 | 102 | 103 | org.apache.maven.plugins 104 | maven-site-plugin 105 | 3.6 106 | 107 | 108 | 109 | org.codehaus.mojo 110 | findbugs-maven-plugin 111 | 3.0.0 112 | 113 | 114 | org.codehaus.mojo 115 | cobertura-maven-plugin 116 | 2.6 117 | 118 | 119 | xml 120 | html 121 | 122 | 123 | 124 | 125 | 126 | org.apache.maven.plugins 127 | maven-javadoc-plugin 128 | 2.10 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | dev 141 | 142 | true 143 | 144 | 145 | ${project.version} 146 | 147 | 148 | 149 | build 150 | 151 | false 152 | 153 | 154 | ${env.GIT_COMMIT} 155 | 156 | 157 | 158 | 159 | 160 | --------------------------------------------------------------------------------