[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / java / org / openecomp / sdc / translator / services / heattotosca / impl / resourcetranslation / NovaToVolResourceConnectionTest.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 NovaToVolResourceConnectionTest 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 testNovaToVolumeConnectionSharedAddOnConnection() throws Exception {
38     inputFilesPath = "/mock/services/heattotosca/novatovolumeconnection/sharedAddOn/inputfiles";
39     outputFilesPath =
40             "/mock/services/heattotosca/novatovolumeconnection/sharedAddOn/expectedoutputfiles";
41     initTranslatorAndTranslate();
42     testTranslation();
43   }
44
45   @Test
46   public void testNovaToVolumeConnectionMultiNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume()
47       throws Exception {
48     inputFilesPath =
49         "/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles";
50     outputFilesPath =
51         "/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles";
52     initTranslatorAndTranslate();
53     testTranslation();
54   }
55
56   @Test
57   public void testNovaToVolumeConnectionNestedNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume()
58       throws Exception {
59     inputFilesPath =
60         "/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles";
61     outputFilesPath =
62         "/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles";
63     initTranslatorAndTranslate();
64     testTranslation();
65     validateNodeTemplateIdInNestedConsolidationData();
66   }
67
68   @Test
69   public void testTranslateNovaToVolumeNestedConnection() throws Exception {
70     inputFilesPath =
71         "/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles";
72     outputFilesPath =
73         "/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles";
74     initTranslatorAndTranslate();
75     testTranslation();
76     validateNodeTemplateIdInNestedConsolidationData();
77   }
78
79   @Test
80   public void testTranslateNovaToVolumeSharedNestedConnection() throws Exception {
81     inputFilesPath =
82         "/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles";
83     outputFilesPath =
84         "/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles";
85     initTranslatorAndTranslate();
86     testTranslation();
87     validateNodeTemplateIdInNestedConsolidationData();
88   }
89
90   @Test
91   public void testTranslateNovaToVolumeSharedNestedNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume()
92       throws Exception {
93     inputFilesPath =
94         "/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles";
95     outputFilesPath =
96         "/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles";
97     initTranslatorAndTranslate();
98     testTranslation();
99     validateNodeTemplateIdInNestedConsolidationData();
100   }
101
102   @Test
103   public void testTranslateNovaToVolumeInnerNestedConnection() throws Exception {
104     inputFilesPath =
105         "/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles";
106     outputFilesPath =
107         "/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles";
108     initTranslatorAndTranslate();
109     testTranslation();
110     validateNodeTemplateIdInNestedConsolidationData();
111   }
112
113   @Test
114   public void testTranslateNovaToVolumeNestedMultiLevelConnection() throws Exception {
115     inputFilesPath =
116         "/mock/services/heattotosca/novatovolumeconnection/nestedMultiLevels/inputfiles";
117     outputFilesPath =
118         "/mock/services/heattotosca/novatovolumeconnection/nestedMultiLevels/expectedoutputfiles";
119     initTranslatorAndTranslate();
120     testTranslation();
121     validateNodeTemplateIdInNestedConsolidationData();
122   }
123
124   @Test
125   public void testTranslateNovaToVolumeSharedNestedMultiLevelConnection() throws Exception {
126     inputFilesPath =
127         "/mock/services/heattotosca/novatovolumeconnection/sharedNestedMultiLevels/inputfiles";
128     outputFilesPath =
129         "/mock/services/heattotosca/novatovolumeconnection/sharedNestedMultiLevels/expectedoutputfiles";
130     initTranslatorAndTranslate();
131     testTranslation();
132     validateNodeTemplateIdInNestedConsolidationData();
133   }
134
135   @Test
136   public void testTranslateNovaToVolumeInnerHeatVolumeNestedMultiLevelConnection()
137       throws Exception {
138     inputFilesPath =
139         "/mock/services/heattotosca/novatovolumeconnection/innerHeatVolNestedMultiLevel/inputfiles";
140     outputFilesPath =
141         "/mock/services/heattotosca/novatovolumeconnection/innerHeatVolNestedMultiLevel/expectedoutputfiles";
142     initTranslatorAndTranslate();
143     testTranslation();
144     validateNodeTemplateIdInNestedConsolidationData();
145   }
146
147
148 }