From 2064106f298ac9683821e83acbfd87dac8b5b32f Mon Sep 17 00:00:00 2001 From: siddharth0905 Date: Mon, 5 Mar 2018 15:00:10 +0530 Subject: Code Change & Junit for verifying Pattern4 Simplified the code as per the review comment Change-Id: I4614cf25d743afb54d686934f9faa2a26edf0c89 Issue-ID: SDC-1074 Signed-off-by: siddharth0905 --- .../UnifiedCompositionSubInterfaceFullTest.java | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org') 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 4b22e66f6b..860df69927 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 @@ -29,6 +29,8 @@ public class UnifiedCompositionSubInterfaceFullTest extends BaseFullTranslationT "/mock/services/heattotosca/fulltest/subinterface/vlantagging/pattern1b/"; private static final String PATTERN_1C1_BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/subinterface/vlantagging/pattern1c1/"; + private static final String PATTERN_4_BASE_DIRECTORY = + "/mock/services/heattotosca/fulltest/subinterface/vlantagging/pattern4/"; @Test public void testSubInterfaceComputePortNetwork() throws IOException { @@ -243,4 +245,89 @@ public class UnifiedCompositionSubInterfaceFullTest extends BaseFullTranslationT */ testTranslationWithInit(PATTERN_1C1_BASE_DIRECTORY + "allConnectivities"); } + + //Pattern 4 Test Cases + @Test + public void testSubInterfaceComputePortNetworkPattern4() throws IOException { + /** + * 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"); + } + + @Test + public void testSubInterfaceMultiplePortsMultipleVlansPattern4() throws IOException { + /** + * Nested Heat file with one compute, two ports and two subinterface resource groups with + * 1. Port connected to network + * 2. Sub-interfaces each with different nested files + */ + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "multiplePortsMultipleVlans"); + } + + @Test + public void testSubInterfaceMultipleVlanDiffFilePattern4() throws IOException { + /** + * Nested Heat file with one compute, one port and two subinterface resource groups with + * 1. Port connected to network + * 2. Sub-interfaces with different nested files + */ + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "multipleVlanDiffFile"); + } + + @Test + public void testSubInterfaceMultipleVlanSameFilePattern4() throws IOException { + /** + * Nested Heat file with one compute, one port and two subinterface resource groups with + * 1. Port connected to network + * 2. Sub-interfaces with same nested files + */ + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "multipleVlanSameFile"); + } + + @Test + public void testSubInterfaceRegularNestedPattern4() throws IOException { + /** + * Nested Heat file with one compute, one port and one subinterface resource represented + * through a regular nested resource and not using a resource group + */ + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "regularNestedSubInterface"); + } + + @Test + public void testSubInterfaceGetAttrInOutPattern4() 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 different network + * 3. Sub-interface has get attribute (in) connectivity from network resource + * 4. Sub-interface has get attribute (out) connectivity to second network resource + * 5. Sub-interface has get attribute (in) connectivity from output param + */ + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "subInterfaceGetAttrInOut"); + } + + @Test + public void testSubInterfaceNodesConnectedInPattern4() 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 different network + * 3. Sub-interface has depends on (in) connectivity from network resource + */ + testTranslationWithInit(PATTERN_4_BASE_DIRECTORY + "subInterfaceNodesConnectedIn"); + } + + @Test + public void testSubInterfaceNodesConnectedOutPattern4() 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(PATTERN_4_BASE_DIRECTORY + "subInterfaceNodesConnectedOut"); + } } -- cgit 1.2.3-korg