summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java12
-rw-r--r--src/main/resources/config/configuration.yaml2
-rw-r--r--src/main/resources/config/error-configuration.yaml2
3 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java
index bc8d1b1..3293a58 100644
--- a/src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java
@@ -10,7 +10,6 @@ import org.onap.sdc.tosca.parser.config.JToscaValidationIssueInfo;
import org.onap.sdc.tosca.parser.config.SdcToscaParserErrors;
import org.onap.sdc.tosca.parser.utils.GeneralUtility;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.onap.sdc.tosca.parser.config.*;
import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
import org.onap.sdc.toscaparser.api.ToscaTemplate;
import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue;
@@ -170,13 +169,12 @@ public class SdcToscaParserFactory {
private void validateCsarVersion(String cSarVersion) throws SdcToscaParserException {
ConformanceLevel level = configurationManager.getConfiguration().getConformanceLevel();
String minVersion = level.getMinVersion();
- String maxVersion = level.getMaxVersion();
if (cSarVersion != null) {
- if ((GeneralUtility.conformanceLevelCompare(cSarVersion, minVersion) < 0) || (GeneralUtility.conformanceLevelCompare(cSarVersion, maxVersion) > 0)) {
- throwConformanceLevelException(minVersion, maxVersion);
+ if (GeneralUtility.conformanceLevelCompare(cSarVersion, minVersion) < 0) {
+ throwConformanceLevelException(minVersion);
}
} else {
- throwConformanceLevelException(minVersion, maxVersion);
+ throwConformanceLevelException(minVersion);
}
}
@@ -188,9 +186,9 @@ public class SdcToscaParserFactory {
}
return false;
}
- private void throwConformanceLevelException(String minVersion, String maxVersion) throws SdcToscaParserException {
+ private void throwConformanceLevelException(String minVersion) throws SdcToscaParserException {
ErrorInfo errorInfo = configurationManager.getErrorConfiguration().getErrorInfo(SdcToscaParserErrors.CONFORMANCE_LEVEL_ERROR.toString());
- throw new SdcToscaParserException(String.format(errorInfo.getMessage(), minVersion, maxVersion), errorInfo.getCode());
+ throw new SdcToscaParserException(String.format(errorInfo.getMessage(), minVersion), errorInfo.getCode());
}
private void throwSdcToscaParserException(JToscaException e) throws SdcToscaParserException {
diff --git a/src/main/resources/config/configuration.yaml b/src/main/resources/config/configuration.yaml
index e5e28f2..9872ff0 100644
--- a/src/main/resources/config/configuration.yaml
+++ b/src/main/resources/config/configuration.yaml
@@ -1,3 +1,3 @@
conformanceLevel:
minVersion: '3.0'
- maxVersion: '8.0' \ No newline at end of file
+ maxVersion: '9.0' \ No newline at end of file
diff --git a/src/main/resources/config/error-configuration.yaml b/src/main/resources/config/error-configuration.yaml
index 58d1de3..ff9c6ed 100644
--- a/src/main/resources/config/error-configuration.yaml
+++ b/src/main/resources/config/error-configuration.yaml
@@ -13,7 +13,7 @@ errors:
CONFORMANCE_LEVEL_ERROR: {
code: TP0003,
failOnError: true,
- message: "Error: CSAR version is unsupported. Parser supports versions %s to %s."
+ message: "Error: CSAR version is unsupported. Parser supports versions from %s."
}
GENERAL_ERROR: {
code: TP0004,