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.TestConstants.TEST_VOLUME_NEGATIVE;
24 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_POSITIVE;
26 import org.junit.Before;
27 import org.junit.Test;
28 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
30 import java.io.IOException;
33 public class ResourceTranslationCinderVolumeAttachmentImplTest extends BaseResourceTranslationTest {
37 public void setUp() throws IOException {
38 // do not delete this function. it prevents the superclass setup from running
42 public void testTranslateAllResourcesInOneFile() throws Exception {
43 inputFilesPath = "/mock/services/heattotosca/vol_attach/volume_and_attach_one_file/inputfiles";
45 "/mock/services/heattotosca/vol_attach/volume_and_attach_one_file/expectedoutputfiles";
46 initTranslatorAndTranslate();
48 validateComputeTemplateConsolidationData(ConsolidationDataValidationType.VALIDATE_VOLUME,
49 TEST_VOLUME_POSITIVE);
53 public void testVolFileIsNestedInMainHeatFile() throws Exception {
55 "/mock/services/heattotosca/vol_attach/volume_file_nested_in_main_file_in_manifest/inputfiles";
57 "/mock/services/heattotosca/vol_attach/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles";
58 initTranslatorAndTranslate();
60 validateComputeTemplateConsolidationData(ConsolidationDataValidationType.VALIDATE_VOLUME,
61 TEST_VOLUME_POSITIVE);
65 public void testVolFileAsDataOfNested() throws Exception {
66 inputFilesPath = "/mock/services/heattotosca/vol_attach/nested_with_inner_vol/inputfiles";
67 outputFilesPath = "/mock/services/heattotosca/vol_attach/nested_with_inner_vol/out";
68 initTranslatorAndTranslate();
70 validateComputeTemplateConsolidationData(ConsolidationDataValidationType.VALIDATE_VOLUME,
71 TEST_VOLUME_POSITIVE);
75 public void testVolFileIsParallelToMainHeatFile() throws Exception {
77 "/mock/services/heattotosca/vol_attach/volume_file_parallel_to_main_file/inputfiles";
79 "/mock/services/heattotosca/vol_attach/volume_file_parallel_to_main_file/expectedoutputfiles";
80 initTranslatorAndTranslate();
82 validateComputeTemplateConsolidationData(ConsolidationDataValidationType.VALIDATE_VOLUME,
83 TEST_VOLUME_NEGATIVE);