From a9696cdf3dd5da824eb23456b39e2897a15f03a8 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Wed, 19 Sep 2018 09:56:15 -0400 Subject: various bugfixes for casablanca fixed unit tests after addition of A&AI edge label added option for edgelabel between vnf inst group added belongs to in connecting a vnf to instance group - Adding test for getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAn dWorkStep method in the catalogdb client correct default RainyDay table search input updated custom resolver to include float and added comment to explain timestamp configuration added a custom resolver and updated snake yaml version Replacing bowman client with restTemplate.exchange | Add Accept and Content-Type to headers Removing the unused imports as well Implementing some review comments for hte tests being ignored Replacing bowman client with restTemplate.exchange |Fixing Junits Replacing bowman client with restTemplate.exchange | Making Data inserts to go specifically in requestDB Replacing bowman client with restTemplate.exchange | Adding Junits Replacing bowman client with restTemplate.exchange | Adding Junits Replacing bowman client with restTemplate.exchange | Adding Junits Replacing bowman client with restTemplate.exchange - Updated tosca parser version to 1.4.3 and upgraded vnfc test case with new csar to pass with latest parser code. added test case for when workflow has not called all flows fixed issue with rollback and retry in workflowaction Reverted homing changes and changes assign vnf to use the homing produced GeneralBuildingBlock. fixed unit test to build the correct format hashmap reverted extraction back to LinkedHashMap marshal sdnc output to an object removed unused variables and imports extract response code/message from embedded map add junits to parse SDNC assign response removed missed org.openecomp.mso imports from bpmn Change-Id: Ib2b6591a744ecb5b08c522494cdf1ad7dae18a08 Issue-ID: SO-1069 Signed-off-by: Benjamin, Max (mb388a) --- .../installer/heat/ToscaResourceInstaller.java | 19 ++++++++----- .../onap/so/asdc/util/ASDCNotificationLogging.java | 31 +++++++++++++--------- .../java/org/onap/so/asdc/util/YamlEditor.java | 4 +++ 3 files changed, 35 insertions(+), 19 deletions(-) (limited to 'asdc-controller/src') diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index 970cb0bf50..f77a48a1f8 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -488,21 +488,24 @@ public class ToscaResourceInstaller { .getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID); IVfModuleData vfMetadata = vfModuleStructure.getVfModuleMetadata(); - logger.debug("Comparing VFModuleMetadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID()); + logger.debug("Comparing Vf_Modules_Metadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID()); Optional matchingObject = vfGroups.stream() .peek(group -> logger.debug("To Csar Group VFModuleModelCustomizationUUID " + group.getMetadata().getValue("vfModuleModelCustomizationUUID"))) - .filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID").equals(vfMetadata.getVfModuleModelCustomizationUUID())). - findFirst(); + .filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID").equals(vfMetadata.getVfModuleModelCustomizationUUID())) + .findFirst(); if(matchingObject.isPresent()){ VfModuleCustomization vfModuleCustomization = createVFModuleResource(matchingObject.get(), nodeTemplate, toscaResourceStruct, vfResourceStructure,vfMetadata, vnfResource, service, existingCvnfcSet, existingVnfcSet); vfModuleCustomization.getVfModule().setVnfResources(vnfResource.getVnfResources()); }else - throw new Exception("Cannot find matching VFModule Customization for VF Module Metadata: " + vfMetadata.getVfModuleModelCustomizationUUID()); + throw new Exception("Cannot find matching VFModule Customization in Csar for Vf_Modules_Metadata: " + vfMetadata.getVfModuleModelCustomizationUUID()); } service.getVnfCustomizations().add(vnfResource); + } else{ + logger.debug("Notification VF ResourceCustomizationUUID: " + vfNotificationResource.getResourceCustomizationUUID() + " doesn't match " + + "Tosca VF Customization UUID: " + vfCustomizationUUID); } } } @@ -1150,7 +1153,7 @@ public class ToscaResourceInstaller { vfcInstanceGroup.setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); vfcInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); vfcInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); - vfcInstanceGroup.setToscaNodeType(group.getType()); + vfcInstanceGroup.setToscaNodeType(group.getType()); vfcInstanceGroup.setRole("SUB-INTERFACE"); // Set Role vfcInstanceGroup.setType(InstanceGroupType.VNFC); // Set type @@ -1201,7 +1204,7 @@ public class ToscaResourceInstaller { if(vfModule==null) vfModule=createVfModule(group, toscaResourceStructure, vfModuleData, vfMetadata); - vfModuleCustomization = createVfModuleCustomzation(group, toscaResourceStructure, vfModule, vfModuleData); + vfModuleCustomization = createVfModuleCustomization(group, toscaResourceStructure, vfModule, vfModuleData); setHeatInformationForVfModule(toscaResourceStructure, vfResourceStructure, vfModule, vfModuleCustomization, vfMetadata); vfModuleCustomization.setVfModule(vfModule); @@ -1416,7 +1419,7 @@ public class ToscaResourceInstaller { return vfModule; } - protected VfModuleCustomization createVfModuleCustomzation(Group group, + protected VfModuleCustomization createVfModuleCustomization(Group group, ToscaResourceStructure toscaResourceStructure, VfModule vfModule, IVfModuleData vfModuleData) { VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); @@ -1691,6 +1694,8 @@ public class ToscaResourceInstaller { testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); vnfResource.setAicVersionMin( testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); + vnfResource.setCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + vnfResource.setSubCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)); return vnfResource; } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java index ab9c359b7f..9df9ffc7af 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java @@ -203,11 +203,11 @@ public class ASDCNotificationLogging { List vfNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceVfList(); for (NodeTemplate vfNodeTemplate : vfNodeTemplatesList) { - + + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VNF Properties:"); - buffer.append(System.lineSeparator()); - + buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); buffer.append(System.lineSeparator()); @@ -262,6 +262,7 @@ public class ASDCNotificationLogging { for (Group group : groupList) { Metadata instanceMetadata = group.getMetadata(); + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VNFC Instance Group Properties:"); buffer.append(System.lineSeparator()); @@ -277,18 +278,19 @@ public class ASDCNotificationLogging { buffer.append(System.lineSeparator()); buffer.append("InvariantUuid:"); buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); } } - + List vfGroups = toscaResourceStructure.getSdcCsarHelper().getVfModulesByVf(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID))); for(Group group : vfGroups){ Metadata vfMetadata = group.getMetadata(); + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VF Module Properties:"); buffer.append(System.lineSeparator()); @@ -306,13 +308,14 @@ public class ASDCNotificationLogging { buffer.append(System.lineSeparator()); buffer.append("Description:"); buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); - buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); } List cvfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(vfNodeTemplate, SdcTypes.CVFC); for(NodeTemplate cvfcTemplate : cvfcList) { + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("CVNFC Properties:"); buffer.append(System.lineSeparator()); @@ -339,6 +342,7 @@ public class ASDCNotificationLogging { List vfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(cvfcTemplate, SdcTypes.VFC); for(NodeTemplate vfcTemplate : vfcList) { + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VNFC Properties:"); buffer.append(System.lineSeparator()); @@ -370,13 +374,13 @@ public class ASDCNotificationLogging { List nodeTemplatesVLList = toscaResourceStructure.getSdcCsarHelper().getServiceVlList(); if(nodeTemplatesVLList != null){ - - buffer.append(System.lineSeparator()); - buffer.append("NETWORK Level Properties:"); - buffer.append(System.lineSeparator()); - + for(NodeTemplate vlNode : nodeTemplatesVLList){ + buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); + buffer.append("NETWORK Level Properties:"); + buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); buffer.append(System.lineSeparator()); @@ -414,6 +418,7 @@ public class ASDCNotificationLogging { if (networkCollectionList != null) { for (NodeTemplate crNode : networkCollectionList) { + buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); buffer.append(System.lineSeparator()); @@ -448,6 +453,7 @@ public class ASDCNotificationLogging { Metadata vlMetadata = vlNodeTemplate.getMetaData(); + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("Network CR VL Properties:"); buffer.append(System.lineSeparator()); @@ -481,7 +487,8 @@ public class ASDCNotificationLogging { if(groupList != null){ for (Group group : groupList) { Metadata instanceMetadata = group.getMetadata(); - buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); buffer.append("Network Instance Group Properties:"); buffer.append(System.lineSeparator()); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java index 32f512b0f0..3418ee3295 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java @@ -50,6 +50,10 @@ public class YamlEditor { public YamlEditor (byte[] body) { init (body); } + + public YamlEditor (Yaml yaml) { + this.yaml = yaml; + } @SuppressWarnings("unchecked") protected synchronized void init (byte[] body) { -- cgit 1.2.3-korg