a6876fa00f3dd94fb2da8df6b668584dc2cc43f3
[sdc.git] /
1 /*
2  * Copyright © 2016-2017 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
18
19 import org.junit.AfterClass;
20 import org.junit.Before;
21 import org.junit.BeforeClass;
22 import org.junit.Test;
23 import org.openecomp.sdc.common.togglz.ToggleableFeature;
24 import org.togglz.testing.TestFeatureManager;
25 import org.togglz.testing.TestFeatureManagerProvider;
26
27 import java.io.IOException;
28
29 public class ContrailV2VlanToInterfaceResourceConnectionTest extends BaseResourceTranslationTest {
30
31   @Override
32   @Before
33   public void setUp() throws IOException {
34     // do not delete this function. it prevents the superclass setup from running
35   }
36
37   @BeforeClass
38   public static void enableVLANTagging() {
39     manager = new TestFeatureManager(ToggleableFeature.class);
40     manager.enable(ToggleableFeature.VLAN_TAGGING);
41     TestFeatureManagerProvider.setFeatureManager(manager);
42   }
43
44   @Test
45   public void testTranslateVlanToInterfaceNestedConnection() throws Exception {
46     inputFilesPath =
47         "/mock/services/heattotosca/subInterfaceToInterfaceConnection/nested/inputfiles";
48     outputFilesPath =
49         "/mock/services/heattotosca/subInterfaceToInterfaceConnection/nested/expectedoutputfiles";
50     initTranslatorAndTranslate();
51     testTranslation();
52   }
53
54   @Test
55   public void testTranslateVlanToNetMultiNestedConnection() throws Exception {
56     inputFilesPath =
57         "/mock/services/heattotosca/subInterfaceToInterfaceConnection/nestedMultiLevels/inputfiles";
58     outputFilesPath =
59         "/mock/services/heattotosca/subInterfaceToInterfaceConnection/nestedMultiLevels" +
60             "/expectedoutputfiles";
61     initTranslatorAndTranslate();
62     testTranslation();
63   }
64
65   @AfterClass
66   public static void disableVLANTagging() {
67     manager.disable(ToggleableFeature.VLAN_TAGGING);
68     manager = null;
69     TestFeatureManagerProvider.setFeatureManager(null);
70   }
71 }