summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/main/java/org/onap
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2019-03-15 14:34:03 +0100
committerZebek Bogumil <bogumil.zebek@nokia.com>2019-03-15 14:35:14 +0100
commitd8f859223948dcad8022ff72b794854305d493c8 (patch)
treeb9d366966c5869e17384cb7daf122a0c0a609e5a /csarvalidation/src/main/java/org/onap
parentccfd67e81d078ceaa196b97a9383ad2c570e69ab (diff)
Update TOSCA.meta parser
Change-Id: Id4cd3e3cfe09d9bdcb9df870d22884eb85a42e90 Issue-ID: VNFSDK-385 Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com>
Diffstat (limited to 'csarvalidation/src/main/java/org/onap')
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java24
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java9
2 files changed, 25 insertions, 8 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java b/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java
index c8f16e5..fdef030 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java
@@ -382,8 +382,8 @@ public class CSARArchive {
}
public static class CSARErrorInvalidEntryValueManifestNotFound extends CSARErrorInvalidEntryValue {
- public CSARErrorInvalidEntryValueManifestNotFound(String manifest, int lineNo) {
- super(TOSCA_Metadata__TOSCA_Meta__Entry_Manifest,
+ public CSARErrorInvalidEntryValueManifestNotFound(String manifest, int lineNo, String entryManifestArgumentName) {
+ super(entryManifestArgumentName,
TOSCA_Metadata__TOSCA_Meta,
lineNo,
manifest + " does not exist",
@@ -394,8 +394,8 @@ public class CSARArchive {
}
public static class CSARErrorInvalidEntryValueLogsNotFound extends CSARErrorInvalidEntryValue {
- public CSARErrorInvalidEntryValueLogsNotFound(String logs, int lineNo) {
- super(TOSCA_Metadata__TOSCA_Meta__Entry_Change_Log,
+ public CSARErrorInvalidEntryValueLogsNotFound(String logs, int lineNo, String entryChangeLogArgumentName) {
+ super(entryChangeLogArgumentName,
TOSCA_Metadata__TOSCA_Meta,
lineNo,
logs + " does not exist",
@@ -1095,21 +1095,21 @@ public class CSARArchive {
this.toscaMeta.getEntryDefinitionYaml(),
lineNo));
}
- } else if(key.equalsIgnoreCase(TOSCA_Metadata__TOSCA_Meta__Entry_Manifest)) {
+ } else if(key.equalsIgnoreCase(getEntryManifestParamName())) {
this.toscaMeta.setEntryManifestMf(value);
this.manifestMfFile = this.tempDir.resolve(this.toscaMeta.getEntryManifestMf()).toFile();
if (!this.manifestMfFile.exists()) {
errors.add(new CSARErrorInvalidEntryValueManifestNotFound(
this.toscaMeta.getEntryManifestMf(),
- lineNo));
+ lineNo, getEntryManifestParamName()));
}
- } else if(key.equalsIgnoreCase(TOSCA_Metadata__TOSCA_Meta__Entry_Change_Log)) {
+ } else if(key.equalsIgnoreCase(getEntryChangeLogParamName())) {
this.toscaMeta.setEntryChangeLog(value);
this.changeLogTxtFile = this.tempDir.resolve(this.toscaMeta.getEntryChangeLog()).toFile();
if (!this.changeLogTxtFile.exists()) {
errors.add(new CSARErrorInvalidEntryValueLogsNotFound(
this.toscaMeta.getEntryChangeLog(),
- lineNo));
+ lineNo, getEntryChangeLogParamName()));
}
} else if(key.equalsIgnoreCase(TOSCA_Metadata__TOSCA_Meta__Entry_Tests)) {
this.toscaMeta.setEntryTest(value);
@@ -1281,6 +1281,14 @@ public class CSARArchive {
}
}
+ String getEntryManifestParamName(){
+ return TOSCA_Metadata__TOSCA_Meta__Entry_Manifest;
+ }
+
+ String getEntryChangeLogParamName(){
+ return TOSCA_Metadata__TOSCA_Meta__Entry_Change_Log;
+ }
+
public void init(String csarPath) throws IOException {
this.tempDir = Paths.get(TEMP_DIR + File.separator + System.currentTimeMillis());
this.tempDir.toFile().mkdirs();
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java b/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java
index bb0a723..9dc966b 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java
@@ -45,4 +45,13 @@ public class PnfCSARArchive extends CSARArchive {
this.getErrors().addAll(nonManoArtifactsData.getValue());
}
+ @Override
+ String getEntryManifestParamName(){
+ return "ETSI-Entry-Manifest";
+ }
+
+ @Override
+ String getEntryChangeLogParamName(){
+ return "ETSI-Entry-Change-Log";
+ }
}