diff options
author | 2018-03-27 15:01:07 +0530 | |
---|---|---|
committer | 2018-03-27 10:53:03 +0000 | |
commit | 4345677a2732d0a713300180d83f529a1adc63ff (patch) | |
tree | ed431dc9262d8d8ecc7ff0885fd343498e5aefc8 /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org | |
parent | 4a065a54483b0d64e2bb2b54c82f167e28d4dcf8 (diff) |
VLAN tagging - Pattern 4 VFC Instance Group
1. Create VFC instance group per sub-interface
network role for pattern 4 heats
2. Added tests and updated existing test data
Change-Id: Id4f84c5a7dac3adfddde1192947ecaa5502f21df
Issue-ID: SDC-1073
Signed-off-by: ojasdubey <ojas.dubey@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org')
2 files changed, 32 insertions, 16 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 e239805710..83b83d3353 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 @@ -16,6 +16,10 @@ package org.openecomp.sdc.translator.services.heattotosca; +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.anyString; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.junit.Before; @@ -35,6 +39,7 @@ import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedCompositionData; import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedCompositionEntity; import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedSubstitutionData; +import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.to.UnifiedCompositionTo; import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ComputeTemplateConsolidationData; import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ConsolidationData; import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.EntityConsolidationData; @@ -56,10 +61,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; - public class UnifiedCompositionServiceTest { private static final String BASE_DIRECTORY = "/mock/services/heattotosca/unifiedComposition/"; @InjectMocks @@ -1003,9 +1004,11 @@ public class UnifiedCompositionServiceTest { context.getTranslatedServiceTemplates() .put(MAIN_SERVICE_TEMPLATE_YAML, inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML)); - UnifiedCompositionData unifiedComposition = createUnifiedCompositionOnlyNested("server_pcm_001"); - unifiedCompositionService.handleUnifiedNestedDefinition(inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), - inputServiceTemplates.get(nestedFileName), unifiedComposition, context); + UnifiedCompositionData unifiedComposition = createUnifiedCompositionOnlyNested("server_pcm_001"); + UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo( + inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName), null, + context); + unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo, unifiedComposition); checkSTResults(expectedOutserviceTemplates, nestedFileName, context.getTranslatedServiceTemplates().get(nestedFileName), @@ -1044,13 +1047,15 @@ public class UnifiedCompositionServiceTest { context.getTranslatedServiceTemplates() .put(MAIN_SERVICE_TEMPLATE_YAML, inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML)); - UnifiedCompositionData unifiedComposition = - createUnifiedCompositionOnlyNested("server_pcm_001"); - unifiedCompositionService.handleUnifiedNestedDefinition(inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), - inputServiceTemplates.get(nestedFileName1), unifiedComposition, context); - unifiedComposition = createUnifiedCompositionOnlyNested("server_oam_001"); - unifiedCompositionService.handleUnifiedNestedDefinition(inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), - inputServiceTemplates.get(nestedFileName2), unifiedComposition, context); + UnifiedCompositionData unifiedComposition = + createUnifiedCompositionOnlyNested("server_pcm_001"); + UnifiedCompositionTo unifiedCompositionTo1 = new UnifiedCompositionTo(inputServiceTemplates + .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName1), null, context); + unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo1, unifiedComposition); + unifiedComposition = createUnifiedCompositionOnlyNested("server_oam_001"); + UnifiedCompositionTo unifiedCompositionTo2 = new UnifiedCompositionTo(inputServiceTemplates + .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName2), null, context); + unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo2, unifiedComposition); checkSTResults(expectedOutserviceTemplates, nestedFileName1, context.getTranslatedServiceTemplates().get(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/fulltest/UnifiedCompositionSubInterfaceFullTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionSubInterfaceFullTest.java index ca31c85307..89d7cab6a7 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionSubInterfaceFullTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionSubInterfaceFullTest.java @@ -350,8 +350,7 @@ public class UnifiedCompositionSubInterfaceFullTest extends BaseFullTranslationT * Nested Heat file with one compute, one port and one subinterface resource group with only * port connected to network */ - testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + - "computePortNetworkSubInterface"); + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "computePortNetworkSubInterface"); } @Test @@ -428,6 +427,7 @@ public class UnifiedCompositionSubInterfaceFullTest extends BaseFullTranslationT testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "subInterfaceNodesConnectedOut"); } + //****************** VFC Instance Group Tests *************************** @Test @@ -444,4 +444,15 @@ public class UnifiedCompositionSubInterfaceFullTest extends BaseFullTranslationT public void testGroupingTwoSubInterfaceTypeAndTwoAbstractNodes() throws IOException { testTranslationWithInit(VFC_INSTANCE_GROUP_BASE_DIRECTORY + "twoSubInterfaceNetworkRoleAndTwoAbstractNodes"); } + + @Test + public void testSubInterfacePattern4WithGroup() throws IOException { + /* + * Nested Heat file with one compute, one port and one subinterface resource group with + * 1. Port connected to network + * 2. Sub-interface connected to same network + * 3. Sub-interface has depends on (out) connectivity with network resource + */ + testTranslationWithInit(VFC_INSTANCE_GROUP_BASE_DIRECTORY + "pattern4SubInterfaceNodesConnectedOut"); + } } |