From 71a1f3d02dea30f2a9c6de646122831ede817bda Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Tue, 10 Oct 2017 18:40:42 +0300 Subject: remove licensing risks Change-Id: I85c69b3ba4f034eeae72894e87d8d90b3b22a533 Issue-Id: SDC-446 Signed-off-by: Michael Lando --- docs/index.rst | 8 ++ pom.xml | 10 +- .../tosca/parser/config/ConfigurationManager.java | 16 +-- .../parser/config/JToscaValidationIssueInfo.java | 31 ++++++ .../config/JtoscaValidationIssueConfiguration.java | 52 ++++++++++ .../parser/impl/JToscaValidationIssueType.java | 6 ++ .../tosca/parser/impl/SdcToscaParserFactory.java | 110 ++++++++++++++++++++- .../tosca/parser/utils/YamlToObjectConverter.java | 11 ++- .../jtosca-validation-issue-configuration.yaml | 49 +++++++++ .../sdc/impl/ToscaParserNodeTemplateTest.java | 11 ++- .../sdc/impl/ToscaParserValidationIssueTest.java | 60 +++++++++++ .../jtosca-validation-issue-configuration.yaml | 57 +++++++++++ .../csars/service-Ipassignservice-csar.csar | Bin 50084 -> 49044 bytes .../resources/csars/service-PortMirroring.csar | Bin 56821 -> 55678 bytes .../service-ServiceForToscaParserTests-csar.csar | Bin 78543 -> 77413 bytes .../resources/csars/service-nested-vfc-csar.csar | Bin 47690 -> 46662 bytes .../csars/service-resolve-get-input-csar.csar | Bin 50501 -> 49461 bytes .../csars/service-resolve-get-input-csar_QA.csar | Bin 50447 -> 50447 bytes 18 files changed, 404 insertions(+), 17 deletions(-) create mode 100644 docs/index.rst create mode 100644 src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java create mode 100644 src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java create mode 100644 src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java create mode 100644 src/main/resources/config/jtosca-validation-issue-configuration.yaml create mode 100644 src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java create mode 100644 src/test/resources/config/jtosca-validation-issue-configuration.yaml diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..833e1aa --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,8 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. + +TODO Add files to toctree and delete this header +------------------------------------------------ +.. toctree:: + :maxdepth: 1 + + diff --git a/pom.xml b/pom.xml index 98469f6..120e927 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ sdc-tosca sdc-sdc-tosca SDC Tosca Parser JAR file for use by consumers - 1.1.51-SNAPSHOT + 1.1.53-SNAPSHOT jar @@ -92,12 +92,18 @@ 21.0 compile + + + com.fasterxml.jackson.core + jackson-databind + 2.0.2 + org.openecomp.sdc.jtosca jtosca - 1.1.10-SNAPSHOT + 1.1.13-SNAPSHOT diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java b/src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java index e83e6aa..4e09222 100644 --- a/src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java +++ b/src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java @@ -32,6 +32,7 @@ public class ConfigurationManager { private void initialConfigObjectsFromFiles() { loadConfigurationClass(ErrorConfiguration.class); loadConfigurationClass(Configuration.class); + loadConfigurationClass(JtoscaValidationIssueConfiguration.class); } private void loadConfigurationClass(Class clazz) { @@ -60,13 +61,13 @@ public class ConfigurationManager { public static ConfigurationManager getInstance() { - if (instance == null) { - synchronized (ConfigurationManager.class) { - if (instance == null) { + // if (instance == null) { + // synchronized (ConfigurationManager.class) { + // if (instance == null) { instance = new ConfigurationManager(); - } - } - } + // } + // } + // } return instance; } @@ -103,6 +104,9 @@ public class ConfigurationManager { public ErrorConfiguration getErrorConfiguration() { return (ErrorConfiguration) configurations.get((ErrorConfiguration.class.getSimpleName())); } + public JtoscaValidationIssueConfiguration getJtoscaValidationIssueConfiguration() { + return (JtoscaValidationIssueConfiguration) configurations.get((JtoscaValidationIssueConfiguration.class.getSimpleName())); + } public Configuration getConfiguration() { return (Configuration) configurations.get((Configuration.class.getSimpleName())); diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java b/src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java new file mode 100644 index 0000000..31ab0a0 --- /dev/null +++ b/src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java @@ -0,0 +1,31 @@ +package org.openecomp.sdc.tosca.parser.config; + +public class JToscaValidationIssueInfo { + + private String issueType; + private String sinceCsarConformanceLevel; + + public JToscaValidationIssueInfo() {} + + public String getIssueType() { + return issueType; + } + + public void setIssueType(String issueType) { + this.issueType = issueType; + } + + public String getSinceCsarConformanceLevel() { + return sinceCsarConformanceLevel; + } + + public void setSinceCsarConformanceLevel(String sinceCsarConformanceLevel) { + this.sinceCsarConformanceLevel = sinceCsarConformanceLevel; + } + + public void cloneData(JToscaValidationIssueInfo other) { + this.issueType = other.getIssueType(); + this.sinceCsarConformanceLevel = other.getSinceCsarConformanceLevel(); + } + +} diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java b/src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java new file mode 100644 index 0000000..ff13251 --- /dev/null +++ b/src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.tosca.parser.config; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class JtoscaValidationIssueConfiguration { + + private Map> validationIssues; + + public Map> getValidationIssues() { + return validationIssues; + } + + public void setValidationIssues(Map> validationIssues) { + this.validationIssues = validationIssues; + } + + public List getJtoscaValidationIssueInfo(String key) { + List clone = new ArrayList<>(); + List other = validationIssues.get(key); + if (other != null) { + for (JToscaValidationIssueInfo item: other) { + JToscaValidationIssueInfo cloneitem = new JToscaValidationIssueInfo(); + cloneitem.cloneData(item); + clone.add(cloneitem); + } + } + return clone; + } + +} diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java b/src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java new file mode 100644 index 0000000..1e68c51 --- /dev/null +++ b/src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java @@ -0,0 +1,6 @@ +package org.openecomp.sdc.tosca.parser.impl; + +public enum JToscaValidationIssueType { + CRITICAL, + WARNING +} diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java b/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java index 868b84f..c9cac1c 100644 --- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java +++ b/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java @@ -1,20 +1,31 @@ package org.openecomp.sdc.tosca.parser.impl; +import java.util.ArrayList; +import java.util.List; + import org.openecomp.sdc.tosca.parser.api.ConformanceLevel; import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; import org.openecomp.sdc.tosca.parser.config.*; import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; import org.openecomp.sdc.tosca.parser.utils.GeneralUtility; import org.openecomp.sdc.toscaparser.api.ToscaTemplate; +import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; import org.openecomp.sdc.toscaparser.api.common.JToscaException; import org.openecomp.sdc.toscaparser.api.utils.JToscaErrorCodes; +import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SdcToscaParserFactory { - + private static Logger log = LoggerFactory.getLogger(SdcToscaParserFactory.class.getName()); + private static volatile SdcToscaParserFactory instance; private static Configuration configuration; private static ErrorConfiguration errorConfiguration; - + private static JtoscaValidationIssueConfiguration jtoscaValidationIssueConfiguration; + private List criticalExceptions = new ArrayList<>(); + private List warningExceptions = new ArrayList<>(); + private List notAnalyzadExceptions = new ArrayList<>(); private SdcToscaParserFactory() { } @@ -30,6 +41,7 @@ public class SdcToscaParserFactory { instance = new SdcToscaParserFactory(); configuration = ConfigurationManager.getInstance().getConfiguration(); errorConfiguration = ConfigurationManager.getInstance().getErrorConfiguration(); + jtoscaValidationIssueConfiguration = ConfigurationManager.getInstance().getJtoscaValidationIssueConfiguration(); } } } @@ -68,12 +80,93 @@ public class SdcToscaParserFactory { throwSdcToscaParserException(e); } SdcCsarHelperImpl sdcCsarHelperImpl = new SdcCsarHelperImpl(tosca); - validateCsarVersion(sdcCsarHelperImpl.getConformanceLevel()); + String cSarConformanceLevel = sdcCsarHelperImpl.getConformanceLevel(); + validateCsarVersion(cSarConformanceLevel); + try { + handleErrorsByTypes(csarPath, cSarConformanceLevel); + } catch (JToscaException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } return sdcCsarHelperImpl; } } - private void validateCsarVersion(String cSarVersion) throws SdcToscaParserException { + private void handleErrorsByTypes(String csarPath, String cSarConformanceLevel) throws JToscaException { + clearValidationIssuesLists(); + for(JToscaValidationIssue toscaValidationIssue : ThreadLocalsHolder.getCollector().getValidationIssues().values()){ + List issueInfos = jtoscaValidationIssueConfiguration.getValidationIssues().get(toscaValidationIssue.getCode()); + if(issueInfos != null && !issueInfos.isEmpty()){ + JToscaValidationIssueInfo issueInfo = null; + issueInfo = issueInfos.stream() + .filter(i-> isMatchConformanceLevel(cSarConformanceLevel,i.getSinceCsarConformanceLevel())) + .max((i1,i2) -> GeneralUtility.conformanceLevelCompare(i1.getSinceCsarConformanceLevel(), i2.getSinceCsarConformanceLevel()) ) + .orElse(null); + + if(issueInfo != null){ + switch (JToscaValidationIssueType.valueOf(issueInfo.getIssueType())) { + case CRITICAL: + criticalExceptions.add(toscaValidationIssue); + break; + case WARNING: + warningExceptions.add(toscaValidationIssue); + break; + default: + break; + } + }else{ + notAnalyzadExceptions.add(toscaValidationIssue); + } + }else{//notAnalyzed + notAnalyzadExceptions.add(toscaValidationIssue); + } + } + logErrors(csarPath); + } + + private void clearValidationIssuesLists(){ + notAnalyzadExceptions.clear(); + criticalExceptions.clear(); + warningExceptions.clear(); + } + + private void logErrors(String inputPath) throws JToscaException{ + //Warnings + int warningsCount = warningExceptions.size(); + if (warningsCount > 0) { + log.warn("####################################################################################################"); + log.warn("CSAR Warnings found! CSAR name - {}", inputPath); + log.warn("ToscaTemplate - verifyTemplate - {} Parsing Warning{} occurred...", warningsCount, (warningsCount > 1 ? "s" : "")); + for (JToscaValidationIssue info : warningExceptions) { + log.warn("JTosca Exception [{}]: {}. CSAR name - {}", info.getCode(),info.getMessage(), inputPath); + } + log.warn("####################################################################################################"); + } + //Criticals + int criticalsCount = criticalExceptions.size(); + if (criticalsCount > 0) { + log.error("####################################################################################################"); + log.error("ToscaTemplate - verifyTemplate - {} Parsing Critical{} occurred...", criticalsCount, (criticalsCount > 1 ? "s" : "")); + for (JToscaValidationIssue info : criticalExceptions) { + log.error("JTosca Exception [{}]: {}. CSAR name - {}", info.getCode(),info.getMessage(), inputPath); + } + throw new JToscaException(String.format("CSAR Validation Failed. CSAR name - {}. Please check logs for details.", inputPath), JToscaErrorCodes.CSAR_TOSCA_VALIDATION_ERROR.getValue()); + } + } + public List getCriticalExceptions() { + return criticalExceptions; + } + + public List getWarningExceptions() { + return warningExceptions; + } + + public List getNotAnalyzadExceptions() { + return notAnalyzadExceptions; + } + + + private void validateCsarVersion(String cSarVersion) throws SdcToscaParserException { ConformanceLevel level = configuration.getConformanceLevel(); String minVersion = level.getMinVersion(); String maxVersion = level.getMaxVersion(); @@ -86,6 +179,14 @@ public class SdcToscaParserFactory { } } + private boolean isMatchConformanceLevel(String ValidationIssueVersion, String cSarVersion){ + if (ValidationIssueVersion != null && cSarVersion != null) { + if ((GeneralUtility.conformanceLevelCompare(ValidationIssueVersion, cSarVersion) >= 0)) { + return true; + } + } + return false; + } private void throwConformanceLevelException(String minVersion, String maxVersion) throws SdcToscaParserException { ErrorInfo errorInfo = errorConfiguration.getErrorInfo(SdcToscaParserErrors.CONFORMANCE_LEVEL_ERROR.toString()); throw new SdcToscaParserException(String.format(errorInfo.getMessage(), minVersion, maxVersion), errorInfo.getCode()); @@ -95,4 +196,5 @@ public class SdcToscaParserFactory { ErrorInfo errorInfo = errorConfiguration.getErrorInfo(SdcToscaParserErrors.getSdcErrorByJToscaError(JToscaErrorCodes.getByCode(e.getCode())).toString()); throw new SdcToscaParserException(errorInfo.getMessage(), errorInfo.getCode()); } + } \ No newline at end of file diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java b/src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java index 44444d2..926b155 100644 --- a/src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java +++ b/src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java @@ -20,6 +20,7 @@ package org.openecomp.sdc.tosca.parser.utils; +import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; @@ -109,11 +110,13 @@ public class YamlToObjectConverter { public T convertFromString(String yamlContents, Class className) { T config = null; - - Yaml yaml = getYamlByClassName(className); - + Yaml yaml = new Yaml(); try { - config = yaml.loadAs(yamlContents, className); + Object data = yaml.load(yamlContents); + // convert it manually with jackson instead of using snakeyaml auto converter, + // because of problematic complex objects like JtoscaValidationIssueConfiguration + ObjectMapper mapper = new ObjectMapper(); + config = mapper.convertValue(data, className); } catch (Exception e){ log.error("Failed to convert YAML {} to object." , yamlContents, e); } diff --git a/src/main/resources/config/jtosca-validation-issue-configuration.yaml b/src/main/resources/config/jtosca-validation-issue-configuration.yaml new file mode 100644 index 0000000..f4bb949 --- /dev/null +++ b/src/main/resources/config/jtosca-validation-issue-configuration.yaml @@ -0,0 +1,49 @@ +# jTosca validation issues +#by error code, type the validation issue to be CRITICAL/WARNING +# since Conformance level considered to this type. for example: +#JE001: +# - issueType: WARNING +# sinceCsarConformanceLevel: 3.0 +# - issueType: WARNING +# sinceCsarConformanceLevel: 5.0 +validationIssues: + # TypeMismatchError + JE001: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + # MissingType + JE002: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #MissingRequiredFieldError + JE003: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #MissingRequiredFieldError2 + JE004: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #InvalidGroupTargetException + JE005: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #Schema definition of \"%s\" has \"status\" attribute with an invalid value + JE006: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #The unit \"%s\" is not valid + JE007: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #ValidationError + JE008: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #ValueError: Expected max 2 arguments for function \"get_input\" but received \"%s\"",args.size()) + JE009: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #MissingRequiredFieldError3 + JE010: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 \ No newline at end of file diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java index ad240b1..7cb99e3 100644 --- a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java +++ b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java @@ -924,7 +924,16 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest { assertEquals("VF_1_V_port_1", vfList.get(0).getMetaData().getValue("name")); } // endregion Added by QA - Continue with testings of resolve get_input - + + + @Test + public void testResolveGetInputArrayStructure() { + List vfcs = resolveGetInputCsarQA.getVfcListByVf("b5190df2-7880-4d6f-836f-56ab17e1b85b"); + Object propertyAsObject = resolveGetInputCsarQA.getNodeTemplatePropertyAsObject(vfcs.get(0), "compute_pd_server_name"); + assertEquals( ((ArrayList)propertyAsObject).get(0).toString(), "\"ZRDM1MOGX01MPD001\""); + propertyAsObject = resolveGetInputCsarQA.getNodeTemplatePropertyAsObject(vfcs.get(0), "port_pd01_port_ip_requirements"); + assertEquals( ((ArrayList)propertyAsObject).get(1), null); + } } diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java b/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java new file mode 100644 index 0000000..72bb5df --- /dev/null +++ b/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java @@ -0,0 +1,60 @@ +package org.openecomp.sdc.impl; + +import static org.testng.Assert.assertEquals; + +import java.util.List; +import java.util.stream.Collectors; + +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; +import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.testng.annotations.Test; + +public class ToscaParserValidationIssueTest extends SdcToscaParserBasicTest { + + @Test + public void testNoValidationIssues() throws SdcToscaParserException { + ISdcCsarHelper rainyCsarHelper = getCsarHelper("csars/service-ServiceFdnt-csar-rainy.csar");//conformance level 3.0 + + //List notAnalyzedReport = factory.getNotAnalyzadExceptions(); + //assertEquals( notAnalyzedReport.size(),0); + List warningsReport = factory.getWarningExceptions(); + assertEquals( warningsReport.size(),0); + List criticalsReport = factory.getCriticalExceptions(); + assertEquals( criticalsReport.size(),0); + } + @Test + public void testGetLowSinceConformanceLevel() throws SdcToscaParserException { + ISdcCsarHelper fdntCsarHelperWithInputs = getCsarHelper("csars/service-NfodService-csar.csar");//conformance level 3.0 + //Service level + + List notAnalyzedReport = factory.getNotAnalyzadExceptions(); + assertEquals( notAnalyzedReport.size(),10); + //JE003 high CL 4.0 + assertEquals( notAnalyzedReport.stream().filter(n->n.getCode().equals("JE003")).collect(Collectors.toList()).size(), 2); + assertEquals( notAnalyzedReport.stream().filter(n->n.getCode().equals("JE235")).collect(Collectors.toList()).size(), 7); + assertEquals( notAnalyzedReport.stream().filter(n->n.getCode().equals("JE236")).collect(Collectors.toList()).size(), 1); + List warningsReport = factory.getWarningExceptions(); + assertEquals( warningsReport.size(),14); + assertEquals( warningsReport.stream().filter(w->w.getCode().equals("JE006")).collect(Collectors.toList()).size(), 13); + //JE004 low CL 2.0 + assertEquals( warningsReport.stream().filter(w->w.getCode().equals("JE004")).collect(Collectors.toList()).size(), 1); + List criticalsReport = factory.getCriticalExceptions(); + assertEquals( criticalsReport.size(),0); + } + @Test + public void testMultiSinceConformanceLevelIssues() throws SdcToscaParserException { + ISdcCsarHelper Nfod2images = getCsarHelper("csars/service-Nfod2images-csar.csar");//conformance level 4.0 + List notAnalyzedReport = factory.getNotAnalyzadExceptions(); + assertEquals( notAnalyzedReport.size(),17); + List warningsReport = factory.getWarningExceptions(); + assertEquals( warningsReport.size(),0); + List criticalsReport = factory.getCriticalExceptions(); + assertEquals( criticalsReport.size(),24); + //JE006 multy values sinceCsarConformanceLevel + assertEquals( criticalsReport.stream().filter(c->c.getCode().equals("JE006")).collect(Collectors.toList()).size(), 18); + assertEquals( criticalsReport.stream().filter(c->c.getCode().equals("JE003")).collect(Collectors.toList()).size(), 6); + } + + +} diff --git a/src/test/resources/config/jtosca-validation-issue-configuration.yaml b/src/test/resources/config/jtosca-validation-issue-configuration.yaml new file mode 100644 index 0000000..1378ca7 --- /dev/null +++ b/src/test/resources/config/jtosca-validation-issue-configuration.yaml @@ -0,0 +1,57 @@ +# jTosca validation issues +#by error code, type the validation issue to be CRITICAL/WARNING +# since Conformance level considered to this type. for example: +#JE001: +# - type: WARNING, +# sinceCsarConformanceLevel: 3.0 +# - type: WARNING, +# sinceCsarConformanceLevel: 5.0 +validationIssues: + # TypeMismatchError + JE001: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + - issueType: CRITICAL + sinceCsarConformanceLevel: 4.0 + - issueType: WARNING + sinceCsarConformanceLevel: 5.0 + # MissingType + JE002: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #MissingRequiredFieldError + JE003: + - issueType: CRITICAL + sinceCsarConformanceLevel: 4.0 + #MissingRequiredFieldError2 + JE004: + - issueType: WARNING + sinceCsarConformanceLevel: 2.0 + #InvalidGroupTargetException + JE005: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #Schema definition of \"%s\" has \"status\" attribute with an invalid value + JE006: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + - issueType: CRITICAL + sinceCsarConformanceLevel: 4.0 + - issueType: WARNING + sinceCsarConformanceLevel: 5.0 + #The unit \"%s\" is not valid + JE007: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #ValidationError + JE008: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #ValueError: Expected max 2 arguments for function \"get_input\" but received \"%s\"",args.size()) + JE009: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 + #MissingRequiredFieldError3 + JE010: + - issueType: WARNING + sinceCsarConformanceLevel: 3.0 \ No newline at end of file diff --git a/src/test/resources/csars/service-Ipassignservice-csar.csar b/src/test/resources/csars/service-Ipassignservice-csar.csar index abdcd3e..c065fea 100644 Binary files a/src/test/resources/csars/service-Ipassignservice-csar.csar and b/src/test/resources/csars/service-Ipassignservice-csar.csar differ diff --git a/src/test/resources/csars/service-PortMirroring.csar b/src/test/resources/csars/service-PortMirroring.csar index 6186291..b90f3b1 100644 Binary files a/src/test/resources/csars/service-PortMirroring.csar and b/src/test/resources/csars/service-PortMirroring.csar differ diff --git a/src/test/resources/csars/service-ServiceForToscaParserTests-csar.csar b/src/test/resources/csars/service-ServiceForToscaParserTests-csar.csar index f6c7769..a3e6f70 100644 Binary files a/src/test/resources/csars/service-ServiceForToscaParserTests-csar.csar and b/src/test/resources/csars/service-ServiceForToscaParserTests-csar.csar differ diff --git a/src/test/resources/csars/service-nested-vfc-csar.csar b/src/test/resources/csars/service-nested-vfc-csar.csar index 0275520..5ee0802 100644 Binary files a/src/test/resources/csars/service-nested-vfc-csar.csar and b/src/test/resources/csars/service-nested-vfc-csar.csar differ diff --git a/src/test/resources/csars/service-resolve-get-input-csar.csar b/src/test/resources/csars/service-resolve-get-input-csar.csar index fe433f6..7c14159 100644 Binary files a/src/test/resources/csars/service-resolve-get-input-csar.csar and b/src/test/resources/csars/service-resolve-get-input-csar.csar differ diff --git a/src/test/resources/csars/service-resolve-get-input-csar_QA.csar b/src/test/resources/csars/service-resolve-get-input-csar_QA.csar index c35c890..37cb0f0 100644 Binary files a/src/test/resources/csars/service-resolve-get-input-csar_QA.csar and b/src/test/resources/csars/service-resolve-get-input-csar_QA.csar differ -- cgit 1.2.3-korg