diff options
author | 2018-02-11 12:15:48 +0200 | |
---|---|---|
committer | 2018-02-11 12:16:01 +0200 | |
commit | d5b4901c6a1ae136138c1300d377447e26bac4ef (patch) | |
tree | e25360262affbacfdf1bcaeb1e8976e6d8ebae58 /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org | |
parent | eae2ba3f5ccfb20a899262562bd91129b6d53423 (diff) |
SRIOV - add annotations
SRIOV - add annotations to input TOSCA parameter converted from HEAT file (2)
Change-Id: Id0b0156730ae64093df42d09e2873de047c13ac9
Issue-ID: SDC-996
Signed-off-by: eleonorali <eleonoral@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org')
6 files changed, 71 insertions, 60 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java index 5f2c3691c2..248c0c4378 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java @@ -1,37 +1,64 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2017 European Support Limited + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END========================================================= */ package org.openecomp.sdc.translator.impl.heattotosca.parameters; +import org.junit.Before; import org.junit.Test; import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseResourceTranslationTest; +import java.io.IOException; + public class HeatParameterConversionTest extends BaseResourceTranslationTest { - { - inputFilesPath = "/mock/heat/parameters/inputs"; - outputFilesPath = "/mock/heat/parameters/expectedoutputfiles"; + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running } @Test public void testTranslate() throws Exception { + inputFilesPath = "/mock/heat/parameters/single/inputs"; + outputFilesPath = "/mock/heat/parameters/single/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateAllBaseMultipleHeat() throws Exception { + inputFilesPath = "/mock/heat/parameters/allHeatsAreBase/inputs"; + outputFilesPath = "/mock/heat/parameters/allHeatsAreBase/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateMultipleHeatWithNested() throws Exception { + inputFilesPath = "/mock/heat/parameters/multipleHeatWithNested/inputs"; + outputFilesPath = "/mock/heat/parameters/multipleHeatWithNested/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateNestedWithAssociatedHeat() throws Exception { + inputFilesPath = "/mock/heat/parameters/nestedWithAssociatedHeat/inputs"; + outputFilesPath = "/mock/heat/parameters/nestedWithAssociatedHeat/expectedoutputfiles"; + initTranslatorAndTranslate(); testTranslation(); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplatesTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplatesTest.java index d97128eea3..32315d1b33 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplatesTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplatesTest.java @@ -42,7 +42,7 @@ public class GlobalTypesServiceTemplatesTest { Map<String, ServiceTemplate> globalTypesServiceTemplates =
getGlobalTypesServiceTemplates(OnboardingTypesEnum.CSAR);
Assert.assertNotNull(globalTypesServiceTemplates);
- Assert.assertEquals(globalTypesServiceTemplates.size(), 24);
+ Assert.assertEquals(globalTypesServiceTemplates.size(), 25);
Set<String> globalTypeFolders = globalTypesServiceTemplates.keySet();
List<String> onapGlobalTypes = globalTypeFolders.stream()
.filter(resourceKey -> resourceKey.contains("onap"))
@@ -56,7 +56,7 @@ public class GlobalTypesServiceTemplatesTest { Map<String, ServiceTemplate> globalTypesServiceTemplates =
getGlobalTypesServiceTemplates(OnboardingTypesEnum.ZIP);
Assert.assertNotNull(globalTypesServiceTemplates);
- Assert.assertEquals(globalTypesServiceTemplates.size(), 19);
+ Assert.assertEquals(globalTypesServiceTemplates.size(), 20);
Set<String> globalTypeFolders = globalTypesServiceTemplates.keySet();
List<String> onapGlobalTypes = globalTypeFolders.stream()
.filter(resourceKey -> resourceKey.contains("onap"))
@@ -69,7 +69,7 @@ public class GlobalTypesServiceTemplatesTest { Map<String, ServiceTemplate> globalTypesServiceTemplates =
getGlobalTypesServiceTemplates(OnboardingTypesEnum.MANUAL);
Assert.assertNotNull(globalTypesServiceTemplates);
- Assert.assertEquals(globalTypesServiceTemplates.size(), 19);
+ Assert.assertEquals(globalTypesServiceTemplates.size(), 20);
Set<String> globalTypeFolders = globalTypesServiceTemplates.keySet();
List<String> onapGlobalTypes = globalTypeFolders.stream()
.filter(resourceKey -> resourceKey.contains("onap"))
@@ -82,7 +82,7 @@ public class GlobalTypesServiceTemplatesTest { Map<String, ServiceTemplate> globalTypesServiceTemplates =
getGlobalTypesServiceTemplates(OnboardingTypesEnum.NONE);
Assert.assertNotNull(globalTypesServiceTemplates);
- Assert.assertEquals(globalTypesServiceTemplates.size(), 19);
+ Assert.assertEquals(globalTypesServiceTemplates.size(), 20);
Set<String> globalTypeFolders = globalTypesServiceTemplates.keySet();
List<String> onapGlobalTypes = globalTypeFolders.stream()
.filter(resourceKey -> resourceKey.contains("onap"))
@@ -90,4 +90,4 @@ public class GlobalTypesServiceTemplatesTest { Assert.assertEquals(onapGlobalTypes.size(), 0);
}
-}
\ No newline at end of file +}
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/BaseFullTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java index f5e1ebbe76..8126d2967c 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java @@ -1,9 +1,6 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2017 European Support Limited + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +12,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END========================================================= */ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; @@ -66,17 +62,25 @@ public class BaseFullTranslationTest { protected static TestFeatureManager manager; @BeforeClass - public static void enableForwarderFeature(){ + public static void enableToggleableFeatures(){ manager = new TestFeatureManager(ToggleableFeature.class); if (!ToggleableFeature.FORWARDER_CAPABILITY.isActive()) { manager.enable(ToggleableFeature.FORWARDER_CAPABILITY); } + if (!ToggleableFeature.ANNOTATIONS.isActive()) { + manager.enable(ToggleableFeature.ANNOTATIONS); + } + if(!ToggleableFeature.VLAN_TAGGING.isActive()) { + manager.enable(ToggleableFeature.VLAN_TAGGING); + } } @AfterClass - public static void disableForwarderFeature() { + public static void disableToggleableFeatures() { manager.disable(ToggleableFeature.FORWARDER_CAPABILITY); + manager.disable(ToggleableFeature.ANNOTATIONS); + manager.disable(ToggleableFeature.VLAN_TAGGING); manager = null; TestFeatureManagerProvider.setFeatureManager(null); } 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/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java index 2ef72acd8e..4dc1612893 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java @@ -8,7 +8,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on a "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -96,20 +96,26 @@ public class BaseResourceTranslationTest { protected static TestFeatureManager manager; @BeforeClass - public static void enableForwarderFeature(){ + public static void enableToggleableFeatures(){ manager = new TestFeatureManager(ToggleableFeature.class); if (!ToggleableFeature.FORWARDER_CAPABILITY.isActive()) { manager.enable(ToggleableFeature.FORWARDER_CAPABILITY); } - } + if(!ToggleableFeature.ANNOTATIONS.isActive()) { + manager.enable(ToggleableFeature.ANNOTATIONS); + } + if(!ToggleableFeature.VLAN_TAGGING.isActive()){ + manager.enable(ToggleableFeature.VLAN_TAGGING); + } + } @AfterClass - public static void disableForwarderFeature() { - if (manager != null) { - manager.disable(ToggleableFeature.FORWARDER_CAPABILITY); - manager = null; - } + public static void disableToggleableFeatures() { + manager.disable(ToggleableFeature.FORWARDER_CAPABILITY); + manager.disable(ToggleableFeature.ANNOTATIONS); + manager.disable(ToggleableFeature.VLAN_TAGGING); + manager = null; TestFeatureManagerProvider.setFeatureManager(null); } 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/ContrailV2VlanToInterfaceResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnectionTest.java index a6876fa00f..5d73a300e8 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnectionTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnectionTest.java @@ -34,13 +34,6 @@ public class ContrailV2VlanToInterfaceResourceConnectionTest extends BaseResourc // do not delete this function. it prevents the superclass setup from running } - @BeforeClass - public static void enableVLANTagging() { - manager = new TestFeatureManager(ToggleableFeature.class); - manager.enable(ToggleableFeature.VLAN_TAGGING); - TestFeatureManagerProvider.setFeatureManager(manager); - } - @Test public void testTranslateVlanToInterfaceNestedConnection() throws Exception { inputFilesPath = @@ -62,10 +55,4 @@ public class ContrailV2VlanToInterfaceResourceConnectionTest extends BaseResourc testTranslation(); } - @AfterClass - public static void disableVLANTagging() { - manager.disable(ToggleableFeature.VLAN_TAGGING); - manager = null; - TestFeatureManagerProvider.setFeatureManager(null); - } } 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/ResourceTranslationContrailV2VlanSubInterfaceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImplTest.java index 0776692e03..2af3f85c5d 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImplTest.java @@ -38,12 +38,6 @@ public class ResourceTranslationContrailV2VlanSubInterfaceImplTest extends // do not delete this function. it prevents the superclass setup from running } - @BeforeClass - public static void enableVLANTagging() { - manager.enable(ToggleableFeature.VLAN_TAGGING); - TestFeatureManagerProvider.setFeatureManager(manager); - } - @Test public void testTranslateVlanSubInterfaceWithGetResource() throws Exception { inputFilesPath = "/mock/services/heattotosca/contrailv2Vlan/oneInterface/inputfiles"; @@ -60,11 +54,4 @@ public class ResourceTranslationContrailV2VlanSubInterfaceImplTest extends initTranslatorAndTranslate(); testTranslation(); } - - @AfterClass - public static void disableVLANTagging() { - manager.disable(ToggleableFeature.VLAN_TAGGING); - manager = null; - TestFeatureManagerProvider.setFeatureManager(null); - } } |