diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java | 2 | ||||
-rw-r--r-- | src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java | 60 |
2 files changed, 58 insertions, 4 deletions
diff --git a/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java b/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java index 3af654e..471fbc0 100644 --- a/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java +++ b/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java @@ -27,6 +27,7 @@ public abstract class SdcToscaParserBasicTest { static ISdcCsarHelper complexCps; static ISdcCsarHelper fdntCsarHelperWithInputs; static ISdcCsarHelper nfodCsarHlper; + static ISdcCsarHelper nestedVfcCsarHlper; static Map<String, HashMap<String, List<String>>> fdntCsarHelper_Data; @BeforeClass @@ -39,6 +40,7 @@ public abstract class SdcToscaParserBasicTest { complexCps = getCsarHelper("csars/service-consolidated-props-csar.csar"); fdntCsarHelperWithInputs = getCsarHelper("csars/service-ServiceFdnt-with-get-input.csar"); nfodCsarHlper = getCsarHelper("csars/service-NfodService-csar.csar"); + nestedVfcCsarHlper = getCsarHelper("csars/service-nested-vfc-csar.csar"); fdntCsarHelper_Data = new HashMap<String, HashMap<String, List<String>>>(){ { HashMap<String, List<String>> FDNT ; diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java index 8470cbd..d8e065b 100644 --- a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java +++ b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java @@ -520,9 +520,7 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest { } //endregion - - - + //region getVnfConfig @Test public void testGetVnfConfig() { NodeTemplate vnfConfig = nfodCsarHlper.getVnfConfig("9bb2ef82-f8f6-4391-bc71-db063f15bf57"); @@ -554,5 +552,59 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest { assertNotNull(vfcList); assertEquals(2, vfcList.size()); } - + //endregion + + //region nested vfc + @Test + public void testNestedVfcByExistCvfc() { + List<NodeTemplate> vfcList = nestedVfcCsarHlper.getVfcListByVf("71389f8b-8671-4a43-a991-59fb621d3615"); + assertNotNull(vfcList); + assertEquals(1, vfcList.size()); + assertEquals("VF_VNF", vfcList.get(0).getName()); + } + + @Test + public void testNestedVfcByNullVf() { + List<NodeTemplate> vfcList = nestedVfcCsarHlper.getVfcListByVf(null); + assertNotNull(vfcList); + assertEquals(0, vfcList.size()); + } + + @Test + public void testNestedVfcByDummyVf() { + List<NodeTemplate> vfcList = nestedVfcCsarHlper.getVfcListByVf("dummy"); + assertNotNull(vfcList); + assertEquals(0, vfcList.size()); + } + //endregion + + //region hasTopology + @Test + public void testHasTopologyByVF() { + List<NodeTemplate> vfList = nestedVfcCsarHlper.getServiceVfList(); + boolean hasTopology = nestedVfcCsarHlper.hasTopology(vfList.get(0)); + assertEquals(true, hasTopology); + } + + @Test + public void testHasTopologyByCVFC() { + List<NodeTemplate> vfcList = nestedVfcCsarHlper.getVfcListByVf("71389f8b-8671-4a43-a991-59fb621d3615"); + boolean hasTopology = nestedVfcCsarHlper.hasTopology(vfcList.get(0)); + assertEquals(true, hasTopology); + } + + @Test + public void testHasTopologyByVL() { + List<NodeTemplate> serviceVlList = fdntCsarHelper.getServiceVlList(); + boolean hasTopology = fdntCsarHelper.hasTopology(serviceVlList.get(0)); + assertEquals(false, hasTopology); + } + + @Test + public void testHasTopologyByNull() { + boolean hasTopology = fdntCsarHelper.hasTopology(null); + assertEquals(false, hasTopology); + } + //endregion + } |