aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/mso-infrastructure-bpmn
diff options
context:
space:
mode:
authorMarcus G K Williams <marcus.williams@intel.com>2018-09-20 17:46:07 -0700
committerMarcus G K Williams <marcus.williams@intel.com>2018-09-20 17:47:41 -0700
commit937b70dab7c0555b03ae5f3beea81da37e9f9dd5 (patch)
tree68bac0247c1d60fe8328e1cd2c2f07c6dc95c837 /bpmn/mso-infrastructure-bpmn
parentbddf97be0012847c858ec0122eb53c291de8b45f (diff)
Update OofHoming w/ directives
Issue-ID: SO-746 Change-Id: I597f7621a32eeb5b8e92cf80700c60bccdc5e560 Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn')
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java134
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java134
2 files changed, 254 insertions, 14 deletions
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<CloudFlavor> 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\":\"<ID of VNFC>\",\n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example flavor_directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as flavor label>\",\n" +
+ " \"attribute_value\":\"<value such as cloud specific flavor>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example vnic-info>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as vnic-type>\",\n" +
+ " \"attribute_value\":\"<value such as direct/normal>\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as provider netweork>\",\n" +
+ " \"attribute_value\":\"<value such as physnet>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"vnf_directives\":{ \n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " \"sdnc_directives\":{ \n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"vnfc_directives\":[ \n" +
+ " { \n" +
+ " \"vnfc_id\":\"<ID of VNFC>\",\n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example flavor_directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as flavor label>\",\n" +
+ " \"attribute_value\":\"<value such as cloud specific flavor>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example vnic-info>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as vnic-type>\",\n" +
+ " \"attribute_value\":\"<value such as direct/normal>\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as provider netweork>\",\n" +
+ " \"attribute_value\":\"<value such as physnet>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"vnf_directives\":{ \n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<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<CloudFlavor> 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\":\"<ID of VNFC>\",\n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example flavor_directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as flavor label>\",\n" +
+ " \"attribute_value\":\"<value such as cloud specific flavor>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example vnic-info>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as vnic-type>\",\n" +
+ " \"attribute_value\":\"<value such as direct/normal>\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as provider netweork>\",\n" +
+ " \"attribute_value\":\"<value such as physnet>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"vnf_directives\":{ \n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " \"sdnc_directives\":{ \n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"vnfc_directives\":[ \n" +
+ " { \n" +
+ " \"vnfc_id\":\"<ID of VNFC>\",\n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example flavor_directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as flavor label>\",\n" +
+ " \"attribute_value\":\"<value such as cloud specific flavor>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive,example vnic-info>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as vnic-type>\",\n" +
+ " \"attribute_value\":\"<value such as direct/normal>\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute, such as provider netweork>\",\n" +
+ " \"attribute_value\":\"<value such as physnet>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"vnf_directives\":{ \n" +
+ " \"directives\":[ \n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value>\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " { \n" +
+ " \"directive_name\":\"<Name of directive>\",\n" +
+ " \"attributes\":[ \n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " },\n" +
+ " { \n" +
+ " \"attribute_name\":\"<name of attribute>\",\n" +
+ " \"attribute_value\":\"<value >\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " }\n" +
+ " ]\n" +
+ " }");
ModelInfo vnfModel = new ModelInfo();
vnfModel.setModelCustomizationUuid("testModelCustomizationUuidVNF");
vnfModel.setModelInvariantUuid("testModelInvariantIdVNF");