[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 / UnifiedCompositionScalingInstancesFullTest.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
8 import java.io.IOException;
9
10 public class UnifiedCompositionScalingInstancesFullTest 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 testComputesSameTypeWithOnePortEach() throws IOException {
20     //1. Scenario #1 - Compute type 1 – 2 nova, each one with 1 port
21     inputFilesPath =
22         "/mock/services/heattotosca/fulltest/scalingInstances/oneComputeTypeOnePort/in";
23     outputFilesPath =
24         "/mock/services/heattotosca/fulltest/scalingInstances/oneComputeTypeOnePort/out";
25
26     testTranslationWithInit();
27   }
28
29   @Test
30   public void testComputesTypesTwoComputesEachWithOnePort() throws IOException {
31     //2. Scenario #2 - 2 compute types, each type has 2 computes with one port per compute
32     inputFilesPath =
33         "/mock/services/heattotosca/fulltest/scalingInstances/twoComputeTypesOnePort/in";
34     outputFilesPath =
35         "/mock/services/heattotosca/fulltest/scalingInstances/twoComputeTypesOnePort/out";
36
37     testTranslationWithInit();
38   }
39
40   @Test
41   public void testComputesTypesTwoComputesEachWithOnePortWithGetAttr() throws IOException {
42     //3.        Scenario #2 + between the 2 nova which has diff types there is getAttr
43     inputFilesPath =
44         "/mock/services/heattotosca/fulltest/scalingInstances/twoComputeTypesOnePortWithGetAttr/in";
45     outputFilesPath =
46         "/mock/services/heattotosca/fulltest/scalingInstances/twoComputeTypesOnePortWithGetAttr/out";
47
48     testTranslationWithInit();
49   }
50
51   @Test
52   public void testComputesSameTypeWithOnePortOneGroupEach() throws IOException {
53     //4.        Scenario #1 + group – NovaServerGroup, connected to both nova
54     inputFilesPath =
55         "/mock/services/heattotosca/fulltest/scalingInstances/oneComputeTypeOnePortOneGroup/in";
56     outputFilesPath =
57         "/mock/services/heattotosca/fulltest/scalingInstances/oneComputeTypeOnePortOneGroup/out";
58
59     testTranslationWithInit();
60   }
61
62   @Test
63   public void testComputesSameTypeWithOnePortEachAndNodesConnectedIn() throws IOException {
64     //5.        Scenario #1 + node connected In – security Rule point to both port + “resource” with
65     // dependency (depends_on) to both computes
66     inputFilesPath =
67         "/mock/services/heattotosca/fulltest/scalingInstances" +
68             "/oneComputeTypeOnePortNodeConnectedIn/in";
69     outputFilesPath =
70         "/mock/services/heattotosca/fulltest/scalingInstances" +
71             "/oneComputeTypeOnePortNodeConnectedIn/out";
72
73     testTranslationWithInit();
74   }
75
76   @Test
77   public void testComputesSameTypeWithOnePortEachAndNodesConnectedOut() throws IOException {
78     //6.        Scenario#1  + node connected Out – both port connected to same network + each compute
79     // connected to same volume
80     inputFilesPath =
81         "/mock/services/heattotosca/fulltest/scalingInstances" +
82             "/oneComputeTypeOnePortNodeConnectedOut/in";
83     outputFilesPath =
84         "/mock/services/heattotosca/fulltest/scalingInstances" +
85             "/oneComputeTypeOnePortNodeConnectedOut/out";
86
87     testTranslationWithInit();
88   }
89
90   @Test
91   public void testComputesSameTypeWithOnePortEachAndGetAttrIn() throws IOException {
92     /*
93       7.        Scenario#1 + node get attr in – network which include
94         a.      Property with getAttr from Compute1
95         b.      Property with getAttr from Compute2
96         c.      Property with getAttr from port
97     */
98
99     inputFilesPath =
100         "/mock/services/heattotosca/fulltest/scalingInstances" +
101             "/oneComputeTypeOnePortGetAttrIn/in";
102     outputFilesPath =
103         "/mock/services/heattotosca/fulltest/scalingInstances" +
104             "/oneComputeTypeOnePortGetAttrIn/out";
105
106     testTranslationWithInit();
107   }
108
109   @Test
110   public void testComputesSameTypeWithOnePortEachAndGetAttrOut() throws IOException {
111     /*
112       8. Scenario#1 + node get attr out + network
113         a.      Compute1 with property1, that include getAttr from network
114         b.      Compute2 with property2, that include getAttr from network
115         c.      Port with property, that include getAttr from network
116     */
117
118     inputFilesPath =
119         "/mock/services/heattotosca/fulltest/scalingInstances" +
120             "/oneComputeTypeOnePortGetAttrOut/in";
121     outputFilesPath =
122         "/mock/services/heattotosca/fulltest/scalingInstances" +
123             "/oneComputeTypeOnePortGetAttrOut/out";
124
125     testTranslationWithInit();
126   }
127
128
129   @Test
130   public void testComputesSameTypeWithOnePortEachAndOutputParamGetAttrIn() throws IOException {
131     /*
132       9.        Scenario#1 + output parameter get attr in –  3 output parameters
133         a.      Output param with getAttr from Compute1
134         b.      Output param with getAttr from Compute2
135         c.      Output param with getAttr from Port
136     */
137
138     inputFilesPath =
139         "/mock/services/heattotosca/fulltest/scalingInstances" +
140             "/oneComputeTypeOnePortOutputParamGetAttrIn/in";
141     outputFilesPath =
142         "/mock/services/heattotosca/fulltest/scalingInstances" +
143             "/oneComputeTypeOnePortOutputParamGetAttrIn/out";
144
145     testTranslationWithInit();
146   }
147
148   @Test
149   public void testComputesSameTypeWithOnePortEachAndGetAttrOutBetweenConsolidationEntities() throws
150       IOException {
151     /*
152       10. Scenario#1 + node get attr out
153         a.      Compute1 with property1, that include getAttr from port1
154         b.      Compute2 with property2, that include getAttr from port2
155         c.      Port1 with property, that include getAttr from compute1
156         d.      Port2 with property, that include getAttr from compute2
157     */
158
159     inputFilesPath =
160         "/mock/services/heattotosca/fulltest/scalingInstances" +
161             "/oneComputeTypeOnePortGetAttrOutComputePort/in";
162     outputFilesPath =
163         "/mock/services/heattotosca/fulltest/scalingInstances" +
164             "/oneComputeTypeOnePortGetAttrOutComputePort/out";
165
166     testTranslationWithInit();
167   }
168
169 }