re base code
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / java / org / openecomp / sdc / translator / services / heattotosca / impl / resourcetranslation / ContrailV2VmInterfaceToNetResourceConnectionTest.java
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.Before;
24 import org.junit.Test;
25
26 import java.io.IOException;
27
28
29 public class ContrailV2VmInterfaceToNetResourceConnectionTest extends BaseResourceTranslationTest {
30   @Override
31   @Before
32   public void setUp() throws IOException {
33     // do not delete this function. it prevents the superclass setup from running
34   }
35
36   @Test
37   public void testTranslateVMIToNetNestedConnection() throws Exception {
38     inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles";
39     outputFilesPath =
40         "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles";
41     initTranslatorAndTranslate();
42     testTranslation();
43   }
44
45   @Test
46   public void testTranslateVlanToNetNestedConnection() throws Exception {
47     inputFilesPath = "/mock/services/heattotosca/VlanToNetConnection/nested/inputfiles";
48     outputFilesPath =
49         "/mock/services/heattotosca/VlanToNetConnection/nested/expectedoutputfiles";
50     initTranslatorAndTranslate();
51     testTranslation();
52   }
53
54   @Test
55   public void testTranslateVMIToNetMultiNestedConnection() throws Exception {
56     inputFilesPath =
57         "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nestedMultiLevels/inputfiles";
58     outputFilesPath =
59         "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nestedMultiLevels/expectedoutputfiles";
60     initTranslatorAndTranslate();
61     testTranslation();
62   }
63
64   @Test
65   public void testTranslateVlanToNetMultiNestedConnection() throws Exception {
66     inputFilesPath =
67         "/mock/services/heattotosca/VlanToNetConnection/nestedMultiLevels/inputfiles";
68     outputFilesPath =
69         "/mock/services/heattotosca/VlanToNetConnection/nestedMultiLevels/expectedoutputfiles";
70     initTranslatorAndTranslate();
71     testTranslation();
72   }
73
74   @Test
75   public void testTranslateVMIToSharedNetNestedConnection() throws Exception {
76     inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles";
77     outputFilesPath =
78         "/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles";
79     initTranslatorAndTranslate();
80     testTranslation();
81   }
82
83   @Test
84   public void testTranslateVlanToSharedNetNestedConnection() throws Exception {
85     inputFilesPath = "/mock/services/heattotosca/VlanToNetConnection/shared/inputfiles";
86     outputFilesPath =
87         "/mock/services/heattotosca/VlanToNetConnection/shared/expectedoutputfiles";
88     initTranslatorAndTranslate();
89     testTranslation();
90   }
91
92   @Test
93   public void testTranslateVMIToNetSharedMultiNestedConnection() throws Exception {
94     inputFilesPath =
95         "/mock/services/heattotosca/VMInterfaceToNettworkConnection/sharedNestedMultiLevels/inputfiles";
96     outputFilesPath =
97         "/mock/services/heattotosca/VMInterfaceToNettworkConnection/sharedNestedMultiLevels/expectedoutputfiles";
98     initTranslatorAndTranslate();
99     testTranslation();
100   }
101
102   @Test
103   public void testTranslateVMIToNetSharedAddOnConnection() throws Exception {
104     inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/sharedAddOn/inputfiles";
105     outputFilesPath =
106             "/mock/services/heattotosca/VMInterfaceToNettworkConnection/sharedAddOn/expectedoutputfiles";
107     initTranslatorAndTranslate();
108     testTranslation();
109   }
110
111   @Test
112   public void testTranslateVlanToNetSharedAddOnConnection() throws Exception {
113     inputFilesPath = "/mock/services/heattotosca/VlanToNetConnection/sharedAddOn/inputfiles";
114     outputFilesPath =
115         "/mock/services/heattotosca/VlanToNetConnection/sharedAddOn/expectedoutputfiles";
116     initTranslatorAndTranslate();
117     testTranslation();
118   }
119
120   @Test
121   public void testTranslateVMIToNetArrayParameterConnection() throws Exception {
122     inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nestedArrayParam/inputfiles";
123     outputFilesPath =
124             "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nestedArrayParam/expectedoutputfiles";
125     initTranslatorAndTranslate();
126     testTranslation();
127   }
128
129 }