summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuli Shlosberg <ys9693@att.com>2018-03-06 17:57:45 +0200
committerYuli Shlosberg <ys9693@att.com>2018-03-11 10:16:03 +0200
commit4cea23f8111aa3d3532ec8d74351eccbf0ac44a5 (patch)
treee13926beacf7c0de8f942bb323684889dd263488
parent644e2206bcbaa87744b08b869ee8a378c9fae2fc (diff)
update SDC-TOSCA package namesv1.3.0
Change-Id: I496713bcf2551f3b5c7f629f89ffcb8b1954b489 Issue-ID: SDC-951 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
-rw-r--r--README.md10
-rw-r--r--pom.xml10
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/api/ConformanceLevel.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/api/ConformanceLevel.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/api/ISdcCsarHelper.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java)28
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/api/Version.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/api/Version.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/Configuration.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/Configuration.java)4
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/ConfigurationManager.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java)4
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/ErrorConfiguration.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/ErrorConfiguration.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/ErrorInfo.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/ErrorInfo.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/JToscaValidationIssueInfo.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/config/SdcToscaParserErrors.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/config/SdcToscaParserErrors.java)4
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/exceptions/SdcToscaParserException.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/exceptions/SdcToscaParserException.java)40
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/FilterType.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/impl/FilterType.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/JToscaValidationIssueType.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/SdcCsarHelperImpl.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java)26
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/SdcPropertyNames.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcPropertyNames.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java)400
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/impl/SdcTypes.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcTypes.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/utils/GeneralUtility.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/utils/GeneralUtility.java)2
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/utils/SdcToscaUtility.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/utils/SdcToscaUtility.java)38
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/utils/YamlToObjectConverter.java (renamed from src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java)2
-rw-r--r--src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java (renamed from src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java)11
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserConfigurationTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserConfigurationTest.java)10
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserErrorHandlingTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserErrorHandlingTest.java)6
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java)4
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserGroupTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserGroupTest.java)9
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserMetadataTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserMetadataTest.java)15
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java)14
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserReqAndCapTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserReqAndCapTest.java)14
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserServiceInputTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserServiceInputTest.java)4
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserSubsMappingsTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserSubsMappingsTest.java)15
-rw-r--r--src/test/java/org/onap/sdc/impl/ToscaParserValidationIssueTest.java (renamed from src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java)13
-rw-r--r--src/test/java/org/onap/sdc/impl/myTest.java (renamed from src/test/java/org/openecomp/sdc/impl/myTest.java)13
-rw-r--r--version.properties4
35 files changed, 357 insertions, 363 deletions
diff --git a/README.md b/README.md
index c49d25c..2e85eed 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# OpenECOMP SDC-Tosca
+# ONAP SDC-Tosca
---
@@ -6,21 +6,21 @@
# Introduction
-OpenECOMP SDC-Tosca is delivered as helper JAR that can be used by clients that work with SDC TOSCA CSAR files.
+ONAP SDC-Tosca is delivered as helper JAR that can be used by clients that work with SDC TOSCA CSAR files.
It parses the CSAR and returns the model object which represents the CSAR contents, through designated function calls with SDC flavour.
It uses the underlying generic JTOSCA parser.
-# Compiling OpenECOMP JTOSCA
+# Compiling ONAP JTOSCA
-OpenECOMP SDC-Tosca can be compiled easily using maven command: `mvn clean install`
+ONAP SDC-Tosca can be compiled easily using maven command: `mvn clean install`
The result is JAR file under "target" folder
# Getting Help
*** to be completed on release ***
-SDC@lists.openecomp.org
+SDC@lists.onap.org
SDC Javadoc and Maven site
diff --git a/pom.xml b/pom.xml
index 4c982e3..dd7ee59 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,11 +3,11 @@
<modelVersion>4.0.0</modelVersion>
- <groupId>org.openecomp.sdc.sdc-tosca</groupId>
+ <groupId>org.onap.sdc.sdc-tosca</groupId>
<artifactId>sdc-tosca</artifactId>
<name>sdc-sdc-tosca</name>
<description>SDC Tosca Parser JAR file for use by consumers</description>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
@@ -27,7 +27,7 @@
<!--<sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>-->
<sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
<nexus.proxy>https://nexus.onap.org</nexus.proxy>
- <sitePath>/content/sites/site/org/openecomp/sdc/sdc-tosca/${project.version}</sitePath>
+ <sitePath>/content/sites/site/org/onap/sdc/sdc-tosca/${project.version}</sitePath>
<snapshots.path>snapshots</snapshots.path>
<releases.path>releases</releases.path>
<staging.profile.id>176c31dfe190a</staging.profile.id>
@@ -110,9 +110,9 @@
<!-- jtosca Tosca Parser -->
<dependency>
- <groupId>org.openecomp.sdc.jtosca</groupId>
+ <groupId>org.onap.sdc.jtosca</groupId>
<artifactId>jtosca</artifactId>
- <version>1.2.2-SNAPSHOT</version>
+ <version>1.3.0</version>
</dependency>
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/api/ConformanceLevel.java b/src/main/java/org/onap/sdc/tosca/parser/api/ConformanceLevel.java
index a026938..4b4d646 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/api/ConformanceLevel.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/api/ConformanceLevel.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.tosca.parser.api;
+package org.onap.sdc.tosca.parser.api;
public class ConformanceLevel {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java b/src/main/java/org/onap/sdc/tosca/parser/api/ISdcCsarHelper.java
index df9e47d..76798d5 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/api/ISdcCsarHelper.java
@@ -16,18 +16,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.api;
+package org.onap.sdc.tosca.parser.api;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.tuple.Pair;
-import org.openecomp.sdc.tosca.parser.impl.FilterType;
-import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
-import org.openecomp.sdc.toscaparser.api.*;
-import org.openecomp.sdc.toscaparser.api.elements.Metadata;
-import org.openecomp.sdc.toscaparser.api.parameters.Input;
+import org.onap.sdc.tosca.parser.impl.SdcTypes;
+import org.onap.sdc.tosca.parser.impl.FilterType;
+import org.onap.sdc.toscaparser.api.*;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.parameters.Input;
public interface ISdcCsarHelper {
@@ -48,7 +48,7 @@ public interface ISdcCsarHelper {
public List<NodeTemplate> getServiceNodeTemplates();
/**
- * Get groups of a VF with type "org.openecomp.groups.VfModule".
+ * Get groups of a VF with type "org.onap.groups.VfModule".
*
* @param vfCustomizationUuid - customizationUuid of VF instance.
* @return list of vfModule groups.
@@ -192,11 +192,11 @@ public interface ISdcCsarHelper {
* For the below:<br><br>
*
* substitution_mappings:<br>
- &nbsp;&nbsp;type: org.openecomp.services.ViprATM<br>
+ &nbsp;&nbsp;type: org.onap.services.ViprATM<br>
calling<br>
getServiceSubstitutionMappingsTypeName()<br>
- will return "org.openecomp.services.ViprATM"
+ will return "org.onap.services.ViprATM"
* @return - the type name of the CSAR service's substitution mappings element
*/
public String getServiceSubstitutionMappingsTypeName();
@@ -245,7 +245,7 @@ public interface ISdcCsarHelper {
* For example, for this group definition:<br><br>
*
* ViprAtm..vIPR-ATM-Base..module-0:<br>
- &nbsp;&nbsp;type: org.openecomp.groups.VfModule<br>
+ &nbsp;&nbsp;type: org.onap.groups.VfModule<br>
&nbsp;&nbsp;.................<br>
&nbsp;&nbsp;members: [vIPR_ATM_Ha_Two, vIPR_ATM_Ha_One, vIPR_ATM_OAM_SG, vIPR_ATM_HA_TWO_SG, vIPR_ATM_HA_ONE_SG]<br><br>
@@ -268,12 +268,12 @@ public interface ISdcCsarHelper {
* For example, if we have the below two node templates in the vIPR VF:<br><br>
*
* oam_extCP:<br>
- &nbsp;&nbsp;type: org.openecomp.resources.cp.extCP<br>
+ &nbsp;&nbsp;type: org.onap.resources.cp.extCP<br>
&nbsp;&nbsp;requirements:<br>
&nbsp;&nbsp;&nbsp;&nbsp;- virtualBinding: vipr_atm_firewall<br><br>
*
* vipr_atm_firewall: <br>
- &nbsp;&nbsp;type: org.openecomp.resources.vfc.ViprAtm.abstract.nodes.heat.vipr_atm<br>
+ &nbsp;&nbsp;type: org.onap.resources.vfc.ViprAtm.abstract.nodes.heat.vipr_atm<br>
........<br><br>
*
@@ -301,10 +301,10 @@ public interface ISdcCsarHelper {
* For this node template:<br>
*
* vipr_atm_firewall: <br>
- &nbsp;&nbsp;type: org.openecomp.resources.vfc.ViprAtm.abstract.nodes.heat.vipr_atm<br>
+ &nbsp;&nbsp;type: org.onap.resources.vfc.ViprAtm.abstract.nodes.heat.vipr_atm<br>
........<br><br>
*
- * the function will return "org.openecomp.resources.vfc.ViprAtm.abstract.nodes.heat.vipr_atm"
+ * the function will return "org.onap.resources.vfc.ViprAtm.abstract.nodes.heat.vipr_atm"
*
* @param nodeTemplate - node template object
* @return - node type string.
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/api/Version.java b/src/main/java/org/onap/sdc/tosca/parser/api/Version.java
index 473e3a8..c485b18 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/api/Version.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/api/Version.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.tosca.parser.api;
+package org.onap.sdc.tosca.parser.api;
public class Version implements Comparable<Version> {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/Configuration.java b/src/main/java/org/onap/sdc/tosca/parser/config/Configuration.java
index 1d00d14..7135b6b 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/Configuration.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/Configuration.java
@@ -1,6 +1,6 @@
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
-import org.openecomp.sdc.tosca.parser.api.ConformanceLevel;
+import org.onap.sdc.tosca.parser.api.ConformanceLevel;
public class Configuration {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java b/src/main/java/org/onap/sdc/tosca/parser/config/ConfigurationManager.java
index f2fc903..e0b9dc8 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/ConfigurationManager.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/ConfigurationManager.java
@@ -1,8 +1,8 @@
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
import com.google.common.base.Charsets;
import com.google.common.io.Resources;
-import org.openecomp.sdc.tosca.parser.utils.YamlToObjectConverter;
+import org.onap.sdc.tosca.parser.utils.YamlToObjectConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/ErrorConfiguration.java b/src/main/java/org/onap/sdc/tosca/parser/config/ErrorConfiguration.java
index 59e8c6d..1b1f2e2 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/ErrorConfiguration.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/ErrorConfiguration.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
import java.util.Map;
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/ErrorInfo.java b/src/main/java/org/onap/sdc/tosca/parser/config/ErrorInfo.java
index 34983ef..52a92c4 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/ErrorInfo.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/ErrorInfo.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
public class ErrorInfo {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java b/src/main/java/org/onap/sdc/tosca/parser/config/JToscaValidationIssueInfo.java
index 31ab0a0..0e76b29 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/JToscaValidationIssueInfo.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/JToscaValidationIssueInfo.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
public class JToscaValidationIssueInfo {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java b/src/main/java/org/onap/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java
index ff13251..55912e6 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/JtoscaValidationIssueConfiguration.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/config/SdcToscaParserErrors.java b/src/main/java/org/onap/sdc/tosca/parser/config/SdcToscaParserErrors.java
index ce84a9c..730142c 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/config/SdcToscaParserErrors.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/config/SdcToscaParserErrors.java
@@ -1,9 +1,9 @@
-package org.openecomp.sdc.tosca.parser.config;
+package org.onap.sdc.tosca.parser.config;
import java.util.EnumMap;
import java.util.Map;
-import org.openecomp.sdc.toscaparser.api.utils.JToscaErrorCodes;
+import org.onap.sdc.toscaparser.api.utils.JToscaErrorCodes;
public enum SdcToscaParserErrors {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/exceptions/SdcToscaParserException.java b/src/main/java/org/onap/sdc/tosca/parser/exceptions/SdcToscaParserException.java
index a7fd99d..5576750 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/exceptions/SdcToscaParserException.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/exceptions/SdcToscaParserException.java
@@ -1,20 +1,20 @@
-package org.openecomp.sdc.tosca.parser.exceptions;
-
-public class SdcToscaParserException extends Exception {
-
- private static final long serialVersionUID = 626014844866501196L;
- private String code;
-
- public SdcToscaParserException(String string, String code) {
- super(string);
- this.code = code;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-}
+package org.onap.sdc.tosca.parser.exceptions;
+
+public class SdcToscaParserException extends Exception {
+
+ private static final long serialVersionUID = 626014844866501196L;
+ private String code;
+
+ public SdcToscaParserException(String string, String code) {
+ super(string);
+ this.code = code;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+}
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/FilterType.java b/src/main/java/org/onap/sdc/tosca/parser/impl/FilterType.java
index 0f7810f..09c3c5c 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/FilterType.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/FilterType.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.tosca.parser.impl;
+package org.onap.sdc.tosca.parser.impl;
public enum FilterType {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java b/src/main/java/org/onap/sdc/tosca/parser/impl/JToscaValidationIssueType.java
index 1e68c51..fb13867 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/JToscaValidationIssueType.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/JToscaValidationIssueType.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.tosca.parser.impl;
+package org.onap.sdc.tosca.parser.impl;
public enum JToscaValidationIssueType {
CRITICAL,
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
index 901b315..0c42a4f 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.impl;
+package org.onap.sdc.tosca.parser.impl;
import java.util.*;
import java.util.Map.Entry;
@@ -26,22 +26,18 @@ import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.config.ConfigurationManager;
-import org.openecomp.sdc.toscaparser.api.CapabilityAssignments;
-import org.openecomp.sdc.tosca.parser.utils.GeneralUtility;
-import org.openecomp.sdc.toscaparser.api.RequirementAssignments;
-import org.openecomp.sdc.tosca.parser.utils.SdcToscaUtility;
-import org.openecomp.sdc.toscaparser.api.*;
-import org.openecomp.sdc.toscaparser.api.elements.Metadata;
-import org.openecomp.sdc.toscaparser.api.elements.NodeType;
-import org.openecomp.sdc.toscaparser.api.functions.Function;
-import org.openecomp.sdc.toscaparser.api.parameters.Input;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.config.ConfigurationManager;
+import org.onap.sdc.tosca.parser.utils.GeneralUtility;
+import org.onap.sdc.tosca.parser.utils.SdcToscaUtility;
+import org.onap.sdc.toscaparser.api.*;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.elements.NodeType;
+import org.onap.sdc.toscaparser.api.functions.Function;
+import org.onap.sdc.toscaparser.api.parameters.Input;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID;
-
public class SdcCsarHelperImpl implements ISdcCsarHelper {
private static final String PATH_DELIMITER = "#";
@@ -884,7 +880,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
//Assumed to be unique property for the list
private NodeTemplate getNodeTemplateByCustomizationUuid(List<NodeTemplate> nodeTemplates, String customizationId) {
if (customizationId != null) {
- Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> (x.getMetaData() != null && customizationId.equals(x.getMetaData().getValue(PROPERTY_NAME_CUSTOMIZATIONUUID)))).findFirst();
+ Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> (x.getMetaData() != null && customizationId.equals(x.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)))).findFirst();
return findFirst.isPresent() ? findFirst.get() : null;
}
else {
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcPropertyNames.java b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcPropertyNames.java
index 7d34c6f..7235593 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcPropertyNames.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcPropertyNames.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.impl;
+package org.onap.sdc.tosca.parser.impl;
public class SdcPropertyNames {
public static String PROPERTY_NAME_INVARIANTUUID = "invariantUUID";
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java
index 9fc59f2..bc8d1b1 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcToscaParserFactory.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcToscaParserFactory.java
@@ -1,199 +1,203 @@
-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 ConfigurationManager configurationManager;
- private static volatile SdcToscaParserFactory instance;
- private List<JToscaValidationIssue> criticalExceptions = new ArrayList<>();
- private List<JToscaValidationIssue> warningExceptions = new ArrayList<>();
- private List<JToscaValidationIssue> notAnalyzadExceptions = new ArrayList<>();
- private SdcToscaParserFactory() {}
-
- /**
- * Get an SdcToscaParserFactory instance.
- * @return SdcToscaParserFactory instance.
- */
- public static SdcToscaParserFactory getInstance() {
- if (instance == null) {
- synchronized (SdcToscaParserFactory.class) {
- if (instance == null) {
- instance = new SdcToscaParserFactory();
- configurationManager = ConfigurationManager.getInstance();
- }
- }
- }
- return instance;
- }
-
- public static void setConfigurationManager(ConfigurationManager configurationManager) {
- SdcToscaParserFactory.configurationManager = configurationManager;
- }
-
- /**
- * Get an ISdcCsarHelper object for this CSAR file.
- *
- * @param csarPath - the absolute path to CSAR file.
- * @return ISdcCsarHelper object.
- * @throws SdcToscaParserException - in case the path or CSAR are invalid.
- */
- public ISdcCsarHelper getSdcCsarHelper(String csarPath) throws SdcToscaParserException {
- return init(csarPath, true);
- }
-
- /**
- * Get an ISdcCsarHelper object for this CSAR file.
- *
- * @param csarPath - the absolute path to CSAR file.
- * @param resolveGetInput - resolve get_input properties
- * @return ISdcCsarHelper object.
- * @throws SdcToscaParserException - in case the path or CSAR are invalid.
- */
- public ISdcCsarHelper getSdcCsarHelper(String csarPath, boolean resolveGetInput) throws SdcToscaParserException {
- return init(csarPath, resolveGetInput);
- }
-
- private ISdcCsarHelper init(String csarPath, boolean resolveGetInput) throws SdcToscaParserException {
- synchronized (SdcToscaParserFactory.class) {
- ToscaTemplate tosca = null;
- try {
- tosca = new ToscaTemplate(csarPath, null, true, null, resolveGetInput);
- } catch (JToscaException e) {
- throwSdcToscaParserException(e);
- }
- SdcCsarHelperImpl sdcCsarHelperImpl = new SdcCsarHelperImpl(tosca, configurationManager);
- String cSarConformanceLevel = sdcCsarHelperImpl.getConformanceLevel();
- validateCsarVersion(cSarConformanceLevel);
- try {
- handleErrorsByTypes(csarPath, cSarConformanceLevel);
- } catch (JToscaException e) {
- throwSdcToscaParserException(e);
- }
- return sdcCsarHelperImpl;
- }
- }
-
- private void handleErrorsByTypes(String csarPath, String cSarConformanceLevel) throws JToscaException {
- clearValidationIssuesLists();
- for(JToscaValidationIssue toscaValidationIssue : ThreadLocalsHolder.getCollector().getValidationIssues().values()){
- List<JToscaValidationIssueInfo> issueInfos = configurationManager.getJtoscaValidationIssueConfiguration().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<JToscaValidationIssue> getCriticalExceptions() {
- return criticalExceptions;
- }
-
- public List<JToscaValidationIssue> getWarningExceptions() {
- return warningExceptions;
- }
-
- public List<JToscaValidationIssue> getNotAnalyzadExceptions() {
- return notAnalyzadExceptions;
- }
-
-
- 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);
- }
- } else {
- throwConformanceLevelException(minVersion, maxVersion);
- }
- }
-
- 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 = configurationManager.getErrorConfiguration().getErrorInfo(SdcToscaParserErrors.CONFORMANCE_LEVEL_ERROR.toString());
- throw new SdcToscaParserException(String.format(errorInfo.getMessage(), minVersion, maxVersion), errorInfo.getCode());
- }
-
- private void throwSdcToscaParserException(JToscaException e) throws SdcToscaParserException {
- ErrorInfo errorInfo = configurationManager.getErrorConfiguration().getErrorInfo(SdcToscaParserErrors.getSdcErrorByJToscaError(JToscaErrorCodes.getByCode(e.getCode())).toString());
- throw new SdcToscaParserException(errorInfo.getMessage(), errorInfo.getCode());
- }
-
-
-
+package org.onap.sdc.tosca.parser.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.onap.sdc.tosca.parser.api.ConformanceLevel;
+import org.onap.sdc.tosca.parser.config.ConfigurationManager;
+import org.onap.sdc.tosca.parser.config.ErrorInfo;
+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;
+import org.onap.sdc.toscaparser.api.common.JToscaException;
+import org.onap.sdc.toscaparser.api.utils.JToscaErrorCodes;
+import org.onap.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 ConfigurationManager configurationManager;
+ private static volatile SdcToscaParserFactory instance;
+ private List<JToscaValidationIssue> criticalExceptions = new ArrayList<>();
+ private List<JToscaValidationIssue> warningExceptions = new ArrayList<>();
+ private List<JToscaValidationIssue> notAnalyzadExceptions = new ArrayList<>();
+ private SdcToscaParserFactory() {}
+
+ /**
+ * Get an SdcToscaParserFactory instance.
+ * @return SdcToscaParserFactory instance.
+ */
+ public static SdcToscaParserFactory getInstance() {
+ if (instance == null) {
+ synchronized (SdcToscaParserFactory.class) {
+ if (instance == null) {
+ instance = new SdcToscaParserFactory();
+ configurationManager = ConfigurationManager.getInstance();
+ }
+ }
+ }
+ return instance;
+ }
+
+ public static void setConfigurationManager(ConfigurationManager configurationManager) {
+ SdcToscaParserFactory.configurationManager = configurationManager;
+ }
+
+ /**
+ * Get an ISdcCsarHelper object for this CSAR file.
+ *
+ * @param csarPath - the absolute path to CSAR file.
+ * @return ISdcCsarHelper object.
+ * @throws SdcToscaParserException - in case the path or CSAR are invalid.
+ */
+ public ISdcCsarHelper getSdcCsarHelper(String csarPath) throws SdcToscaParserException {
+ return init(csarPath, true);
+ }
+
+ /**
+ * Get an ISdcCsarHelper object for this CSAR file.
+ *
+ * @param csarPath - the absolute path to CSAR file.
+ * @param resolveGetInput - resolve get_input properties
+ * @return ISdcCsarHelper object.
+ * @throws SdcToscaParserException - in case the path or CSAR are invalid.
+ */
+ public ISdcCsarHelper getSdcCsarHelper(String csarPath, boolean resolveGetInput) throws SdcToscaParserException {
+ return init(csarPath, resolveGetInput);
+ }
+
+ private ISdcCsarHelper init(String csarPath, boolean resolveGetInput) throws SdcToscaParserException {
+ synchronized (SdcToscaParserFactory.class) {
+ ToscaTemplate tosca = null;
+ try {
+ tosca = new ToscaTemplate(csarPath, null, true, null, resolveGetInput);
+ } catch (JToscaException e) {
+ throwSdcToscaParserException(e);
+ }
+ SdcCsarHelperImpl sdcCsarHelperImpl = new SdcCsarHelperImpl(tosca, configurationManager);
+ String cSarConformanceLevel = sdcCsarHelperImpl.getConformanceLevel();
+ validateCsarVersion(cSarConformanceLevel);
+ try {
+ handleErrorsByTypes(csarPath, cSarConformanceLevel);
+ } catch (JToscaException e) {
+ throwSdcToscaParserException(e);
+ }
+ return sdcCsarHelperImpl;
+ }
+ }
+
+ private void handleErrorsByTypes(String csarPath, String cSarConformanceLevel) throws JToscaException {
+ clearValidationIssuesLists();
+ for(JToscaValidationIssue toscaValidationIssue : ThreadLocalsHolder.getCollector().getValidationIssues().values()){
+ List<JToscaValidationIssueInfo> issueInfos = configurationManager.getJtoscaValidationIssueConfiguration().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<JToscaValidationIssue> getCriticalExceptions() {
+ return criticalExceptions;
+ }
+
+ public List<JToscaValidationIssue> getWarningExceptions() {
+ return warningExceptions;
+ }
+
+ public List<JToscaValidationIssue> getNotAnalyzadExceptions() {
+ return notAnalyzadExceptions;
+ }
+
+
+ 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);
+ }
+ } else {
+ throwConformanceLevelException(minVersion, maxVersion);
+ }
+ }
+
+ 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 = configurationManager.getErrorConfiguration().getErrorInfo(SdcToscaParserErrors.CONFORMANCE_LEVEL_ERROR.toString());
+ throw new SdcToscaParserException(String.format(errorInfo.getMessage(), minVersion, maxVersion), errorInfo.getCode());
+ }
+
+ private void throwSdcToscaParserException(JToscaException e) throws SdcToscaParserException {
+ ErrorInfo errorInfo = configurationManager.getErrorConfiguration().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/impl/SdcTypes.java b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcTypes.java
index aeb4ee0..9daf0ef 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcTypes.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/impl/SdcTypes.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.impl;
+package org.onap.sdc.tosca.parser.impl;
import java.util.Arrays;
import java.util.List;
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/utils/GeneralUtility.java b/src/main/java/org/onap/sdc/tosca/parser/utils/GeneralUtility.java
index 84150f6..cddccd3 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/utils/GeneralUtility.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/utils/GeneralUtility.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.tosca.parser.utils;
+package org.onap.sdc.tosca.parser.utils;
import java.util.Arrays;
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/utils/SdcToscaUtility.java b/src/main/java/org/onap/sdc/tosca/parser/utils/SdcToscaUtility.java
index 77f7d55..57f4187 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/utils/SdcToscaUtility.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/utils/SdcToscaUtility.java
@@ -1,19 +1,19 @@
-package org.openecomp.sdc.tosca.parser.utils;
-
-import java.util.regex.Pattern;
-
-public class SdcToscaUtility {
-
- public final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
-
- public static String normaliseComponentInstanceName(String name) {
- String normalizedName = name.toLowerCase();
- normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
- String[] split = normalizedName.split(" ");
- StringBuffer sb = new StringBuffer();
- for (String splitElement : split) {
- sb.append(splitElement);
- }
- return sb.toString();
- }
-}
+package org.onap.sdc.tosca.parser.utils;
+
+import java.util.regex.Pattern;
+
+public class SdcToscaUtility {
+
+ public final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
+
+ public static String normaliseComponentInstanceName(String name) {
+ String normalizedName = name.toLowerCase();
+ normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
+ String[] split = normalizedName.split(" ");
+ StringBuffer sb = new StringBuffer();
+ for (String splitElement : split) {
+ sb.append(splitElement);
+ }
+ return sb.toString();
+ }
+}
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java b/src/main/java/org/onap/sdc/tosca/parser/utils/YamlToObjectConverter.java
index 926b155..89963d8 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/utils/YamlToObjectConverter.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/utils/YamlToObjectConverter.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.sdc.tosca.parser.utils;
+package org.onap.sdc.tosca.parser.utils;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
diff --git a/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java b/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java
index 1695671..39f5190 100644
--- a/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java
+++ b/src/test/java/org/onap/sdc/impl/SdcToscaParserBasicTest.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import java.io.File;
import java.io.IOException;
@@ -8,12 +8,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.openecomp.sdc.toscaparser.api.common.JToscaException;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.onap.sdc.toscaparser.api.common.JToscaException;
import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSuite;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserConfigurationTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserConfigurationTest.java
index b57522d..6c0455b 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserConfigurationTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserConfigurationTest.java
@@ -1,10 +1,10 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
-import org.openecomp.sdc.tosca.parser.config.ErrorConfiguration;
-import org.openecomp.sdc.tosca.parser.config.JtoscaValidationIssueConfiguration;
+import org.onap.sdc.tosca.parser.config.ErrorConfiguration;
+import org.onap.sdc.tosca.parser.config.JtoscaValidationIssueConfiguration;
import org.testng.annotations.Test;
-import org.openecomp.sdc.tosca.parser.config.Configuration;
-import org.openecomp.sdc.tosca.parser.config.ConfigurationManager;
+import org.onap.sdc.tosca.parser.config.Configuration;
+import org.onap.sdc.tosca.parser.config.ConfigurationManager;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserErrorHandlingTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserErrorHandlingTest.java
index 8451a58..d022a1a 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserErrorHandlingTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserErrorHandlingTest.java
@@ -1,12 +1,12 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
import java.io.File;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.toscaparser.api.utils.JToscaErrorCodes;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.toscaparser.api.utils.JToscaErrorCodes;
/*put(JToscaErrorCodes.GENERAL_ERROR, GENERAL_ERROR);
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java
index 9f349ae..d4ad73d 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java
@@ -1,7 +1,7 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import org.testng.annotations.Test;
-import org.openecomp.sdc.tosca.parser.utils.GeneralUtility;
+import org.onap.sdc.tosca.parser.utils.GeneralUtility;
import static org.testng.Assert.assertTrue;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserGroupTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserGroupTest.java
index 8435c12..540236c 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserGroupTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserGroupTest.java
@@ -1,11 +1,10 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import org.testng.annotations.Test;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.toscaparser.api.Group;
-import org.openecomp.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.toscaparser.api.Group;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
-import java.util.Arrays;
import java.util.List;
import static org.testng.Assert.*;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserMetadataTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserMetadataTest.java
index 1746042..8487dec 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserMetadataTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserMetadataTest.java
@@ -1,10 +1,11 @@
-package org.openecomp.sdc.impl;
-
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.config.ConfigurationManager;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
-import org.openecomp.sdc.toscaparser.api.elements.Metadata;
+package org.onap.sdc.impl;
+
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.config.ConfigurationManager;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.testng.annotations.Test;
import java.util.List;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java
index 04675b4..0692ebe 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserNodeTemplateTest.java
@@ -1,4 +1,4 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -9,12 +9,12 @@ import static org.hamcrest.CoreMatchers.is;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.tuple.Pair;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.tosca.parser.impl.FilterType;
-import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
-import org.openecomp.sdc.toscaparser.api.Group;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
-import org.openecomp.sdc.toscaparser.api.Property;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.tosca.parser.impl.FilterType;
+import org.onap.sdc.tosca.parser.impl.SdcTypes;
+import org.onap.sdc.toscaparser.api.Group;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.Property;
import org.testng.annotations.Test;
import fj.data.fingertrees.Node;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserReqAndCapTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserReqAndCapTest.java
index 8d800e1..75f8962 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserReqAndCapTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserReqAndCapTest.java
@@ -1,11 +1,11 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
-import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
-import org.openecomp.sdc.toscaparser.api.CapabilityAssignments;
-import org.openecomp.sdc.toscaparser.api.CapabilityAssignment;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
-import org.openecomp.sdc.toscaparser.api.RequirementAssignments;
-import org.openecomp.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.tosca.parser.impl.SdcTypes;
+import org.onap.sdc.toscaparser.api.CapabilityAssignments;
+import org.onap.sdc.toscaparser.api.CapabilityAssignment;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.RequirementAssignments;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.testng.annotations.Test;
import java.util.List;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserServiceInputTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserServiceInputTest.java
index 75f904f..b11487f 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserServiceInputTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserServiceInputTest.java
@@ -1,7 +1,7 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import org.testng.annotations.Test;
-import org.openecomp.sdc.toscaparser.api.parameters.Input;
+import org.onap.sdc.toscaparser.api.parameters.Input;
import java.util.List;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserSubsMappingsTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserSubsMappingsTest.java
index 7570ced..cbd8e8a 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserSubsMappingsTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserSubsMappingsTest.java
@@ -1,19 +1,18 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import java.util.*;
-import java.util.stream.Collectors;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.toscaparser.api.CapabilityAssignment;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
-import org.openecomp.sdc.toscaparser.api.RequirementAssignment;
-import org.openecomp.sdc.toscaparser.api.elements.CapabilityTypeDef;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.toscaparser.api.CapabilityAssignment;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.RequirementAssignment;
+import org.onap.sdc.toscaparser.api.elements.CapabilityTypeDef;
//import org.testng.ReporterConfig.Property;
import org.testng.annotations.Test;
-import org.openecomp.sdc.toscaparser.api.Property;
+import org.onap.sdc.toscaparser.api.Property;
//import static org.junit.Assert.assertEquals;
//import static org.junit.Assert.assertNull;
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserValidationIssueTest.java
index 60119c4..0fc42f7 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java
+++ b/src/test/java/org/onap/sdc/impl/ToscaParserValidationIssueTest.java
@@ -1,17 +1,14 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
-import org.apache.commons.io.IOUtils;
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.config.ConfigurationManager;
-import org.openecomp.sdc.tosca.parser.config.JtoscaValidationIssueConfiguration;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.config.ConfigurationManager;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
-import java.net.URL;
import java.util.List;
import java.util.stream.Collectors;
diff --git a/src/test/java/org/openecomp/sdc/impl/myTest.java b/src/test/java/org/onap/sdc/impl/myTest.java
index 2f0da7f..4833f6f 100644
--- a/src/test/java/org/openecomp/sdc/impl/myTest.java
+++ b/src/test/java/org/onap/sdc/impl/myTest.java
@@ -1,15 +1,14 @@
-package org.openecomp.sdc.impl;
+package org.onap.sdc.impl;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.testng.annotations.Test;
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
import java.io.File;
-import java.util.List;
-import static org.openecomp.sdc.impl.SdcToscaParserBasicTest.getCsarHelper;
+import static org.onap.sdc.impl.SdcToscaParserBasicTest.getCsarHelper;
public class myTest {
diff --git a/version.properties b/version.properties
index 4d0ed8b..235314e 100644
--- a/version.properties
+++ b/version.properties
@@ -4,8 +4,8 @@
# because they are used in Jenkins, whose plug-in doesn't support
major=1
-minor=2
-patch=3
+minor=3
+patch=0
base_version=${major}.${minor}.${patch}