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 UnifiedCompositionNestedPatternsFullTest extends BaseFullTranslationTest {
30 private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/nestedOtherScenarios/";
33 public void testNestedWithOneLevelMultipleComputesSingleSubstitution() throws IOException {
34 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedSingleSubstitution1B");
38 public void testNestedWithOneLevelMultipleComputesScalingInstance() throws IOException {
39 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedScalingInstance");
43 public void testNestedWithOneLevelMultipleComputesCatalogInstance() throws IOException {
44 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedCatalogInstance");
48 public void testNestedWithOneLevelAllNonNestedPatterns() throws IOException {
49 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedAllNonNestedPatterns");
53 public void testNestedWithOneLevelNoCompute() throws IOException {
54 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedNoCompute");
58 public void testNestedWithOneLevelOtherPatternsNoComputeWithConnectivity() throws IOException {
59 //One nested resource with no Compute, one nested resource having all non nested patterns
60 // with connectivity between themo
61 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedAllPatternsConnectivity");
65 public void testNestedWithOneLevelTwoSameFileOneOtherAllPattern1B() throws IOException {
66 // Heat file with 3 nested resources, while 2 point to the same nested heat file, and all
67 // nested heat file including pattern 1B.
68 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedTwoSameFileOneDiff");
72 public void testNestedWithOneLevelTwoSameFileOneOtherAllPattern1BWithConnectivity() throws
74 // Heat file with 3 nested resources, while 2 point to the same nested heat file, and all
75 // nested heat file including pattern 1B. + conectivity between all nested resources
76 testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedTwoSameOneDiffWithConnectivity");
79 //**************** NESTED MULTI-LEVEL TESTS ******************************
82 public void testNestedMultiLevelPortSecurityGroupNetworkPattern1B() throws
84 // heat file - 1 nested resource + security group which will be connected to port in ALL
85 // nested levels, network which will be connected from port in ALL nested level.
86 //nested heat level 1 - 1 nested resource + pattern 1B
87 //nested heat level 2 - 1 nested resource + pattern 1B
88 testTranslationWithInit(BASE_DIRECTORY + "multiLevel/portSecurityGroupNetPattern1B");
92 public void testNestedMultiLevelAllPatternsDependsOnConnectivity() throws
95 HEAT FILE - 1 : nested resource to heat without nova in the nested heat + 1 nested
96 resource + pattern 1B + pattern C1 + pattern 4 + connectivity between them all (using
97 depends on from/to the first nested resource, without nova)
99 NESTED HEAT LEVEL 1 - 1 nested resource + pattern 1B + pattern C1 + pattern 4 +
100 connectivity between them all (VM Types same as Main)
102 NESTED HEAT LEVEL 2 - 1 nested resource + pattern 1B + pattern C1 + pattern 4 +
103 connectivity between them all
106 testTranslationWithInit(BASE_DIRECTORY + "multiLevel/allPatternsDependsOnConnectivity");
110 public void testThreeNestedLevelsDiffVmTypePattern1B() throws IOException {
111 testTranslationWithInit(BASE_DIRECTORY + "multiLevel/threeNestedLevelsDiffVmTypePattern1B");
115 public void testThreeNestedLevelsSameVmTypePattern1B() throws IOException {
116 testTranslationWithInit(BASE_DIRECTORY + "multiLevel/threeNestedLevelsSameVmTypePattern1B");
120 public void testTwoNestedLevelsWithAllPatternsAndConnectionsBetweenThem() throws IOException {
121 testTranslationWithInit(BASE_DIRECTORY + "multiLevel/twoNestedLevelsWithAllPatternsAndConnectivities");