summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java2
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java22
-rw-r--r--src/test/resources/csars/service-NetworkCloudVnfServiceMock-csar.csarbin0 -> 61275 bytes
3 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java b/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java
index edcf3ca..d1eed3e 100644
--- a/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java
+++ b/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java
@@ -45,6 +45,7 @@ public abstract class SdcToscaParserBasicTest {
static ISdcCsarHelper csarHelperVfInterfaces;
static ISdcCsarHelper csarHelperServiceAnnotations;
static ISdcCsarHelper csarHelperServiceAdiodAnnotations;
+ static ISdcCsarHelper csarHelperServiceNetworkCloud;
static Map<String, HashMap<String, List<String>>> fdntCsarHelper_Data;
@@ -77,6 +78,7 @@ public abstract class SdcToscaParserBasicTest {
csarHelperServiceAnnotations = getCsarHelper("csars/resource-Sirovinputannotation-csar.csar");
csarHelperVfInterfaces = getCsarHelper("csars/service-CxSvc-csar.csar");
csarHelperServiceAdiodAnnotations = getCsarHelper("csars/service-AdiodVmxVpeBvService-csar.csar");
+ csarHelperServiceNetworkCloud = getCsarHelper("csars/service-NetworkCloudVnfServiceMock-csar.csar");
fdntCsarHelper_Data = new HashMap<String, HashMap<String, List<String>>>(){
{
diff --git a/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java
index db7e5ae..7b268c6 100644
--- a/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java
@@ -1,6 +1,7 @@
package org.onap.sdc.impl;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
@@ -785,6 +786,27 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest {
}
@Test
+ public void testResolveGetInputForListOnNetworkCloud() {
+ final String related_network_role = "related_network_role";
+ List<NodeTemplate> serviceVfList = csarHelperServiceNetworkCloud.getServiceVfList();
+ assertNotNull(serviceVfList);
+ assertFalse(serviceVfList.isEmpty());
+ List<NodeTemplate> vfcListByVf = csarHelperServiceNetworkCloud.getVfcListByVf(csarHelperServiceNetworkCloud.getNodeTemplateCustomizationUuid(serviceVfList.get(0)));
+ assertNotNull(vfcListByVf);
+ assertFalse(vfcListByVf.isEmpty());
+ List<NodeTemplate> cpList = csarHelperServiceNetworkCloud.getNodeTemplateChildren(vfcListByVf.get(0));
+ assertNotNull(cpList);
+ assertFalse(cpList.isEmpty());
+ final Object propertyValue = cpList.get(0).getPropertyValue("related_networks");
+ assertNotNull(propertyValue);
+ ArrayList<Map<String, String>> relatedNetworkList = (ArrayList)propertyValue;
+ assertEquals(3, relatedNetworkList.size());
+ assertEquals("cor_direct_2", relatedNetworkList.get(0).get(related_network_role));
+ assertEquals("sgi_direct_2", relatedNetworkList.get(1).get(related_network_role));
+ assertEquals("int_imbl_2", relatedNetworkList.get(2).get(related_network_role));
+ }
+
+ @Test
public void testResolveGetInputForPrimitiveTypeString() {
//This test covers "default" resolving of primitive - as Object
List<NodeTemplate> vfcs = resolveGetInputCsar.getVfcListByVf("b5190df2-7880-4d6f-836f-56ab17e1b85b");
diff --git a/src/test/resources/csars/service-NetworkCloudVnfServiceMock-csar.csar b/src/test/resources/csars/service-NetworkCloudVnfServiceMock-csar.csar
new file mode 100644
index 0000000..84d90d8
--- /dev/null
+++ b/src/test/resources/csars/service-NetworkCloudVnfServiceMock-csar.csar
Binary files differ