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 UnifiedCompositionNestedSingleComputeFullTest extends BaseFullTranslationTest {
30 private static final String BASE_DIRECTORY = "/mock/services/heattotosca/fulltest/nestedSingleCompute/";
33 public void testNestedWithOneCompute() throws IOException {
34 testTranslationWithInit(BASE_DIRECTORY + "nestedWithOneCompute");
38 public void testNestedWithOneComputeSamePortType() throws IOException {
39 testTranslationWithInit(BASE_DIRECTORY + "nestedWithOneComputeDiffPortType");
43 public void testOneNestedWithTwoComputesOfSameType() throws IOException {
44 //Not pattern 4 (Complex VFC)
45 testTranslationWithInit(BASE_DIRECTORY + "nestedWithTwoComputesOfSameType");
49 public void testOneNestedWithTwoDiffComputeTypes() throws IOException {
50 //Not pattern 4 (Complex VFC)
51 testTranslationWithInit(BASE_DIRECTORY + "nestedWithTwoDiffComputeTypes");
55 public void testTwoNestedNodeTemplatesOfSameType() throws IOException {
56 testTranslationWithInit(BASE_DIRECTORY + "twoNestedNodeTemplatesWithSameComputeType");
60 public void testTwoDiffNestedFilesWithSameComputeType() throws IOException {
61 testTranslationWithInit(BASE_DIRECTORY + "diffNestedFilesWithSameComputeType");
65 public void testNestedCompositionNodesConnectedIn() throws IOException {
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
76 testTranslationWithInit(BASE_DIRECTORY + "nestedNodesConnectedIn");
80 public void testNestedCompositionNodesGetAttrIn() throws IOException {
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
91 testTranslationWithInit(BASE_DIRECTORY + "nestedNodesGetAttrIn");
95 public void testNestedCompositionOutputParamGetAttrIn() throws IOException {
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
104 testTranslationWithInit(BASE_DIRECTORY + "nestedOutputParamGetAttrIn");
108 public void testMultiLevelNestedComposition() throws IOException {
109 //Not pattern 4 (Multi level Complex VFC)
110 testTranslationWithInit(BASE_DIRECTORY + "nestedMultiLevels");
114 public void testThreeNestedSameTypeTwoPointingToSameNestedFile() throws IOException {
115 testTranslationWithInit(BASE_DIRECTORY + "threeNestedSameTypeTwoPointingOnSameNestedFile");
119 public void testThreeNestedSameTypePointingToDiffFiles() throws IOException {
120 testTranslationWithInit(BASE_DIRECTORY + "threeNestedPointingToThreeDiffNestedFilesSameComputeType");
124 public void testMultipleReferencesToSameNestedFilesWithSameComputeType() throws IOException {
125 testTranslationWithInit(BASE_DIRECTORY + "multipleReferencesToSameNestedFilesWithSameComputeType");
129 public void testDuplicateReq() throws IOException {
130 testTranslationWithInit(BASE_DIRECTORY + "duplicateReqs");