Added oparent to sdc main
[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 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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.fulltest;
22
23 import org.junit.Test;
24 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
25
26 import java.io.IOException;
27
28 public class UnifiedCompositionScalingInstancesFullTest extends BaseFullTranslationTest {
29
30   private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/scalingInstances/";
31
32   @Test
33   public void testComputesSameTypeWithOnePortEach() throws IOException {
34     //1. Scenario #1 - Compute type 1 – 2 nova, each one with 1 port
35     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePort");
36   }
37
38   @Test
39   public void testComputesTypesTwoComputesEachWithOnePort() throws IOException {
40     //2. Scenario #2 - 2 compute types, each type has 2 computes with one port per compute
41     testTranslationWithInit(BASE_DIRECTORY + "twoComputeTypesOnePort");
42   }
43
44   @Test
45   public void testComputesTypesTwoComputesEachWithOnePortWithGetAttr() throws IOException {
46     //3.        Scenario #2 + between the 2 nova which has diff types there is getAttr
47     testTranslationWithInit(BASE_DIRECTORY + "twoComputeTypesOnePortWithGetAttr");
48   }
49
50   @Test
51   public void testComputesSameTypeWithOnePortOneGroupEach() throws IOException {
52     //4.        Scenario #1 + group – NovaServerGroup, connected to both nova
53     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortOneGroup");
54   }
55
56   @Test
57   public void testComputesSameTypeWithOnePortEachAndNodesConnectedIn() throws IOException {
58     //5.        Scenario #1 + node connected In – security Rule point to both port + “resource” with
59     // dependency (depends_on) to both computes
60     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortNodeConnectedIn");
61   }
62
63   @Test
64   public void testComputesSameTypeWithOnePortEachAndNodesConnectedOut() throws IOException {
65     //6.        Scenario#1  + node connected Out – both port connected to same network + each compute
66     // connected to same volume
67     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortNodeConnectedOut");
68   }
69
70   @Test
71   public void testComputesSameTypeWithOnePortEachAndGetAttrIn() throws IOException {
72     /*
73       7.        Scenario#1 + node get attr in – network which include
74         a.      Property with getAttr from Compute1
75         b.      Property with getAttr from Compute2
76         c.      Property with getAttr from port
77     */
78    testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortGetAttrIn");
79   }
80
81   @Test
82   public void testComputesSameTypeWithOnePortEachAndGetAttrOut() throws IOException {
83     /*
84       8. Scenario#1 + node get attr out + network
85         a.      Compute1 with property1, that include getAttr from network
86         b.      Compute2 with property2, that include getAttr from network
87         c.      Port with property, that include getAttr from network
88     */
89     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortGetAttrOut");
90   }
91
92
93   @Test
94   public void testComputesSameTypeWithOnePortEachAndOutputParamGetAttrIn() throws IOException {
95     /*
96       9.        Scenario#1 + output parameter get attr in –  3 output parameters
97         a.      Output param with getAttr from Compute1
98         b.      Output param with getAttr from Compute2
99         c.      Output param with getAttr from Port
100     */
101     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortOutputParamGetAttrIn");
102   }
103
104   @Test
105   public void testComputesSameTypeWithOnePortEachAndGetAttrOutBetweenConsolidationEntities() throws
106       IOException {
107     /*
108       10. Scenario#1 + node get attr out
109         a.      Compute1 with property1, that include getAttr from port1
110         b.      Compute2 with property2, that include getAttr from port2
111         c.      Port1 with property, that include getAttr from compute1
112         d.      Port2 with property, that include getAttr from compute2
113     */
114     testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortGetAttrOutComputePort");
115   }
116
117 }