[SDC-20] fix sdc csar for tosca parser dev2dev 95/4195/1
authorPavel Aharoni <pa0916@att.com>
Sun, 14 May 2017 14:56:49 +0000 (17:56 +0300)
committerPavel Aharoni <pa0916@att.com>
Sun, 14 May 2017 14:59:26 +0000 (17:59 +0300)
Change-Id: I7ea8c3a9cc29be93c5cf6fb79b2b3dc23fb0bb0a
Signed-off-by: Pavel Aharoni <pa0916@att.com>
jtosca/pom.xml
jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/elements/NodeType.java
pom.xml
sdc-distribution-ci/pom.xml
sdc-distribution-ci/src/main/java/org/openecomp/test/CsarToscaTester.java
sdc-distribution-client/pom.xml
sdc-tosca-parser/pom.xml
sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java

index ce50fec..3ef6a3c 100644 (file)
@@ -5,11 +5,11 @@
        <parent>
                <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
                <artifactId>sdc-main-distribution-client</artifactId>
-               <version>1.1.9-SNAPSHOT</version>
+               <version>1.1.13-SNAPSHOT</version>
        </parent>
        
        <artifactId>jtosca</artifactId>
-       <version>0.1.3-SNAPSHOT</version>
+       <version>0.1.6-SNAPSHOT</version>
        
        <dependencies>
        
index 853b8ac..e7dc464 100644 (file)
@@ -106,7 +106,10 @@ public class NodeType extends StatefulEntityType {
                             // the capability type
                                        String captype = (String)req.get("capability");
                                        String value = _getNodeTypeByCap(captype);
-                                       relation = _getRelation(key,value);
+                                       String getRelation = _getRelation(key,value);
+                                       if (getRelation != null)  {
+                                               relation = getRelation;
+                                       }
                                        keyword = key;
                                        nodeType = value;
                                }
diff --git a/pom.xml b/pom.xml
index 2b3583e..51bcfe5 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
 
        <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
        <artifactId>sdc-main-distribution-client</artifactId>
-       <version>1.1.10-SNAPSHOT</version>
+       <version>1.1.13-SNAPSHOT</version>
        <packaging>pom</packaging>
 
        <modules>
@@ -35,6 +35,8 @@
                <logback.version>1.1.2</logback.version>
                <junit.version>4.12</junit.version>
                <snakeyaml.version>1.14</snakeyaml.version>
+               <guava.version>21.0</guava.version>
+               
                
                <sonar.skipDesign>true</sonar.skipDesign>
                <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
index f76457c..68cbd9c 100644 (file)
@@ -6,7 +6,7 @@
        <parent>
                <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
                <artifactId>sdc-main-distribution-client</artifactId>
-               <version>1.1.10-SNAPSHOT</version>
+               <version>1.1.13-SNAPSHOT</version>
        </parent>
 
        <artifactId>sdc-distribution-ci</artifactId>
