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_CONNECTIVITY_POSITIVE;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
29 import java.io.IOException;
33 * @since August 10, 2016
35 public class ResourceTranslationContrailV2VmInterfaceImplTest extends BaseResourceTranslationTest {
39 public void setUp() throws IOException {
40 // do not delete this function. it prevents the superclass setup from running
44 public void testTranslateVMIWithGetResource() throws Exception {
45 inputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles";
46 outputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles";
47 initTranslatorAndTranslate();
49 validatePortTemplateConsolidationData(ConsolidationDataValidationType
50 .VALIDATE_CONNECTIVITY, TEST_CONNECTIVITY_POSITIVE);
54 public void testTranslateVMIWithListOfNetworks() throws Exception {
55 inputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles";
57 "/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles";
58 initTranslatorAndTranslate();
60 validatePortTemplateConsolidationData(ConsolidationDataValidationType
61 .VALIDATE_CONNECTIVITY, TEST_CONNECTIVITY_POSITIVE);
65 public void testMacAddressesValueMapOfListWithOneItem() throws IOException {
67 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueMapOneItem/inputfiles";
69 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueMapOneItem/expectedoutputfiles";
70 initTranslatorAndTranslate();
75 public void testMacAddressesValueMapOfListWithTwoItems() throws IOException {
77 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueMapTwoItems/inputfiles";
79 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueMapTwoItems/expectedoutputfiles";
80 initTranslatorAndTranslate();
85 public void testMacAddressesValueMapOfListWithStaticValue() throws IOException {
87 "/mock/services/heattotosca/contrailv2VMinterface/macAddressStaticValue/inputfiles";
89 "/mock/services/heattotosca/contrailv2VMinterface/macAddressStaticValue/expectedoutputfiles";
90 initTranslatorAndTranslate();
95 public void testMacAddressesValueNotList() throws IOException {
97 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueNotAList/inputfiles";
99 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueNotAList/expectedoutputfiles";
100 initTranslatorAndTranslate();
105 public void testMacAddressesValueInProperForm() throws IOException {
107 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueInProperForm/inputfiles";
109 "/mock/services/heattotosca/contrailv2VMinterface/macAddressesValueInProperForm/expectedoutputfiles";
110 initTranslatorAndTranslate();