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 / UnifiedCompositionNestedPatternsFullTest.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 UnifiedCompositionNestedPatternsFullTest extends BaseFullTranslationTest {
29
30     private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/nestedOtherScenarios/";
31
32     @Test
33     public void testNestedWithOneLevelMultipleComputesSingleSubstitution() throws IOException {
34         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedSingleSubstitution1B");
35     }
36
37     @Test
38     public void testNestedWithOneLevelMultipleComputesScalingInstance() throws IOException {
39         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedScalingInstance");
40     }
41
42     @Test
43     public void testNestedWithOneLevelMultipleComputesCatalogInstance() throws IOException {
44         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedCatalogInstance");
45     }
46
47     @Test
48     public void testNestedWithOneLevelAllNonNestedPatterns() throws IOException {
49         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedAllNonNestedPatterns");
50     }
51
52     @Test
53     public void testNestedWithOneLevelNoCompute() throws IOException {
54         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedNoCompute");
55     }
56
57     @Test
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");
62     }
63
64     @Test
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");
69     }
70
71     @Test
72     public void testNestedWithOneLevelTwoSameFileOneOtherAllPattern1BWithConnectivity() throws
73         IOException {
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");
77     }
78
79     //**************** NESTED MULTI-LEVEL TESTS ******************************
80
81     @Test
82     public void testNestedMultiLevelPortSecurityGroupNetworkPattern1B() throws
83         IOException {
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");
89     }
90
91     @Test
92     public void testNestedMultiLevelAllPatternsDependsOnConnectivity() throws
93         IOException {
94         /*
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)
98
99         NESTED HEAT LEVEL 1 - 1 nested resource + pattern 1B +  pattern C1 + pattern 4 +
100         connectivity between them all (VM Types same as Main)
101
102         NESTED HEAT LEVEL 2 - 1 nested resource + pattern 1B +  pattern C1 + pattern 4 +
103         connectivity between them all
104         */
105
106         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/allPatternsDependsOnConnectivity");
107     }
108
109     @Test
110     public void testThreeNestedLevelsDiffVmTypePattern1B() throws IOException {
111         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/threeNestedLevelsDiffVmTypePattern1B");
112     }
113
114     @Test
115     public void testThreeNestedLevelsSameVmTypePattern1B() throws IOException {
116         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/threeNestedLevelsSameVmTypePattern1B");
117     }
118
119     @Test
120     public void testTwoNestedLevelsWithAllPatternsAndConnectionsBetweenThem() throws IOException {
121         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/twoNestedLevelsWithAllPatternsAndConnectivities");
122     }
123
124 }