From 937b70dab7c0555b03ae5f3beea81da37e9f9dd5 Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Thu, 20 Sep 2018 17:46:07 -0700 Subject: Update OofHoming w/ directives Issue-ID: SO-746 Change-Id: I597f7621a32eeb5b8e92cf80700c60bccdc5e560 Signed-off-by: Marcus G K Williams --- .../java/org/onap/so/bpmn/common/OofHomingIT.java | 134 +++++++++++++++++++-- .../org/onap/so/bpmn/common/OofHomingTestIT.java | 134 +++++++++++++++++++-- 2 files changed, 254 insertions(+), 14 deletions(-) (limited to 'bpmn/mso-infrastructure-bpmn') diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java index 9bcc5593e2..d2dbde4843 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java @@ -38,7 +38,6 @@ import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.core.domain.AllottedResource; -import org.onap.so.bpmn.core.domain.CloudFlavor; import org.onap.so.bpmn.core.domain.HomingSolution; import org.onap.so.bpmn.core.domain.ModelInfo; import org.onap.so.bpmn.core.domain.NetworkResource; @@ -122,12 +121,133 @@ public class OofHomingIT extends BaseIntegrationTest { VnfResource vnf = new VnfResource(); vnf.setResourceId("testResourceIdVNF"); vnf.setNfFunction("testVnfFunctionName"); - ArrayList flavors = new ArrayList<>(); - CloudFlavor flavor1 = new CloudFlavor("flavorLabel1xxx", "vimFlavorxxx"); - CloudFlavor flavor2 = new CloudFlavor("flavorLabel2xxx", "vimFlavorxxx"); - flavors.add(flavor1); - flavors.add(flavor2); - vnf.getHomingSolution().setFlavors(flavors); + vnf.getHomingSolution().setOofDirectives( + "{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"vnfc_directives\":[ \n" + + " { \n" + + " \"vnfc_id\":\"\",\n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"vnf_directives\":{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"sdnc_directives\":{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"vnfc_directives\":[ \n" + + " { \n" + + " \"vnfc_id\":\"\",\n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"vnf_directives\":{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " ]\n" + + " }"); ModelInfo vnfModel = new ModelInfo(); vnfModel.setModelCustomizationUuid("testModelCustomizationUuidVNF"); vnfModel.setModelInvariantUuid("testModelInvariantIdVNF"); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java index 33e444310f..748552623e 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java @@ -26,7 +26,6 @@ import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.core.domain.AllottedResource; -import org.onap.so.bpmn.core.domain.CloudFlavor; import org.onap.so.bpmn.core.domain.HomingSolution; import org.onap.so.bpmn.core.domain.ModelInfo; import org.onap.so.bpmn.core.domain.NetworkResource; @@ -126,12 +125,133 @@ public class OofHomingTestIT extends BaseIntegrationTest { VnfResource vnf = new VnfResource(); vnf.setResourceId("testResourceIdVNF"); vnf.setResourceInstanceName("testVnfInstanceName"); - ArrayList flavors = new ArrayList<>(); - CloudFlavor flavor1 = new CloudFlavor("flavorLabel1xxx", "vimFlavorxxx"); - CloudFlavor flavor2 = new CloudFlavor("flavorLabel2xxx", "vimFlavorxxx"); - flavors.add(flavor1); - flavors.add(flavor2); - vnf.getHomingSolution().setFlavors(flavors); + vnf.getHomingSolution().setOofDirectives( + "{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"vnfc_directives\":[ \n" + + " { \n" + + " \"vnfc_id\":\"\",\n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"vnf_directives\":{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"sdnc_directives\":{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"vnfc_directives\":[ \n" + + " { \n" + + " \"vnfc_id\":\"\",\n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"vnf_directives\":{ \n" + + " \"directives\":[ \n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " { \n" + + " \"directive_name\":\"\",\n" + + " \"attributes\":[ \n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " },\n" + + " { \n" + + " \"attribute_name\":\"\",\n" + + " \"attribute_value\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " ]\n" + + " }"); ModelInfo vnfModel = new ModelInfo(); vnfModel.setModelCustomizationUuid("testModelCustomizationUuidVNF"); vnfModel.setModelInvariantUuid("testModelInvariantIdVNF"); -- cgit 1.2.3-korg