diff options
author | Pavel Aharoni <pa0916@att.com> | 2017-07-17 16:26:48 +0300 |
---|---|---|
committer | Pavel Aharoni <pa0916@att.com> | 2017-07-17 16:27:08 +0300 |
commit | 9f2d31d8cb8c4e28c3b1bea809867d39df36e502 (patch) | |
tree | 3bd56754012ad9b54bde3e7f51c62d2d7ecff41b /src/test/java | |
parent | f118ea26bcea3a3d9af27faa7d54e895a0202dcf (diff) |
[SDC-136] support CVFC type
Change-Id: I36af758d5bff633972245d7100a8c892a47527fb
Signed-off-by: Pavel Aharoni <pa0916@att.com>
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 + } |