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 / UnifiedCompositionNestedSingleComputeFullTest.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 UnifiedCompositionNestedSingleComputeFullTest extends BaseFullTranslationTest {
29
30     private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/nestedSingleCompute/";
31
32     @Test
33     public void testNestedWithOneCompute() throws IOException {
34         testTranslationWithInit(BASE_DIRECTORY + "nestedWithOneCompute");
35     }
36
37     @Test
38     public void testNestedWithOneComputeSamePortType() throws IOException {
39         testTranslationWithInit(BASE_DIRECTORY + "nestedWithOneComputeDiffPortType");
40     }
41
42     @Test
43     public void testOneNestedWithTwoComputesOfSameType() throws IOException {
44         //Not pattern 4 (Complex VFC)
45         testTranslationWithInit(BASE_DIRECTORY + "nestedWithTwoComputesOfSameType");
46     }
47
48     @Test
49     public void testOneNestedWithTwoDiffComputeTypes() throws IOException {
50         //Not pattern 4 (Complex VFC)
51         testTranslationWithInit(BASE_DIRECTORY + "nestedWithTwoDiffComputeTypes");
52     }
53
54     @Test
55     public void testTwoNestedNodeTemplatesOfSameType() throws IOException {
56         testTranslationWithInit(BASE_DIRECTORY + "twoNestedNodeTemplatesWithSameComputeType");
57     }
58
59     @Test
60     public void testTwoDiffNestedFilesWithSameComputeType() throws IOException {
61         testTranslationWithInit(BASE_DIRECTORY + "diffNestedFilesWithSameComputeType");
62     }
63
64     @Test
65     public void testNestedCompositionNodesConnectedIn() throws IOException {
66        /*
67         Nested Composition + node connected In
68          a. Dependency between a nested compute and a non-nested compute resource
69          b. Dependency between a nested compute and another nested resource (same type)
70          c. Dependency between a nested compute and another nested resource (different type)
71          d. Dependency between a non-consolidation entity resource and a nested compute resource
72          e. Dependency between a non-consolidation entity resource and a non-nested compute resource
73          f. Security Rule to Port nested connection
74          g. Security Rule to Port nested shared connection
75          */
76         testTranslationWithInit(BASE_DIRECTORY + "nestedNodesConnectedIn");
77     }
78
79     @Test
80     public void testNestedCompositionNodesGetAttrIn() throws IOException {
81        /*
82         Nested composition with Get attribute in -
83           a. Get attribute in a non-nested compute from a nested compute resource
84           b. Get attribute in a non-nested compute from another consolidation entity resource
85           c. Get attribute in a nested compute from another nested compute resource of same type
86           d. Get attribute in a nested compute from another nested compute resource of different type
87           e. Get attribute in a nested compute from a regular consolidation entity resource
88           f. Get attribute in a non-consolidation entity resource from a nested compute resource
89           g. Get attribute in a non-consolidation entity resource from a non-nested compute resource
90          */
91         testTranslationWithInit(BASE_DIRECTORY + "nestedNodesGetAttrIn");
92     }
93
94     @Test
95     public void testNestedCompositionOutputParamGetAttrIn() throws IOException {
96        /*
97         Nested Composition + Output Param get attribute In
98           a. From a nested resource
99           b. From another nested resource of same type (represented by same nested file)
100           c. From a nested resource of different type (represented by different nested file)
101           d. From a non-nested consolidation entity resource
102           e. From a regular non-consolidation entity resource
103          */
104         testTranslationWithInit(BASE_DIRECTORY + "nestedOutputParamGetAttrIn");
105     }
106
107     @Test
108     public void testMultiLevelNestedComposition() throws IOException {
109         //Not pattern 4 (Multi level Complex VFC)
110         testTranslationWithInit(BASE_DIRECTORY + "nestedMultiLevels");
111     }
112
113     @Test
114     public void testThreeNestedSameTypeTwoPointingToSameNestedFile() throws IOException {
115         testTranslationWithInit(BASE_DIRECTORY + "threeNestedSameTypeTwoPointingOnSameNestedFile");
116     }
117
118     @Test
119     public void testThreeNestedSameTypePointingToDiffFiles() throws IOException {
120         testTranslationWithInit(BASE_DIRECTORY + "threeNestedPointingToThreeDiffNestedFilesSameComputeType");
121     }
122
123     @Test
124     public void testMultipleReferencesToSameNestedFilesWithSameComputeType() throws IOException {
125         testTranslationWithInit(BASE_DIRECTORY + "multipleReferencesToSameNestedFilesWithSameComputeType");
126     }
127
128     @Test
129     public void testDuplicateReq() throws IOException {
130         testTranslationWithInit(BASE_DIRECTORY + "duplicateReqs");
131     }
132 }