summaryrefslogtreecommitdiffstats
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
commit905d8bf666e0667774bebccfabce65e3497e9c32 (patch)
treef9140a5b81ed876ead24759902ca7422eade2603 /ms/controllerblueprints/modules/service/src/test
parent254217ffff5edea9069f96b992a5939b3745d376 (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 0ef544525..e41e90a2d 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 a4ba930e5..fedf1da21 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 e00330961..0633c64d0 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",