diff options
author | franciscovila <javier.paradela.vila@est.tech> | 2022-03-15 08:29:04 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-03-28 15:42:52 +0000 |
commit | 28e7f0f13e3d7b75750a449c9bda6c0d4a1986ce (patch) | |
tree | 82141658406c58d0846d937da895c6bb71a225c5 /openecomp-be/lib/openecomp-sdc-translator-lib | |
parent | 88fdc6dd75f1119ffa8e54dbfd721b6ed722b779 (diff) |
Copy entry_defintion_type to TOSCA.meta
Copy "entry_defintion_type" from the
manifest file of ASD package into the
generated TOSCA.meta for the VSP
package
Issue-ID: SDC-3884
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Change-Id: I35c4d0180529e8c60edc714aecadd0150cbd2c03
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib')
6 files changed, 18 insertions, 6 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java index 0547ec730b..97b572235c 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java @@ -42,6 +42,8 @@ import org.openecomp.sdc.heat.datatypes.model.Output; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; +import org.openecomp.sdc.tosca.csar.AsdPackageHelper; +import org.openecomp.sdc.tosca.csar.ManifestUtils; import org.openecomp.sdc.tosca.datatypes.ToscaGroupType; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.services.DataModelUtil; @@ -181,7 +183,7 @@ public class TranslationService { private void createHeatStackGroup(ServiceTemplate serviceTemplate, FileData heatFileData, HeatOrchestrationTemplate heatOrchestrationTemplate, TranslationContext context) { - ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(new AsdPackageHelper(new ManifestUtils())); final String fileName = heatFileData.getFile(); final String heatStackGroupId = FileUtils.getFileWithoutExtention(fileName) + "_group"; GroupDefinition groupDefinition = new GroupDefinition(); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java index 253410e493..6606d0cf25 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java @@ -21,6 +21,8 @@ import java.util.List; import java.util.Map; import org.onap.sdc.tosca.datatypes.model.ArtifactDefinition; import org.onap.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.csar.AsdPackageHelper; +import org.openecomp.sdc.tosca.csar.ManifestUtils; import org.openecomp.sdc.tosca.datatypes.ToscaArtifactType; import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; import org.openecomp.sdc.tosca.services.ToscaConstants; @@ -46,7 +48,7 @@ public class FunctionTranslationGetFileImpl implements FunctionTranslation { artifactParameters.add(ToscaConstants.MODELABLE_ENTITY_NAME_SELF); returnValue.put(ToscaFunctions.GET_ARTIFACT.getFunctionName(), artifactParameters); artifactParameters.add(artifactId); - ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(new AsdPackageHelper(new ManifestUtils())); if (functionTranslator.getToscaTemplate() instanceof NodeTemplate) { NodeTemplate nodeTemplate = (NodeTemplate) functionTranslator.getToscaTemplate(); ArtifactDefinition artifactDefinition = createArtifactDefinition(file, toscaFileOutputService); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java index d4ee120fb8..e3f28f6fdc 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java @@ -50,6 +50,8 @@ import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.services.HeatConstants; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; +import org.openecomp.sdc.tosca.csar.AsdPackageHelper; +import org.openecomp.sdc.tosca.csar.ManifestUtils; import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; import org.openecomp.sdc.tosca.datatypes.ToscaGroupType; @@ -418,7 +420,7 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran serviceInstanceGroupDefinition.setType(ToscaGroupType.HEAT_STACK); Map<String, Object> groupProperties = new HashMap<>(); groupProperties - .put("heat_file", "../" + (new ToscaFileOutputServiceCsarImpl()).getArtifactsFolderName() + "/" + translateTo.getHeatFileName()); + .put("heat_file", "../" + (new ToscaFileOutputServiceCsarImpl(new AsdPackageHelper(new ManifestUtils()))).getArtifactsFolderName() + "/" + translateTo.getHeatFileName()); serviceInstanceGroupDefinition.setProperties(groupProperties); serviceInstanceGroupDefinition.setMembers(new ArrayList<>()); String heatStackGroupKey = translateTo.getTranslatedId() + "_group"; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java index 57115764aa..847a88cb08 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java @@ -21,6 +21,8 @@ import org.junit.Test; import org.onap.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.tosca.csar.AsdPackageHelper; +import org.openecomp.sdc.tosca.csar.ManifestUtils; import org.openecomp.sdc.tosca.services.ToscaConstants; import org.openecomp.sdc.tosca.services.ToscaFileOutputService; import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; @@ -81,7 +83,7 @@ public class FunctionTranslationGetFileImplTest { Assert.assertNotNull(nodeTemplate.getArtifacts()); Assert.assertNotNull( nodeTemplate.getArtifacts().get(FileUtils.getFileWithoutExtention((String) function))); - ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(new AsdPackageHelper(new ManifestUtils())); Assert.assertEquals( nodeTemplate.getArtifacts().get(FileUtils.getFileWithoutExtention((String) function)) .getFile(), "../" + toscaFileOutputService.getArtifactsFolderName() + "/" + function); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java index 31dbb21a4c..fded190868 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java @@ -43,6 +43,8 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.tosca.csar.AsdPackageHelper; +import org.openecomp.sdc.tosca.csar.ManifestUtils; import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; import org.openecomp.sdc.translator.TestUtils; import org.togglz.testing.TestFeatureManager; @@ -111,7 +113,7 @@ public class BaseFullTranslationTest { .build()); } - return new ToscaFileOutputServiceCsarImpl().createOutputFile(translatorOutput.getToscaServiceModel(), null); + return new ToscaFileOutputServiceCsarImpl(new AsdPackageHelper(new ManifestUtils())).createOutputFile(translatorOutput.getToscaServiceModel(), null); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java index 42f4cfdfd5..60717bf0b9 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java @@ -60,6 +60,8 @@ import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile; +import org.openecomp.sdc.tosca.csar.AsdPackageHelper; +import org.openecomp.sdc.tosca.csar.ManifestUtils; import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; import org.openecomp.sdc.translator.TestUtils; import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; @@ -144,7 +146,7 @@ public class BaseResourceTranslationTest { .build()); } - return new ToscaFileOutputServiceCsarImpl().createOutputFile(translatorOutput.getToscaServiceModel(), null); + return new ToscaFileOutputServiceCsarImpl(new AsdPackageHelper(new ManifestUtils())).createOutputFile(translatorOutput.getToscaServiceModel(), null); } |