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 org.junit.Before;
24 import org.junit.Rule;
25 import org.junit.Test;
26 import org.junit.rules.ExpectedException;
27 import org.junit.runner.RunWith;
28 import org.mockito.runners.MockitoJUnitRunner;
30 import java.io.IOException;
32 @RunWith(MockitoJUnitRunner.class)
33 public class ResourceTranslationResourceGroupImplTest extends BaseResourceTranslationTest {
35 public ExpectedException thrown = ExpectedException.none();
39 public void setUp() throws IOException {
40 // do not delete this function. it prevents the superclass setup from running
44 public void testTranslateResourceGroup() throws Exception {
45 inputFilesPath = "/mock/heat/nested/resource_group/inputs";
46 outputFilesPath = "/mock/heat/nested/resource_group/expectedoutputfiles";
47 initTranslatorAndTranslate();
52 public void testTranslateMultiResourceGroup() throws Exception {
53 inputFilesPath = "/mock/heat/nested/multiple_resource_groups/inputs";
54 outputFilesPath = "/mock/heat/nested/multiple_resource_groups/expectedoutputfiles";
55 initTranslatorAndTranslate();
60 public void testTranslateResourceGroupDynamicCount() throws Exception {
61 inputFilesPath = "/mock/heat/nested/resource_group_with_dynamic_count/inputs";
62 outputFilesPath = "/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles";
63 initTranslatorAndTranslate();
69 public void testTranslatePortToNetNestedByResourceGroupConnection() throws Exception {
70 inputFilesPath = "/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles";
72 "/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles";
73 initTranslatorAndTranslate();
78 public void testTranslatePortToNetSharedConnection() throws Exception {
79 inputFilesPath = "/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles";
81 "/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles";
82 initTranslatorAndTranslate();
87 public void testTranslateSecurityGroupToSharedPortConnection() throws Exception {
89 "/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles";
91 "/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles";
92 initTranslatorAndTranslate();
97 public void testTranslateResourceGroupIndexVar() throws Exception {
98 inputFilesPath = "/mock/heat/nested/resourceGroupIndexVar/inputs";
99 outputFilesPath = "/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles";
100 initTranslatorAndTranslate();
105 public void testTranslateMDNS() throws Exception {
106 inputFilesPath = "/mock/heat/nested/resourceGroupMDNS/inputs";
107 outputFilesPath = "/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles";
108 initTranslatorAndTranslate();