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