eeaf7586349130020a23cb12f7ccb5433859b42c
[sdc.git] /
1 package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest;
2
3 import org.junit.Test;
4 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest;
5
6 import java.io.IOException;
7
8 public class UnifiedCompositionNestedPatternsFullTest extends BaseFullTranslationTest {
9
10     private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/nestedOtherScenarios/";
11
12     @Test
13     public void testNestedWithOneLevelMultipleComputesSingleSubstitution() throws IOException {
14         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedSingleSubstitution1B");
15     }
16
17     @Test
18     public void testNestedWithOneLevelMultipleComputesScalingInstance() throws IOException {
19         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedScalingInstance");
20     }
21
22     @Test
23     public void testNestedWithOneLevelMultipleComputesCatalogInstance() throws IOException {
24         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedCatalogInstance");
25     }
26
27     @Test
28     public void testNestedWithOneLevelAllNonNestedPatterns() throws IOException {
29         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedAllNonNestedPatterns");
30     }
31
32     @Test
33     public void testNestedWithOneLevelNoCompute() throws IOException {
34         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedNoCompute");
35     }
36
37     @Test
38     public void testNestedWithOneLevelOtherPatternsNoComputeWithConnectivity() throws IOException {
39         //One nested resource with no Compute, one nested resource having all non nested patterns
40         // with connectivity between themo
41         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedAllPatternsConnectivity");
42     }
43
44     @Test
45     public void testNestedWithOneLevelTwoSameFileOneOtherAllPattern1B() throws IOException {
46         // Heat file with 3 nested resources, while 2 point to the same nested heat file, and all
47         // nested heat file including pattern 1B.
48         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedTwoSameFileOneDiff");
49     }
50
51     @Test
52     public void testNestedWithOneLevelTwoSameFileOneOtherAllPattern1BWithConnectivity() throws
53         IOException {
54         // Heat file with 3 nested resources, while 2 point to the same nested heat file, and all
55         // nested heat file including pattern 1B. +  conectivity between all nested resources
56         testTranslationWithInit(BASE_DIRECTORY + "oneLevel/nestedTwoSameOneDiffWithConnectivity");
57     }
58
59     //**************** NESTED MULTI-LEVEL TESTS ******************************
60
61     @Test
62     public void testNestedMultiLevelPortSecurityGroupNetworkPattern1B() throws
63         IOException {
64         // heat file - 1 nested resource + security group which will be connected to port in ALL
65         // nested levels, network which will be connected from port in ALL nested level.
66         //nested heat level 1 - 1 nested resource  + pattern 1B
67         //nested heat level 2 - 1 nested resource  + pattern 1B
68         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/portSecurityGroupNetPattern1B");
69     }
70
71     @Test
72     public void testNestedMultiLevelAllPatternsDependsOnConnectivity() throws
73         IOException {
74         /*
75         HEAT FILE - 1 : nested resource to heat without nova in the nested heat + 1 nested
76         resource + pattern 1B +  pattern C1 + pattern 4 + connectivity between them all (using
77         depends on from/to the first nested resource, without nova)
78
79         NESTED HEAT LEVEL 1 - 1 nested resource + pattern 1B +  pattern C1 + pattern 4 +
80         connectivity between them all (VM Types same as Main)
81
82         NESTED HEAT LEVEL 2 - 1 nested resource + pattern 1B +  pattern C1 + pattern 4 +
83         connectivity between them all
84         */
85
86         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/allPatternsDependsOnConnectivity");
87     }
88
89     @Test
90     public void testThreeNestedLevelsDiffVmTypePattern1B() throws IOException {
91         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/threeNestedLevelsDiffVmTypePattern1B");
92     }
93
94     @Test
95     public void testThreeNestedLevelsSameVmTypePattern1B() throws IOException {
96         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/threeNestedLevelsSameVmTypePattern1B");
97     }
98
99     @Test
100     public void testTwoNestedLevelsWithAllPatternsAndConnectionsBetweenThem() throws IOException {
101         testTranslationWithInit(BASE_DIRECTORY + "multiLevel/twoNestedLevelsWithAllPatternsAndConnectivities");
102     }
103
104 }