diff options
Diffstat (limited to 'ms/controllerblueprints/modules')
16 files changed, 74 insertions, 94 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-validation/pom.xml b/ms/controllerblueprints/modules/blueprint-validation/pom.xml index 0cafc9a6..d175eecf 100644 --- a/ms/controllerblueprints/modules/blueprint-validation/pom.xml +++ b/ms/controllerblueprints/modules/blueprint-validation/pom.xml @@ -16,16 +16,12 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - -<project - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId> <artifactId>modules</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.1-SNAPSHOT</version> </parent> <artifactId>blueprint-validation</artifactId> <name>Controller Blueprints Validation Service</name> @@ -49,4 +45,3 @@ </dependency> </dependencies> </project> - diff --git a/ms/controllerblueprints/modules/db-resources/pom.xml b/ms/controllerblueprints/modules/db-resources/pom.xml index 69e322e4..c09d96c1 100644 --- a/ms/controllerblueprints/modules/db-resources/pom.xml +++ b/ms/controllerblueprints/modules/db-resources/pom.xml @@ -16,16 +16,12 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - -<project - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId> <artifactId>modules</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.1-SNAPSHOT</version> </parent> <artifactId>db-resources</artifactId> <name>Controller Blueprints DB Resources</name> @@ -44,4 +40,3 @@ </dependency> </dependencies> </project> - diff --git a/ms/controllerblueprints/modules/pom.xml b/ms/controllerblueprints/modules/pom.xml index 9a53eebf..3857ef5d 100644 --- a/ms/controllerblueprints/modules/pom.xml +++ b/ms/controllerblueprints/modules/pom.xml @@ -1,54 +1,49 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright © 2017-2018 AT&T Intellectual Property.
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId>
- <artifactId>parent</artifactId>
- <version>0.4.0-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
- </parent>
- <artifactId>modules</artifactId>
- <name>Controller Blueprints Modules</name>
- <packaging>pom</packaging>
-
- <modules>
- <module>service</module>
- <module>blueprint-validation</module>
- <module>db-resources</module>
- </modules>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <!-- <skip>${skip.compile}</skip>-->
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
-
+<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Copyright © 2017-2018 AT&T Intellectual Property. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId> + <artifactId>parent</artifactId> + <version>0.4.1-SNAPSHOT</version> + <relativePath>../parent</relativePath> + </parent> + <artifactId>modules</artifactId> + <name>Controller Blueprints Modules</name> + <packaging>pom</packaging> + + <modules> + <module>service</module> + <module>blueprint-validation</module> + <module>db-resources</module> + </modules> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <!-- <skip>${skip.compile}</skip>--> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/ms/controllerblueprints/modules/service/pom.xml b/ms/controllerblueprints/modules/service/pom.xml index 91a9eab1..9868b17b 100644 --- a/ms/controllerblueprints/modules/service/pom.xml +++ b/ms/controllerblueprints/modules/service/pom.xml @@ -16,16 +16,12 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - -<project - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId> <artifactId>modules</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.1-SNAPSHOT</version> </parent> <artifactId>service</artifactId> <name>Controller Blueprints Service</name> @@ -93,4 +89,3 @@ </dependency> </dependencies> </project> - diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java index 89af9e9a..3a1535ac 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java @@ -59,7 +59,7 @@ public class SchemaGeneratorService { */
public String generateSchema(String serviceTemplateContent) throws BluePrintException {
if (StringUtils.isNotBlank(serviceTemplateContent)) {
- ServiceTemplate serviceTemplate = JacksonUtils.readValue(serviceTemplateContent,
+ ServiceTemplate serviceTemplate = JacksonUtils.Companion.readValue(serviceTemplateContent,
ServiceTemplate.class);
return generateSchema(serviceTemplate);
} else {
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java index 23d3a977..074483a7 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java @@ -30,11 +30,11 @@ public class JpaJsonNodeConverter implements @Override
public String convertToDatabaseColumn(JsonNode node) {
- return JacksonUtils.getJson(node, true);
+ return JacksonUtils.Companion.getJson(node, true);
}
@Override
public JsonNode convertToEntityAttribute(String dbData) {
- return JacksonUtils.jsonNode(dbData);
+ return JacksonUtils.Companion.jsonNode(dbData);
}
}
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java index 18672f1c..e28cdcd5 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java @@ -29,11 +29,11 @@ public class JpaResourceDefinitionConverter implements AttributeConverter<ResourceDefinition, String> {
@Override
public String convertToDatabaseColumn(ResourceDefinition resourceDefinition) {
- return JacksonUtils.getJson(resourceDefinition);
+ return JacksonUtils.Companion.getJson(resourceDefinition);
}
@Override
public ResourceDefinition convertToEntityAttribute(String content) {
- return JacksonUtils.readValue(content, ResourceDefinition.class);
+ return JacksonUtils.Companion.readValue(content, ResourceDefinition.class);
}
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java index 6d02544e..5d15e087 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java @@ -58,7 +58,7 @@ public class ServiceTemplateValidator extends BluePrintValidatorDefaultService { public boolean validateServiceTemplate(String serviceTemplateContent) throws BluePrintException {
if (StringUtils.isNotBlank(serviceTemplateContent)) {
ServiceTemplate serviceTemplate =
- JacksonUtils.readValue(serviceTemplateContent, ServiceTemplate.class);
+ JacksonUtils.Companion.readValue(serviceTemplateContent, ServiceTemplate.class);
return validateServiceTemplate(serviceTemplate);
} else {
throw new BluePrintException(
@@ -131,11 +131,11 @@ public class ServiceTemplateValidator extends BluePrintValidatorDefaultService { Object mappingObject =
capabilityAssignment.getProperties().get(ConfigModelConstant.CAPABILITY_PROPERTY_MAPPING);
if (mappingObject != null) {
- String mappingContent = JacksonUtils.getJson(mappingObject);
+ String mappingContent = JacksonUtils.Companion.getJson(mappingObject);
Preconditions.checkArgument(StringUtils.isNotBlank(mappingContent),
String.format("Failed to get capability mapping property (%s) ", ConfigModelConstant.CAPABILITY_PROPERTY_MAPPING));
- resourceAssignment = JacksonUtils.getListFromJson(mappingContent, ResourceAssignment.class);
+ resourceAssignment = JacksonUtils.Companion.getListFromJson(mappingContent, ResourceAssignment.class);
Preconditions.checkNotNull(resourceAssignment,
String.format("Failed to get resource assignment info from the content (%s) ", mappingContent));
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java index 412e9606..42c6365a 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java @@ -56,12 +56,12 @@ public class ModelTypeServiceTest { public void test01SaveModelType() throws Exception { log.info("**************** test01SaveModelType ********************"); - String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json"); + String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json"); ModelType modelType = new ModelType(); modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE); modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT); modelType.setDescription("Definition for Sample Datatype "); - modelType.setDefinition(JacksonUtils.jsonNode(content)); + modelType.setDefinition(JacksonUtils.Companion.jsonNode(content)); modelType.setModelName(modelName); modelType.setVersion("1.0.0"); modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java index 7549b780..739ce51b 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java @@ -54,12 +54,12 @@ public class ModelTypeReactRepositoryTest { @Test @Commit public void test01Save() { - String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json"); + String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json"); ModelType modelType = new ModelType(); modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE); modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT); modelType.setDescription("Definition for Sample Datatype "); - modelType.setDefinition(JacksonUtils.jsonNode(content)); + modelType.setDefinition(JacksonUtils.Companion.jsonNode(content)); modelType.setModelName(modelName); modelType.setVersion("1.0.0"); modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java index 2a636831..330eaa84 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java @@ -55,7 +55,7 @@ public class ResourceDictionaryReactRepositoryTest { @Test @Commit public void test01Save() { - ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("./../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json", ResourceDefinition.class); + ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile("./../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-primary-db-source.json", ResourceDefinition.class); Assert.assertNotNull("Failed to get resourceDefinition from content", resourceDefinition); resourceDefinition.setName(sourceName); diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java index bf5db340..64c87e06 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java @@ -53,12 +53,12 @@ public class ModelTypeRestTest { public void test01SaveModelType() throws Exception {
log.info("**************** test01SaveModelType ********************");
- String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json");
+ String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json");
ModelType modelType = new ModelType();
modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE);
modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT);
modelType.setDescription("Definition for Sample Datatype ");
- modelType.setDefinition(JacksonUtils.jsonNode(content));
+ modelType.setDefinition(JacksonUtils.Companion.jsonNode(content));
modelType.setModelName(modelName);
modelType.setVersion("1.0.0");
modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + ","
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/application.properties b/ms/controllerblueprints/modules/service/src/test/resources/application.properties index 29bb2b90..24cb23a1 100755 --- a/ms/controllerblueprints/modules/service/src/test/resources/application.properties +++ b/ms/controllerblueprints/modules/service/src/test/resources/application.properties @@ -20,7 +20,7 @@ logging.level.org.springframework.web=INFO logging.level.org.hibernate.SQL=warn logging.level.org.hibernate.type.descriptor.sql=debug # Load Resource Source Mappings -resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability +resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=./target/blueprints/deploy controllerblueprints.blueprintArchivePath=./target/blueprints/archive diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-resource-assignment.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-resource-assignment.json index 3715beca..1c81b74d 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-resource-assignment.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-resource-assignment.json @@ -7,7 +7,7 @@ "required": true
},
"dictionary-name": "sample-db-source",
- "dictionary-source": "db",
+ "dictionary-source": "primary-db",
"dependencies": [
"input-source"
]
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json index b066dad6..42978f84 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json @@ -225,7 +225,7 @@ },
"input-param": false,
"dictionary-name": "sample-db-source",
- "dictionary-source": "db",
+ "dictionary-source": "primary-db",
"dependencies": [
"hostname"
],
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json index b13932b7..66f18f89 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json @@ -227,7 +227,7 @@ }, "input-param" : false, "dictionary-name" : "sample-db-source", - "dictionary-source" : "db", + "dictionary-source" : "primary-db", "dependencies" : [ "hostname" ], "version" : 0 }, { |