[SDC-29] Amdocs OnBoard 1707 initial commit.
[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 testOneNestedWithTwoComputesOfSameType() throws IOException {
29         inputFilesPath =
30             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoComputesOfSameType/in";
31         outputFilesPath =
32             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoComputesOfSameType/out";
33
34         testTranslationWithInit();
35     }
36
37     @Test
38     public void testOneNestedWithTwoDiffComputeTypes() throws IOException {
39         inputFilesPath =
40             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoDiffComputeTypes/in";
41         outputFilesPath =
42             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedWithTwoDiffComputeTypes/out";
43
44         testTranslationWithInit();
45     }
46
47     @Test
48     public void testTwoNestedNodeTemplatesOfSameType() throws IOException {
49         inputFilesPath =
50             "/mock/services/heattotosca/fulltest/nestedSingleCompute/twoNestedNodeTemplatesWithSameComputeType/in";
51         outputFilesPath =
52             "/mock/services/heattotosca/fulltest/nestedSingleCompute/twoNestedNodeTemplatesWithSameComputeType/out";
53
54         testTranslationWithInit();
55     }
56
57     @Test
58     public void testTwoDiffNestedFilesWithSameComputeType() throws IOException {
59         inputFilesPath =
60             "/mock/services/heattotosca/fulltest/nestedSingleCompute/diffNestedFilesWithSameComputeType/in";
61         outputFilesPath =
62             "/mock/services/heattotosca/fulltest/nestedSingleCompute/diffNestedFilesWithSameComputeType/out";
63
64         testTranslationWithInit();
65     }
66
67     @Test
68     public void testNestedCompositionNodesConnectedIn() throws IOException {
69        /*
70         Nested Composition + node connected In
71          a. Dependency between a nested compute and a non-nested compute resource
72          b. Dependency between a nested compute and another nested resource (same type)
73          c. Dependency between a nested compute and another nested resource (different type)
74          d. Dependency between a non-consolidation entity resource and a nested compute resource
75          e. Dependency between a non-consolidation entity resource and a non-nested compute resource
76          f. Security Rule to Port nested connection
77          g. Security Rule to Port nested shared connection
78          */
79         inputFilesPath =
80             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesConnectedIn/in";
81         outputFilesPath =
82             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesConnectedIn/out";
83
84         testTranslationWithInit();
85     }
86
87     @Test
88     public void testNestedCompositionNodesGetAttrIn() throws IOException {
89        /*
90         Nested composition with Get attribute in -
91           a. Get attribute in a non-nested compute from a nested compute resource
92           b. Get attribute in a non-nested compute from another consolidation entity resource
93           c. Get attribute in a nested compute from another nested compute resource of same type
94           d. Get attribute in a nested compute from another nested compute resource of different type
95           e. Get attribute in a nested compute from a regular consolidation entity resource
96           f. Get attribute in a non-consolidation entity resource from a nested compute resource
97           g. Get attribute in a non-consolidation entity resource from a non-nested compute resource
98          */
99         inputFilesPath =
100             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesGetAttrIn/in";
101         outputFilesPath =
102             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedNodesGetAttrIn/out";
103
104         testTranslationWithInit();
105     }
106
107     @Test
108     public void testNestedCompositionOutputParamGetAttrIn() throws IOException {
109        /*
110         Nested Composition + Output Param get attribute In
111           a. From a nested resource
112           b. From another nested resource of same type (represented by same nested file)
113           c. From a nested resource of different type (represented by different nested file)
114           d. From a non-nested consolidation entity resource
115           e. From a regular non-consolidation entity resource
116          */
117         inputFilesPath =
118             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedOutputParamGetAttrIn/in";
119         outputFilesPath =
120             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedOutputParamGetAttrIn/out";
121
122         testTranslationWithInit();
123     }
124
125     @Test
126     public void testMultiLevelNestedComposition() throws IOException {
127         inputFilesPath =
128             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedMultiLevels/in";
129         outputFilesPath =
130             "/mock/services/heattotosca/fulltest/nestedSingleCompute/nestedMultiLevels/out";
131
132         testTranslationWithInit();
133     }
134
135     @Test
136     public void testThreeNestedSameTypeTwoPointintToSameNestedFile() throws IOException {
137         inputFilesPath =
138             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedSameTypeTwoPointingOnSameNestedFile/in";
139         outputFilesPath =
140             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedSameTypeTwoPointingOnSameNestedFile/out";
141
142         testTranslationWithInit();
143     }
144
145     @Test
146     public void testThreeNestedSameTypePointingToDiffFiles() throws IOException {
147         inputFilesPath =
148             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedPointingToThreeDiffNestedFilesSameComputeType/in";
149         outputFilesPath =
150             "/mock/services/heattotosca/fulltest/nestedSingleCompute/threeNestedPointingToThreeDiffNestedFilesSameComputeType/out";
151
152         testTranslationWithInit();
153     }
154 }