2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest;
23 import org.junit.Test;
24 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
26 import java.io.IOException;
28 public class UnifiedCompositionScalingInstancesFullTest extends BaseFullTranslationTest {
30 private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/scalingInstances/";
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");
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");
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");
51 public void testComputesSameTypeWithOnePortOneGroupEach() throws IOException {
52 //4. Scenario #1 + group – NovaServerGroup, connected to both nova
53 testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortOneGroup");
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");
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");
71 public void testComputesSameTypeWithOnePortEachAndGetAttrIn() throws IOException {
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
78 testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortGetAttrIn");
82 public void testComputesSameTypeWithOnePortEachAndGetAttrOut() throws IOException {
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
89 testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortGetAttrOut");
94 public void testComputesSameTypeWithOnePortEachAndOutputParamGetAttrIn() throws IOException {
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
101 testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortOutputParamGetAttrIn");
105 public void testComputesSameTypeWithOnePortEachAndGetAttrOutBetweenConsolidationEntities() throws
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
114 testTranslationWithInit(BASE_DIRECTORY + "oneComputeTypeOnePortGetAttrOutComputePort");