aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src/test
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-30 14:17:06 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-30 14:17:06 +0000
commite0bf80ea0f864a4da8bc2d9bf6e5b19bde75af41 (patch)
treef737c89033488ace40d95d1552ba266eb4d3a9c2 /ms/controllerblueprints/modules/service/src/test
parent2a7cd18ca4aaf6d050fe8740bcde53e9a214d224 (diff)
Controller Blueprints Microservice
Add Resource Seuencing validation and Optimise resource assignment validation logics Change-Id: I6f31ca5dbeb6f6aa89959b7d96fbfad25468b3a4 Issue-ID: CCSDK-416 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/test')
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java19
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json5
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json2
3 files changed, 19 insertions, 7 deletions
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java
index 0ef54452..e41e90a2 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java
@@ -20,6 +20,8 @@ package org.onap.ccsdk.apps.controllerblueprints.service.validator;
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Test;
+import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;
import org.onap.ccsdk.apps.controllerblueprints.service.utils.ConfigModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,9 +42,22 @@ public class ServiceTemplateValidationTest {
@Test
public void validateServiceTemplate() throws Exception {
- String file = "load/blueprints/baseconfiguration/Definitions/activation-blueprint.json";
+ validateServiceTemplate("load/blueprints/baseconfiguration/Definitions/activation-blueprint.json");
+ validateServiceTemplate("load/blueprints/vrr-test/Definitions/vrr-test.json");
+ }
+
+ //@Test
+ public void validateEnhancedServiceTemplate() throws Exception {
+ ServiceTemplate serviceTemplate = JacksonUtils
+ .readValueFromClassPathFile("enhance/enhanced-template.json", ServiceTemplate.class);
+ ServiceTemplateValidator serviceTemplateValidator = new ServiceTemplateValidator();
+ Boolean valid = serviceTemplateValidator.validateServiceTemplate(serviceTemplate);
+ Assert.assertTrue("Failed to validate blueprints", valid);
+ }
+
+ private void validateServiceTemplate(String fileName) throws Exception {
String serviceTemplateContent =
- FileUtils.readFileToString(new File(file), Charset.defaultCharset());
+ FileUtils.readFileToString(new File(fileName), Charset.defaultCharset());
ServiceTemplateValidator serviceTemplateValidator = new ServiceTemplateValidator();
serviceTemplateValidator.validateServiceTemplate(serviceTemplateContent);
Assert.assertNotNull("Failed to validate blueprints", serviceTemplateValidator);
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 a4ba930e..fedf1da2 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
@@ -232,10 +232,7 @@
"dictionary-name": "wan-aggregate-ipv4-addresses",
"dictionary-source": "mdsal",
"dependencies": [
- "service-instance-id",
- "oam-network-role",
- "oam-v4-ip-type ",
- "oam-vm-type"
+ "service-instance-id"
],
"version": 0
},
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 e0033096..0633c64d 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
@@ -738,7 +738,7 @@
"input-param" : false,
"dictionary-name" : "wan-aggregate-ipv4-addresses",
"dictionary-source" : "mdsal",
- "dependencies" : [ "service-instance-id", "oam-network-role", "oam-v4-ip-type ", "oam-vm-type" ],
+ "dependencies" : [ "service-instance-id" ],
"version" : 0
}, {
"name" : "hostname",