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