index 404f6d2..068ef24 100644 (file)
@@ -40,9 +40,9 @@ public class CsarToscaTester {
                        List<NodeTemplate> vflist = csarHelper.getServiceVfList();\r
                        List<Input> inputs = csarHelper.getServiceInputs();\r
                        List<String> exceptionReport = ExceptionCollector.getCriticalsReport();\r
-                       System.out.println("CRITICALS during CSAR parsing are: " + (exceptionReport != null ? exceptionReport.toString() : "none"));\r
+                       //System.out.println("CRITICALS during CSAR parsing are: " + (exceptionReport != null ? exceptionReport.toString() : "none"));\r
                        List<String> warningsReport = ExceptionCollector.getWarningsReport();\r
-                       System.out.println("WARNINGS during CSAR parsing are: " + (warningsReport != null ? warningsReport.toString() : "none"));\r
+                       //System.out.println("WARNINGS during CSAR parsing are: " + (warningsReport != null ? warningsReport.toString() : "none"));\r
                        \r
                                \r
                        if (!exceptionReport.isEmpty())  {\r
index d7f0ea7..2047ff3 100644 (file)
@@ -6,7 +6,7 @@
        <parent>
                <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
                <artifactId>sdc-main-distribution-client</artifactId>
-               <version>1.1.10-SNAPSHOT</version>
+               <version>1.1.13-SNAPSHOT</version>
        </parent>
 
        <artifactId>sdc-distribution-client</artifactId>
                <dependency>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
-                       <version>15.0</version>
+                       <version>${guava.version}</version>
                        <scope>test</scope>
                </dependency>
 
index f027a96..d6b0bb8 100644 (file)
@@ -6,14 +6,14 @@
        <parent>\r
                <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>\r
                <artifactId>sdc-main-distribution-client</artifactId>\r
-               <version>1.1.10-SNAPSHOT</version>\r
+               <version>1.1.13-SNAPSHOT</version>\r
        </parent>\r
 \r
        <artifactId>sdc-tosca-parser</artifactId>\r
        <name>SDC Tosca Parser</name>\r
        <description>Tosca Parser JAR file for use by consumers</description>\r
        <packaging>jar</packaging>\r
-       \r
+\r
 \r
        <dependencies>\r
 \r
@@ -58,7 +58,7 @@
                        <version>${snakeyaml.version}</version>\r
                        <scope>compile</scope>\r
                </dependency>\r
-               \r
+\r
                <!-- Apache Commons -->\r
                <dependency>\r
                        <groupId>org.apache.commons</groupId>\r
                        <version>3.5</version>\r
                        <scope>compile</scope>\r
                </dependency>\r
+               \r
+               <dependency>\r
+                       <groupId>com.google.guava</groupId>\r
+                       <artifactId>guava</artifactId>\r
+                       <version>${guava.version}</version>\r
+                       <scope>compile</scope>\r
+               </dependency>\r
 \r
                <!-- jtosca Tosca Parser -->\r
                <dependency>\r
                        <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>\r
                        <artifactId>jtosca</artifactId>\r
-                       <version>0.1.3-SNAPSHOT</version>\r
+                       <version>0.1.6-SNAPSHOT</version>\r
                </dependency>\r
 \r
 \r
                        <scope>test</scope>\r
                </dependency>\r
 \r
-               <!--<dependency>-->\r
-                       <!--<groupId>junit</groupId>-->\r
-                       <!--<artifactId>junit</artifactId>-->\r
-                       <!--<version>4.12</version>-->\r
-                       <!--<scope>test</scope>-->\r
-               <!--</dependency>-->\r
+               <!--<dependency> -->\r
+               <!--<groupId>junit</groupId> -->\r
+               <!--<artifactId>junit</artifactId> -->\r
+               <!--<version>4.12</version> -->\r
+               <!--<scope>test</scope> -->\r
+               <!--</dependency> -->\r
 \r
                <dependency>\r
                        <groupId>org.testng</groupId>\r
                        <scope>test</scope>\r
                </dependency>\r
 \r
-               <dependency>\r
-                       <groupId>com.google.guava</groupId>\r
-                       <artifactId>guava</artifactId>\r
-                       <version>15.0</version>\r
-                       <!--<scope>test</scope>-->\r
-               </dependency>\r
-               \r
-               <!-- <dependency>\r
-                       <groupId>ch.qos.logback</groupId>\r
-                       <artifactId>logback-classic</artifactId>\r
-                       <version>1.1.2</version>\r
-                       <scope>test</scope>\r
-               </dependency> -->\r
+               <!-- <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> \r
+                       <version>1.1.2</version> <scope>test</scope> </dependency> -->\r
 \r
        </dependencies>\r
 \r
index e1c1802..fd5a435 100644 (file)
@@ -96,7 +96,7 @@ public interface ISdcCsarHelper {
         * will return "false".
         * @param nodeTemplate - nodeTemplate where the property should be looked up.
         * @param pathToPropertyLeafValue - the full path of the required property.
-        * @return the leaf value as Object, or null if there's no such property, or it's not a leaf.
+        * @return the leaf value as Object, or null if there's no such property. It's up to the caller to cast it to a proper type.
         */
        public Object getNodeTemplatePropertyAsObject(NodeTemplate nodeTemplate, String pathToPropertyLeafValue);
 
@@ -110,11 +110,11 @@ public interface ISdcCsarHelper {
        public String getGroupPropertyLeafValue(Group group, String propertyName);
 
        /**
-        * Get any property leaf value for a group definition by full path separated by #.
+        * Get any property value for a group definition by full path separated by #.
         * Same logic as in {@link #getNodeTemplatePropertyLeafValue(NodeTemplate, String) getNodeTemplatePropertyLeafValue}, only for a group.
         * @param group - group where the property should be looked up.
         * @param propertyName - the name of the required property.
-        * @return the leaf value as Object, or null if there's no such property, or it's not a leaf.
+        * @return the leaf value as Object, or null if there's no such property. It's up to the caller to cast it to a proper type.
         */
        public Object getGroupPropertyAsObject(Group group, String propertyName);
 
@@ -174,7 +174,7 @@ public interface ISdcCsarHelper {
         * Same logic as in {@link #getNodeTemplatePropertyLeafValue(NodeTemplate, String) getNodeTemplatePropertyLeafValue}, only for an input full path.
         * The expected format is "input_name#default[optionally #rest_of_path]"
         * @param inputLeafValuePath by full path separated by #.
-        * @return input leaf value for the service as Service.
+        * @return input value for the service as Object. It's up to the caller to cast it to a proper type.
         */
        public Object getServiceInputLeafValueOfDefaultAsObject(String inputLeafValuePath);
 
@@ -292,14 +292,25 @@ public interface ISdcCsarHelper {
        public List<Input> getServiceInputs();
 
        
-
+       /**
+        * Get the conformance level of this CSAR. <br>
+        * The conformance level value of the CSAR is located in csar.meta file at the top level of the CSAR file.<br>
+        * For 1707 CSARs, the conformance level is 3.0.
+        * @return the conformance level of the CSAR. 
+        */
        public String getConformanceLevel();
        
        
        /**
-        * Get the map of CP-related props from
-        * @param vfc - VFC to look for CP-related props.
-        * @return map of CP node template name to a map of CP-related properties key-value for this CP.
+        * Get the map of CP-related props from a VFC node template. <br>
+        * Let's say there are 5 CPs related to this VFC. Then the output will look like this: <br><br>
+        * {port_fe1_sigtran={ip_requirements#ip_count_required#count=1, ip_requirements#dhcp_enabled=true, ip_requirements#ip_version=4, subnetpoolid="subnet_1", network_role_tag="SIGNET_vrf_B1_direct"},<br> 
+        *  port_fe_cluster={ip_requirements#ip_count_required#count=2, ip_requirements#dhcp_enabled=true, ip_requirements#ip_version=4},<br>
+        *  port_fe_slan={ip_requirements#ip_count_required#count=1, ip_requirements#dhcp_enabled=true, ip_requirements#ip_version=4},<br> 
+        *  port_fe_interce={ip_requirements#ip_count_required#count=1, ip_requirements#dhcp_enabled=true, ip_requirements#ip_version=4},<br> 
+        *  port_fe_oam={ip_requirements#ip_count_required#count=2, ip_requirements#dhcp_enabled=true, ip_requirements#ip_version=4, subnetpoolid="subnet_2", network_role_tag="Mobility_OAM_protected"}}<br><br>
+        * @param vfc - VFC node template to look for CP-related props.
+        * @return map <CP node template name>  to a map of <full path to a property on this CP> <value of this property on this CP>.
         */
        public Map<String, Map<String, Object>> getCpPropertiesFromVfc(NodeTemplate vfc);
 }