From 9f2d31d8cb8c4e28c3b1bea809867d39df36e502 Mon Sep 17 00:00:00 2001 From: Pavel Aharoni Date: Mon, 17 Jul 2017 16:26:48 +0300 Subject: [SDC-136] support CVFC type Change-Id: I36af758d5bff633972245d7100a8c892a47527fb Signed-off-by: Pavel Aharoni --- .../sdc/impl/SdcToscaParserBasicTest.java | 2 + .../sdc/impl/ToscaParserNodeTemplateTest.java | 60 ++++++++++++++++++++-- 2 files changed, 58 insertions(+), 4 deletions(-) (limited to 'src/test/java') 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>> 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>>(){ { HashMap> 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 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 vfcList = nestedVfcCsarHlper.getVfcListByVf(null); + assertNotNull(vfcList); + assertEquals(0, vfcList.size()); + } + + @Test + public void testNestedVfcByDummyVf() { + List vfcList = nestedVfcCsarHlper.getVfcListByVf("dummy"); + assertNotNull(vfcList); + assertEquals(0, vfcList.size()); + } + //endregion + + //region hasTopology + @Test + public void testHasTopologyByVF() { + List vfList = nestedVfcCsarHlper.getServiceVfList(); + boolean hasTopology = nestedVfcCsarHlper.hasTopology(vfList.get(0)); + assertEquals(true, hasTopology); + } + + @Test + public void testHasTopologyByCVFC() { + List vfcList = nestedVfcCsarHlper.getVfcListByVf("71389f8b-8671-4a43-a991-59fb621d3615"); + boolean hasTopology = nestedVfcCsarHlper.hasTopology(vfcList.get(0)); + assertEquals(true, hasTopology); + } + + @Test + public void testHasTopologyByVL() { + List 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 + } -- cgit 1.2.3-korg