2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.resourcetranslation;
23 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedNodesConnectedInSecurityRuleToPort;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants;
29 import java.io.IOException;
32 public class SecurityRulesToPortResourceConnectionTest extends BaseResourceTranslationTest {
35 public void setUp() throws IOException {
36 // do not delete this function. it prevents the superclass setup from running
40 public void testTranslateSecurityRuleToPortNestedConnection() throws Exception {
42 "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles";
44 "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles";
45 initTranslatorAndTranslate();
47 validateNestedNodesConnectedInSecurityRuleToPort(TestConstants
48 .TEST_SECURITY_RULE_PORT_NESTED_CONNECTION, translationContext);
52 public void testTranslateSecurityRuleToPortSharedPortNestedConnection() throws Exception {
54 "/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles";
56 "/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles";
57 initTranslatorAndTranslate();
59 validateNestedNodesConnectedInSecurityRuleToPort(TestConstants
60 .TEST_SECURITY_RULE_PORT_NESTED_SHARED_PORT, translationContext);
64 public void testSecurityRuleToPortConnectionSharedAddOnConnection() throws Exception {
66 "/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortSharedAddOn/inputfiles";
68 "/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortSharedAddOn/expectedoutputfiles";
69 initTranslatorAndTranslate();
74 public void testSecurityRuleToPortConnectionNestedGetResource() throws Exception {
76 "/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortGetResource/inputfiles";
78 "/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortGetResource/out";
79 initTranslatorAndTranslate();
85 public void testSecurityRuleToPortConnectionNestedMultiLevelsGetResource() throws Exception {
87 "/mock/services/heattotosca/securityrulestoportconnection/nestedMultiLevels/inputfiles";
89 "/mock/services/heattotosca/securityrulestoportconnection/nestedMultiLevels/expectedoutputfiles";
90 initTranslatorAndTranslate();
92 validateNestedNodesConnectedInSecurityRuleToPort(TestConstants
93 .TEST_SECURITY_RULE_PORT_MULTI_LEVEL_NESTED_CONNECTION, translationContext);
97 public void testSecurityRuleToPortConnectionSharedNestedMultiLevelsGetResource()
100 "/mock/services/heattotosca/securityrulestoportconnection/sharedNestedMultiLevels/inputfiles";
102 "/mock/services/heattotosca/securityrulestoportconnection/sharedNestedMultiLevels/expectedoutputfiles";
103 initTranslatorAndTranslate();
105 validateNestedNodesConnectedInSecurityRuleToPort(TestConstants
106 .TEST_SECURITY_RULE_PORT_MULTI_LEVEL_NESTED_SHARED_PORT, translationContext);