[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 / fulltest / UnifiedCompositionNestedSingleComputeFullTest.java
1 package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest;
2
3 import org.junit.Before;
4 import org.junit.Ignore;
5 import org.junit.Test;
6 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
7
8 import java.io.IOException;
9
10 public class UnifiedCompositionNestedSingleComputeFullTest extends BaseFullTranslationTest {
11
12     @Override
13     @Before
14     public void setUp() throws IOException {
15         // do not delete this function. it prevents the superclass setup from running
16     }
17
18     @Test
19     public void testNestedWithOneCompute() throws IOException {
20         inputFilesPath =
21             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithOneCompute/in";
22         outputFilesPath =
23             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithOneCompute/out";
24
25         testTranslationWithInit();
26     }
27
28     @Test
29     public void testNestedWithOneComputeSamePortType() throws IOException {
30         inputFilesPath =
31             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithOneComputeDiffPortType/in";
32         outputFilesPath =
33             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithOneComputeDiffPortType/out";
34
35         testTranslationWithInit();
36     }
37
38     @Test
39     public void testOneNestedWithTwoComputesOfSameType() throws IOException {
40         //Not pattern 4 (Complex VFC)
41         inputFilesPath =
42             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoComputesOfSameType/in";
43         outputFilesPath =
44             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoComputesOfSameType/out";
45
46         testTranslationWithInit();
47     }
48
49     @Test
50     public void testOneNestedWithTwoDiffComputeTypes() throws IOException {
51         //Not pattern 4 (Complex VFC)
52         inputFilesPath =
53             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoDiffComputeTypes/in";
54         outputFilesPath =
55             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoDiffComputeTypes/out";
56
57         testTranslationWithInit();
58     }
59
60     @Test
61     public void testTwoNestedNodeTemplatesOfSameType() throws IOException {
62         inputFilesPath =
63             "/mock/services/heattotosca/fulltest/nestedSingleCompute/twoNestedNodeTemplatesWithSameComputeType/in";
64         outputFilesPath =
65             "/mock/services/heattotosca/fulltest/nestedSingleCompute/twoNestedNodeTemplatesWithSameComputeType/out";
66
67         testTranslationWithInit();
68     }
69
70     @Test
71     public void testTwoDiffNestedFilesWithSameComputeType() throws IOException {
72         inputFilesPath =
73             "/mock/services/heattotosca/fulltest/nestedSingleCompute/diffNestedFilesWithSameComputeType/in";
74         outputFilesPath =
75             "/mock/services/heattotosca/fulltest/nestedSingleCompute/diffNestedFilesWithSameComputeType/out";
76
77         testTranslationWithInit();
78     }
79
80     @Test
81     public void testNestedCompositionNodesConnectedIn() throws IOException {
82        /*
83         Nested Composition + node connected In
84          a. Dependency between a nested compute and a non-nested compute resource
85          b. Dependency between a nested compute and another nested resource (same type)
86          c. Dependency between a nested compute and another nested resource (different type)
87          d. Dependency between a non-consolidation entity resource and a nested compute resource
88          e. Dependency between a non-consolidation entity resource and a non-nested compute resource
89          f. Security Rule to Port nested connection
90          g. Security Rule to Port nested shared connection
91          */
92         inputFilesPath =
93             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesConnectedIn/in";
94         outputFilesPath =
95             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesConnectedIn/out";
96
97         testTranslationWithInit();
98     }
99
100     @Test
101     public void testNestedCompositionNodesGetAttrIn() throws IOException {
102        /*
103         Nested composition with Get attribute in -
104           a. Get attribute in a non-nested compute from a nested compute resource
105           b. Get attribute in a non-nested compute from another consolidation entity resource
106           c. Get attribute in a nested compute from another nested compute resource of same type
107           d. Get attribute in a nested compute from another nested compute resource of different type
108           e. Get attribute in a nested compute from a regular consolidation entity resource
109           f. Get attribute in a non-consolidation entity resource from a nested compute resource
110           g. Get attribute in a non-consolidation entity resource from a non-nested compute resource
111          */
112         inputFilesPath =
113             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesGetAttrIn/in";
114         outputFilesPath =
115             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesGetAttrIn/out";
116
117         testTranslationWithInit();
118     }
119
120     @Test
121     public void testNestedCompositionOutputParamGetAttrIn() throws IOException {
122        /*
123         Nested Composition + Output Param get attribute In
124           a. From a nested resource
125           b. From another nested resource of same type (represented by same nested file)
126           c. From a nested resource of different type (represented by different nested file)
127           d. From a non-nested consolidation entity resource
128           e. From a regular non-consolidation entity resource
129          */
130         inputFilesPath =
131             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedOutputParamGetAttrIn/in";
132         outputFilesPath =
133             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedOutputParamGetAttrIn/out";
134
135         testTranslationWithInit();
136     }
137
138     @Test
139     public void testMultiLevelNestedComposition() throws IOException {
140         //Not pattern 4 (Multi level Complex VFC)
141         inputFilesPath =
142             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedMultiLevels/in";
143         outputFilesPath =
144             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedMultiLevels/out";
145
146         testTranslationWithInit();
147     }
148
149     @Test
150     public void testThreeNestedSameTypeTwoPointingToSameNestedFile() throws IOException {
151         inputFilesPath =
152             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedSameTypeTwoPointingOnSameNestedFile/in";
153         outputFilesPath =
154             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedSameTypeTwoPointingOnSameNestedFile/out";
155
156         testTranslationWithInit();
157     }
158
159     @Test
160     public void testThreeNestedSameTypePointingToDiffFiles() throws IOException {
161         inputFilesPath =
162             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedPointingToThreeDiffNestedFilesSameComputeType/in";
163         outputFilesPath =
164             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedPointingToThreeDiffNestedFilesSameComputeType/out";
165
166         testTranslationWithInit();
167     }
168
169     @Test
170     public void testMultipleReferencesToSameNestedFilesWithSameComputeType() throws IOException {
171         inputFilesPath =
172             "/mock/services/heattotosca/fulltest/nestedSingleCompute/multipleReferencesToSameNestedFilesWithSameComputeType/in";
173         outputFilesPath =
174             "/mock/services/heattotosca/fulltest/nestedSingleCompute/multipleReferencesToSameNestedFilesWithSameComputeType/out";
175
176         testTranslationWithInit();
177     }
178 }