diff options
author | 2018-04-03 20:24:59 +0530 | |
---|---|---|
committer | 2018-04-04 13:54:59 +0530 | |
commit | d6982006c27288936d8b0d9eee18068854036f45 (patch) | |
tree | 7b71be074b5303d442971d0bd59b2accd7940604 /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp | |
parent | 4b6709601c47050c853e6eaa5525259f066d5277 (diff) |
Added new nodes type
Added new nodes type and new property in Port.
All test data need to be updated, so file count is much more.
Change-Id: Ic21befe8d7feee912fbed1d3eb676488db1fb68c
Issue-ID: SDC-1183
Signed-off-by: siddharth0905 <siddharth.singh4@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp')
5 files changed, 15 insertions, 58 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java index 83b83d3353..1a31b52331 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java @@ -944,43 +944,6 @@ public class UnifiedCompositionServiceTest { checkSTResults(expectedOutserviceTemplates, null, null, inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML)); } - @Ignore - public void testThreeNovaOfSameTypePreConditionFalse() throws IOException { - loadInputAndOutputData(BASE_DIRECTORY + "pattern1b/noConsolidation"); - - List<UnifiedCompositionData> unifiedCompositionDataList = new ArrayList<>(); - List<Pair<String, String>> portTypeToIdList1 = new ArrayList<>(); - portTypeToIdList1.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList1.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); - - UnifiedCompositionData unifiedCompositionData1 = - createCompositionData(FSB1_template, portTypeToIdList1); - addOutputGetAttrInForCompute1WithConsolidation(unifiedCompositionData1); - addOutputGetAttrInForPortWithConsolidation1(unifiedCompositionData1); - unifiedCompositionDataList.add(unifiedCompositionData1); - - UnifiedCompositionData unifiedCompositionData2 = - createCompositionData(FSB2_template, portTypeToIdList1); - addOutputGetAttrInForCompute1WithConsolidation(unifiedCompositionData2); - addOutputGetAttrInForPortWithConsolidation1(unifiedCompositionData2); - unifiedCompositionDataList.add(unifiedCompositionData2); - - portTypeToIdList1.remove(1); - UnifiedCompositionData unifiedCompositionData3 = - createCompositionData(FSB3_template, portTypeToIdList1); - addOutputGetAttrInForCompute1WithConsolidation(unifiedCompositionData3); - addOutputGetAttrInForPortWithConsolidation1(unifiedCompositionData3); - unifiedCompositionDataList.add(unifiedCompositionData3); - - UnifiedCompositionSingleSubstitution unifiedCompositionSingleSubstitution = - new UnifiedCompositionSingleSubstitution(); - unifiedCompositionSingleSubstitution - .createUnifiedComposition(inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), null, - unifiedCompositionDataList, context); - - checkSTResults(expectedOutserviceTemplates, null, null, inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML)); - } - @Test public void testUnifiedNestedCompositionOneComputeInNested() throws IOException { loadInputAndOutputData(BASE_DIRECTORY + "pattern4/oneNestedNode"); @@ -1007,7 +970,7 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData unifiedComposition = createUnifiedCompositionOnlyNested("server_pcm_001"); UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo( inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName), null, - context); + context, null); unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo, unifiedComposition); checkSTResults(expectedOutserviceTemplates, nestedFileName, @@ -1050,11 +1013,13 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData unifiedComposition = createUnifiedCompositionOnlyNested("server_pcm_001"); UnifiedCompositionTo unifiedCompositionTo1 = new UnifiedCompositionTo(inputServiceTemplates - .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName1), null, context); + .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName1), null, + context, null); unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo1, unifiedComposition); unifiedComposition = createUnifiedCompositionOnlyNested("server_oam_001"); UnifiedCompositionTo unifiedCompositionTo2 = new UnifiedCompositionTo(inputServiceTemplates - .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName2), null, context); + .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName2), null, + context, null); unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo2, unifiedComposition); checkSTResults(expectedOutserviceTemplates, nestedFileName1, diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnectionTest.java index 86e9afbbe0..c5f655afbb 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnectionTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnectionTest.java @@ -43,8 +43,6 @@ public class ContrailV2VmInterfaceToNetResourceConnectionTest extends BaseResour testTranslation(); } - //todo - remove the ignore once we will support VMI as sub port - @Ignore @Test public void testTranslateVlanToNetNestedConnection() throws Exception { inputFilesPath = "/mock/services/heattotosca/VlanToNetConnection/nested/inputfiles"; @@ -64,8 +62,6 @@ public class ContrailV2VmInterfaceToNetResourceConnectionTest extends BaseResour testTranslation(); } - //todo - remove the ignore once we will support VMI as sub port - @Ignore @Test public void testTranslateVlanToNetMultiNestedConnection() throws Exception { inputFilesPath = @@ -85,8 +81,6 @@ public class ContrailV2VmInterfaceToNetResourceConnectionTest extends BaseResour testTranslation(); } - //todo - remove the ignore once we will support VMI as sub port - @Ignore @Test public void testTranslateVlanToSharedNetNestedConnection() throws Exception { inputFilesPath = "/mock/services/heattotosca/VlanToNetConnection/shared/inputfiles"; @@ -115,8 +109,6 @@ public class ContrailV2VmInterfaceToNetResourceConnectionTest extends BaseResour testTranslation(); } - //todo - remove the ignore once we will support VMI as sub port - @Ignore @Test public void testTranslateVlanToNetSharedAddOnConnection() throws Exception { inputFilesPath = "/mock/services/heattotosca/VlanToNetConnection/sharedAddOn/inputfiles"; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/ComputeNewNodeTemplateIdGeneratorTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/ComputeNewNodeTemplateIdGeneratorTest.java index 5750de5172..361888f74e 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/ComputeNewNodeTemplateIdGeneratorTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/ComputeNewNodeTemplateIdGeneratorTest.java @@ -46,7 +46,7 @@ public class ComputeNewNodeTemplateIdGeneratorTest extends BaseResourceTranslati @Test public void testGenerateNewComputeNodeTemplateId() { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestComputeServiceTemplate(), null, null, - null); + null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, SERVER_PCM); if (nodeTemplateId.isPresent()) { @@ -60,7 +60,7 @@ public class ComputeNewNodeTemplateIdGeneratorTest extends BaseResourceTranslati public void testGenerateInvalidOriginalNodeTemplateId() { //node template with id is not present in the service template UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestComputeServiceTemplate(), null, null, - null); + null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, SERVER_PCM + "_invalid"); @@ -70,7 +70,7 @@ public class ComputeNewNodeTemplateIdGeneratorTest extends BaseResourceTranslati @Test public void testGenerateNullOriginalNodeTemplateId() { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestComputeServiceTemplate(), null, null, - null); + null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, null); Assert.assertEquals(nodeTemplateId.isPresent(), false); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java index 1986ecae4e..ad39bb7148 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java @@ -58,7 +58,7 @@ public class PortNewNodeTemplateIdGeneratorTest extends BaseResourceTranslationT @Test public void testGenerateNewPortNodeTemplateId() { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestPortServiceTemplate(), null, - getUnifiedCompositionDataListWithOnePort(), null); + getUnifiedCompositionDataListWithOnePort(), null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, PCM_PORT_0); if (nodeTemplateId.isPresent()) { @@ -71,7 +71,7 @@ public class PortNewNodeTemplateIdGeneratorTest extends BaseResourceTranslationT @Test public void testGeneratePortIdNotBoundToServer() { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestInitPortServiceTemplate(), null, - getInitUnifiedCompositionDataList(), null); + getInitUnifiedCompositionDataList(), null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, PCM_PORT_0); Assert.assertEquals(false, nodeTemplateId.isPresent()); @@ -81,7 +81,7 @@ public class PortNewNodeTemplateIdGeneratorTest extends BaseResourceTranslationT public void testGeneratePortIdMultiplePortsSameTypeToOneServer() { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestPortServiceTemplateWithTwoPortsOfSameType(), null, - getUnifiedCompositionDataListWithTwoPortsOfSameType(), null); + getUnifiedCompositionDataListWithTwoPortsOfSameType(), null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, PCM_PORT_0); if (nodeTemplateId.isPresent()) { @@ -101,7 +101,7 @@ public class PortNewNodeTemplateIdGeneratorTest extends BaseResourceTranslationT @Test public void testGenerateInvalidOriginalNodeTemplateId() { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestPortServiceTemplate(), null, - getUnifiedCompositionDataListWithOnePort(), null); + getUnifiedCompositionDataListWithOnePort(), null, null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, PCM_PORT_0 + "_Invalid"); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/SubInterfaceNewNodeTemplateIdGeneratorTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/SubInterfaceNewNodeTemplateIdGeneratorTest.java index 11b20fa0b1..63f12622f7 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/SubInterfaceNewNodeTemplateIdGeneratorTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/SubInterfaceNewNodeTemplateIdGeneratorTest.java @@ -60,7 +60,7 @@ public class SubInterfaceNewNodeTemplateIdGeneratorTest extends BaseResourceTran @Test public void testGenerateNewSubInterfaceNodeTemplateId() throws IOException { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestInitSubInterfaceServiceTemplate(), null, - getUnifiedCompositionDataListWithOnePortAndSubInterface(), getContext(false)); + getUnifiedCompositionDataListWithOnePortAndSubInterface(), getContext(false), null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, VDBE_UNTR_1_SUBPORTS); if (nodeTemplateId.isPresent()) { @@ -74,7 +74,7 @@ public class SubInterfaceNewNodeTemplateIdGeneratorTest extends BaseResourceTran public void testGeneratePortIdMultipleSubInterfacesOfSameTypeToOnePort() throws IOException { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestSubInterfaceServiceTemplateMultipleVlan(), null, - getUnifiedCompositionDataListWithTwoSubInterfacesOfSameType(), getContext(true)); + getUnifiedCompositionDataListWithTwoSubInterfacesOfSameType(), getContext(true), null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, VDBE_UNTR_1_SUBPORTS); if (nodeTemplateId.isPresent()) { @@ -94,7 +94,7 @@ public class SubInterfaceNewNodeTemplateIdGeneratorTest extends BaseResourceTran @Test public void testGenerateInvalidOriginalNodeTemplateId() throws IOException { UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo(getTestInitSubInterfaceServiceTemplate(), null, - getUnifiedCompositionDataListWithOnePortAndSubInterface(), getContext(false)); + getUnifiedCompositionDataListWithOnePortAndSubInterface(), getContext(false), null); Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, VDBE_UNTR_1_SUBPORTS + "_Invalid"); |