From 031db8630dda9706e22aa3bbdf0f2dfba33fb86e Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 24 Jul 2019 08:57:20 +0000 Subject: Validate PM Dictionary and VES Events YAML Files Validate, during the package onboarding, YAML files declared in the manifest as type onap_ves_events or onap_pm_dictionary under non_mano_artifact_sets. Check if the file is not empty, if has a yaml extension and if it has a valid yaml content. Change-Id: I260d0f5355e9e77b6499f553f8aa9f7e6d0693da Issue-ID: SDC-2475 Signed-off-by: andre.schmid --- .../main/java/org/openecomp/sdc/common/errors/Messages.java | 6 +++++- .../openecomp-tosca-converter-core/pom.xml | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'openecomp-be/lib') diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java index 12359fdb14..7d2f8b2a36 100644 --- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java @@ -111,11 +111,15 @@ public enum Messages { MISSING_DEFINITION_FILE("Definition file %s referenced in TOSCA.meta does not exist"), MISSING_IMPORT_FILE("Package must contain the referenced import file '%s'"), INVALID_IMPORT_STATEMENT("Definition file '%s' contains an invalid import statement: '%s'"), + INVALID_YAML_EXTENSION("Expecting yaml or yml extension for file: %s"), + /* content errors*/ - INVALID_YAML_FORMAT("Invalid YAML format - %s"), + INVALID_YAML_FORMAT("Invalid YAML format: %s"), + INVALID_YAML_FORMAT_1("Invalid YAML format in file '%s'. Format error:%n%s"), INVALID_YAML_FORMAT_REASON("Invalid YAML format Problem - [%s]"), EMPTY_YAML_FILE("empty yaml"), + EMPTY_YAML_FILE_1("The yaml file '%s' is empty"), GENERAL_YAML_PARSER_ERROR("general parser error"), GENERAL_HEAT_PARSER_ERROR("general parser error"), INVALID_HEAT_FORMAT_REASON("Invalid HEAT format problem - [%s]"), diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml index 02be9a6adc..213d6e1f44 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml @@ -25,14 +25,20 @@ ${project.version} - junit - junit + org.hamcrest + hamcrest + ${hamcrest.version} test org.hamcrest hamcrest-library - ${hamcrest-all.version} + ${hamcrest.version} + test + + + junit + junit test -- cgit 1.2.3-korg