summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Aharoni <pa0916@att.com>2017-04-03 10:06:16 +0300
committerPavel Aharoni <pa0916@att.com>2017-04-03 10:06:32 +0300
commit1df0b72a316dcc7f913061706db165d78d2c3a03 (patch)
treeba549dc1e15b963ee39cc55d577317c08367e53e
parentb51f888ee16f8bf92c7d9a0331eaa05e3bb938d2 (diff)
[SDC-8] trying to merge changes of tests and csars
Change-Id: Iac4d5bd1ea312b76cba52a172d5ac80757173409 Signed-off-by: Pavel Aharoni <pa0916@att.com>
-rw-r--r--jython-tosca-parser/pom.xml2
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java81
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java2
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyToscaTemplate.java1
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/parameters/JyInput.java1
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py5
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py5
-rw-r--r--pom.xml6
-rw-r--r--sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java5
-rw-r--r--sdc-tosca-parser/pom.xml2
-rw-r--r--sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java61
-rw-r--r--sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserStubsTest.java96
-rw-r--r--sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-allotted-resources-4.csarbin0 -> 39949 bytes
-rw-r--r--sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-groups-status-supported-case-3.csarbin0 -> 39943 bytes
-rw-r--r--sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-props-1.csarbin0 -> 39948 bytes
-rw-r--r--sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-tt-metadata-2.csarbin0 -> 39938 bytes
-rw-r--r--sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar.csarbin0 -> 39979 bytes
-rw-r--r--sdc-tosca-parser/src/test/resources/csars/service-vmme-csar.csarbin0 -> 74074 bytes
18 files changed, 200 insertions, 67 deletions
diff --git a/jython-tosca-parser/pom.xml b/jython-tosca-parser/pom.xml
index 29a8cd2..7e29249 100644
--- a/jython-tosca-parser/pom.xml
+++ b/jython-tosca-parser/pom.xml
@@ -9,7 +9,7 @@
</parent>
<artifactId>jython-tosca-parser</artifactId>
- <version>0.4.0-SNAPSHOT</version>
+ <version>0.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
index 97563fb..abf1b53 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
@@ -1,5 +1,7 @@
package org.openecomp.sdc.toscaparser.api;
+import static com.google.common.collect.ImmutableList.toImmutableList;
+
import java.util.List;
import java.util.Objects;
@@ -10,40 +12,47 @@ import com.google.common.base.MoreObjects;
public class ToscaTemplate {
- private final JyToscaTemplate jyToscaTemplate;
- private final TopologyTemplate topologyTemplate;
-
- public ToscaTemplate(JyToscaTemplate jyToscaTemplate, TopologyTemplate topologyTemplate) {
- this.jyToscaTemplate = Objects.requireNonNull(jyToscaTemplate);
- this.topologyTemplate = Objects.requireNonNull(topologyTemplate);
- }
-
- public String getVersion() {
- return jyToscaTemplate.getJyVersion();
- }
-
- public String getDescription() {
- return jyToscaTemplate.getJyDescription();
- }
-
- public TopologyTemplate getTopologyTemplate() {
- return topologyTemplate;
- }
-
- public List<NodeTemplate> getNodeTemplates() {
- return topologyTemplate.getNodeTemplates();
- }
-
- public List<Input> getInputs() {
- return topologyTemplate.getInputs();
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("version", getVersion())
- .add("description", getDescription())
- .add("topologyTemplate", topologyTemplate)
- .toString();
- }
+ private final JyToscaTemplate jyToscaTemplate;
+ private final TopologyTemplate topologyTemplate;
+
+ public ToscaTemplate(JyToscaTemplate jyToscaTemplate, TopologyTemplate topologyTemplate) {
+ this.jyToscaTemplate = Objects.requireNonNull(jyToscaTemplate);
+ this.topologyTemplate = Objects.requireNonNull(topologyTemplate);
+ }
+
+ public String getVersion() {
+ return jyToscaTemplate.getJyVersion();
+ }
+
+ public String getDescription() {
+ return jyToscaTemplate.getJyDescription();
+ }
+
+ public TopologyTemplate getTopologyTemplate() {
+ return topologyTemplate;
+ }
+
+ public List<NodeTemplate> getNodeTemplates() {
+ return topologyTemplate.getNodeTemplates();
+ }
+
+ public List<TopologyTemplate> getNestedTopologyTemplates() {
+ return jyToscaTemplate.getNestedTopologyTemplates()
+ .stream()
+ .map(TopologyTemplate::new)
+ .collect(toImmutableList());
+ }
+
+ public List<Input> getInputs() {
+ return topologyTemplate.getInputs();
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("version", getVersion())
+ .add("description", getDescription())
+ .add("topologyTemplate", topologyTemplate)
+ .toString();
+ }
} \ No newline at end of file
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java
index b700c47..0b9ad7d 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java
@@ -22,6 +22,8 @@ public class Input {
return jyInput.getJyType();
}
+
+
public boolean isRequired() {
return jyInput.isJyRequired();
}
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyToscaTemplate.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyToscaTemplate.java
index c58a042..7cba568 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyToscaTemplate.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyToscaTemplate.java
@@ -7,5 +7,6 @@ public interface JyToscaTemplate {
String getJyVersion();
String getJyDescription();
List<JyNodeTemplate> getJyNodeTemplates();
+ List<JyTopologyTemplate> getNestedTopologyTemplates();
JyTopologyTemplate getJyTopologyTemplate();
}
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/parameters/JyInput.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/parameters/JyInput.java
index 320e91b..253805b 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/parameters/JyInput.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/parameters/JyInput.java
@@ -4,6 +4,7 @@ public interface JyInput {
String getJyName();
String getJyType();
+ String getJyDefault();
boolean isJyRequired();
String getJyDescription();
}
diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py
index 7a4acd9..1bb58be 100644
--- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py
+++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py
@@ -50,7 +50,10 @@ class Input(JyInput):
return self.required
def getJyDescription(self):
- return self.description
+ return self.description
+
+ def getJyDefault(self):
+ return self.default
@property
def type(self):
diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py
index 55485f0..6b3ea87 100644
--- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py
+++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py
@@ -119,8 +119,11 @@ class ToscaTemplate(JyToscaTemplate):
return self.description
def getJyTopologyTemplate(self):
- return self.topology_template
+ return self.topology_template
+ def getJyNestedTopologyTemplates(self):
+ return self.nested_tosca_templates_with_topology
+
def _topology_template(self):
return TopologyTemplate(self._tpl_topology_template(),
self._get_all_custom_defs(),
diff --git a/pom.xml b/pom.xml
index fe0f9e8..7c348e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,8 @@
<sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
<sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
<nexus.proxy>https://nexus.openecomp.org</nexus.proxy>
+ <snapshots.path>snapshots</snapshots.path>
+ <releases.path>releases</releases.path>
<staging.profile.id>176c31dfe190a</staging.profile.id>
</properties>
@@ -188,12 +190,12 @@
<repository>
<id>ecomp-releases</id>
<name>Release Repository</name>
- <url>${nexus.proxy}/content/repositories/releases/</url>
+ <url>${nexus.proxy}/content/repositories/${releases.path}/</url>
</repository>
<snapshotRepository>
<id>ecomp-snapshots</id>
<name>Snapshot Repository</name>
- <url>${nexus.proxy}/content/repositories/snapshots/</url>
+ <url>${nexus.proxy}/content/repositories/${snapshots.path}/</url>
</snapshotRepository>
</distributionManagement>
diff --git a/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java b/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java
index 5e8dafd..d944bf0 100644
--- a/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java
+++ b/sdc-distribution-ci/src/main/java/org/openecomp/test/ClientTest.java
@@ -35,10 +35,11 @@ public class ClientTest {
public static void main(String[] args) throws Exception {
try (SdcToscaParserFactory toscaParserFactory = SdcToscaParserFactory.getInstance()){
//ISdcCsarHelper csarHelper = toscaParserFactory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar-nt-metadata.csar");
- ISdcCsarHelper csarHelper = toscaParserFactory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar.csar");
+ ISdcCsarHelper csarHelper = toscaParserFactory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar-nt-props.csar");
+ //ISdcCsarHelper csarHelper = toscaParserFactory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar.csar");
String serviceSubstitutionMappingsTypeName = csarHelper.getServiceSubstitutionMappingsTypeName();
System.out.println("serviceSubstitutionMappingsTypeName is "+serviceSubstitutionMappingsTypeName);
- String nodeTemplatePropertyLeafValue = csarHelper.getNodeTemplatePropertyLeafValue(csarHelper.getServiceVfList().get(0), "nf_role");
+ String nodeTemplatePropertyLeafValue = csarHelper.getNodeTemplatePropertyLeafValue(csarHelper.getServiceVfList().get(0), "nf_role#nf_naming#ecomp_generated_naming");
System.out.println("property is "+nodeTemplatePropertyLeafValue);
}
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
diff --git a/sdc-tosca-parser/pom.xml b/sdc-tosca-parser/pom.xml
index d4ffda8..cd6e49e 100644
--- a/sdc-tosca-parser/pom.xml
+++ b/sdc-tosca-parser/pom.xml
@@ -71,7 +71,7 @@
<dependency>
<groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
<artifactId>jython-tosca-parser</artifactId>
- <version>0.4.0-SNAPSHOT</version>
+ <version>0.4.1-SNAPSHOT</version>
</dependency>
diff --git a/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java b/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
index 51afe7e..d5caa5d 100644
--- a/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
+++ b/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
@@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.stream.Collector;
+import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.Pair;
import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
@@ -32,27 +34,34 @@ import org.openecomp.sdc.toscaparser.api.NodeTemplate;
import org.openecomp.sdc.toscaparser.api.Property;
import org.openecomp.sdc.toscaparser.api.TopologyTemplate;
import org.openecomp.sdc.toscaparser.api.ToscaTemplate;
+import org.yaml.snakeyaml.Yaml;
public class SdcCsarHelperImpl implements ISdcCsarHelper {
private ToscaTemplate toscaTemplate;
-
+ private static Yaml defaultYaml = new Yaml();
+
+
public SdcCsarHelperImpl(ToscaTemplate toscaTemplate) {
this.toscaTemplate = toscaTemplate;
}
@Override
+ //Sunny flow - covered with UT, flat and nested
public String getNodeTemplatePropertyLeafValue(NodeTemplate nodeTemplate, String leafValuePath) {
String[] split = leafValuePath.split("#");
List<Property> properties = nodeTemplate.getProperties();
Optional<Property> findFirst = properties.stream().filter(x -> x.getName().equals(split[0])).findFirst();
if (findFirst.isPresent()){
- Object current = findFirst.get().getValue();
- /*for (int i = 1; i < split.length; i++) {
- //if (i )
- }*/
- //TODO add nested props
- return (String)current;
+ Property property = findFirst.get();
+ Object current = property.getValue();
+ if (split.length > 1){
+ current = defaultYaml.load((String)current);
+ for (int i = 1; i < split.length; i++) {
+ current = ((Map<String, Object>)current).get(split[i]);
+ }
+ }
+ return String.valueOf(current);
}
return null;
}
@@ -64,11 +73,13 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
}
@Override
+ //Sunny flow - covered with UT
public List<NodeTemplate> getServiceVfList() {
return getNodeTemplateBySdcType(toscaTemplate.getTopologyTemplate(), Types.TYPE_VF);
}
-
+
@Override
+ //Sunny flow - covered with UT
public List<NodeTemplate> getServiceNodeTemplatesByType(String nodeType) {
List<NodeTemplate> res = new ArrayList<>();
List<NodeTemplate> nodeTemplates = toscaTemplate.getNodeTemplates();
@@ -113,11 +124,6 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
return res;
}
- /*@Override
- public String getMetadataPropertyValue(Metadata metadata, String metadataPropertyName) {
- return (String)metadata.get(metadataPropertyName);
- }*/
-
@Override
public String getServiceInputLeafValue(String inputLeafValuePath) {
//toscaTemplate.getTopologyTemplate().getNodeTemplates().get(0).getProperties().get(0).
@@ -131,7 +137,9 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
@Override
public Map<String, String> getServiceMetadata() {
- return toscaTemplate.getTopologyTemplate().getMetadata();
+ TopologyTemplate topologyTemplate = toscaTemplate.getTopologyTemplate();
+ System.out.println(topologyTemplate.toString());
+ return topologyTemplate.getMetadata();
}
//Get property from group
@@ -139,10 +147,10 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
public String getGroupPropertyLeafValue(Group group, String propertyName) {
return null;//getLeafPropertyValue(group, propertyName);
}
-
+
private List<NodeTemplate> getNodeTemplateBySdcType(NodeTemplate nodeTemplate, String sdcType){
//Need metadata to fetch by type
-
+
/*List<NodeTemplate> nodeTemplates = nodeTemplate.getNestedNodeTemplates();
List<NodeTemplate> res = new ArrayList<>();
for (NodeTemplate nodeTemplateEntry : nodeTemplates){
@@ -152,16 +160,16 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
}*/
return null;
}
-
+
private List<NodeTemplate> getNodeTemplateBySdcType(TopologyTemplate topologyTemplate, String sdcType){
//Need metadata to fetch by type
-
+
List<NodeTemplate> nodeTemplates = topologyTemplate.getNodeTemplates();
List<NodeTemplate> res = new ArrayList<>();
for (NodeTemplate nodeTemplateEntry : nodeTemplates){
//TODO switch back to type condition
if (nodeTemplateEntry.getTypeDefinition().getType().contains("."+sdcType.toLowerCase()+".")){
- //if (sdcType.equals(nodeTemplateEntry.getMetadata().get(SdcPropertyNames.PROPERTY_NAME_TYPE))){
+ //if (sdcType.equals(nodeTemplateEntry.getMetadata().get(SdcPropertyNames.PROPERTY_NAME_TYPE))){
res.add(nodeTemplateEntry);
}
}
@@ -189,16 +197,23 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
}
@Override
+ //TODO constant strings
public List<NodeTemplate> getAllottedResources() {
- //TODO - Need metadata
- return new ArrayList<>();
+ List<NodeTemplate> nodeTemplates = toscaTemplate.getTopologyTemplate().getNodeTemplates();
+ return nodeTemplates.stream().filter(x -> x.getMetadata() != null && x.getMetadata().get("category").equals("allotted_resources")).collect(Collectors.toList());
}
@Override
+ //Sunny flow - covered with UT
public String getTypeOfNodeTemplate(NodeTemplate nodeTemplate) {
//Can be done
return nodeTemplate.getTypeDefinition().getType();
}
-
-
+
+ /*//Not part of API, for inner/test use
+ public NodeTemplate getNodeTemplateByName(TopologyTemplate topologyTemplate, String topologyName){
+ List<NodeTemplate> nodeTemplates = topologyTemplate.getNodeTemplates();
+ Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> x.getName().equals(topologyName)).findFirst();
+ return findFirst.isPresent() ? findFirst.get() : null;
+ }*/
}
diff --git a/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserStubsTest.java b/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserStubsTest.java
new file mode 100644
index 0000000..aac552c
--- /dev/null
+++ b/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserStubsTest.java
@@ -0,0 +1,96 @@
+package org.openecomp.sdc.impl;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.AfterClass;
+import static org.junit.Assert.*;
+import org.junit.BeforeClass;
+import org.junit.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.openecomp.sdc.toscaparser.api.NodeTemplate;
+
+public class ToscaParserStubsTest {
+
+ private static ISdcCsarHelper csarHelper;
+ private static SdcToscaParserFactory factory;
+
+
+ @BeforeClass
+ public static void init() throws SdcToscaParserException{
+ factory = SdcToscaParserFactory.getInstance();
+ //csarHelper = factory.getSdcCsarHelper("C:\\Users\\pa0916\\Desktop\\Work\\ASDC\\CSARs\\service-ServiceFdnt-csar-allotted-resources-4.csar");
+ String fileStr = ToscaParserStubsTest.class.getClassLoader().getResource("csars/service-ServiceFdnt-csar-allotted-resources-4.csar").getFile();
+ File file = new File(fileStr);
+ csarHelper = factory.getSdcCsarHelper(file.getAbsolutePath());
+ }
+
+
+ @Test
+ //TODO add rainy flows
+ public void testNumberOfVfSunnyFlow() throws SdcToscaParserException {
+ List<NodeTemplate> serviceVfList = csarHelper.getServiceVfList();
+ assertNotNull(serviceVfList);
+ assertEquals(1, serviceVfList.size());
+ }
+
+ @Test
+ //TODO add rainy flows
+ public void testNodeTemplateFlatProperty() throws SdcToscaParserException {
+ List<NodeTemplate> serviceVfList = csarHelper.getServiceVfList();
+ String nodeTemplatePropertyLeafValue = csarHelper.getNodeTemplatePropertyLeafValue(serviceVfList.get(0), "availability_zone_max_count");
+ assertEquals("2", nodeTemplatePropertyLeafValue);
+ }
+
+ @Test
+ //TODO add rainy flows
+ public void testNodeTemplateNestedProperty() throws SdcToscaParserException {
+ List<NodeTemplate> serviceVfList = csarHelper.getServiceVfList();
+ String nodeTemplatePropertyLeafValue = csarHelper.getNodeTemplatePropertyLeafValue(serviceVfList.get(0), "nf_role#nf_naming#instance_name");
+ assertEquals("FDNT_instance_VF", nodeTemplatePropertyLeafValue);
+ }
+
+ @Test
+ //TODO add rainy flows
+ public void testServiceNodeTemplatesByType() throws SdcToscaParserException {
+ List<NodeTemplate> serviceVfList = csarHelper.getServiceNodeTemplatesByType("org.openecomp.resource.vf.Fdnt");
+ assertNotNull(serviceVfList);
+ assertEquals(1, serviceVfList.size());
+ }
+
+ @Test
+ //TODO add rainy flows
+ public void testGetTypeOfNodeTemplate() {
+ List<NodeTemplate> serviceVfList = csarHelper.getServiceVfList();
+ String typeOfNodeTemplate = csarHelper.getTypeOfNodeTemplate(serviceVfList.get(0));
+ assertEquals("org.openecomp.resource.vf.Fdnt", typeOfNodeTemplate);
+ }
+
+
+ //@Test
+ //TODO add rainy flows
+ public void testGetServiceMetadata() {
+ //FAILS!! Metadata is null
+ Map<String, String> serviceMetadata = csarHelper.getServiceMetadata();
+ assertNotNull(serviceMetadata);
+ assertEquals("78c72999-1003-4a35-8534-bbd7d96fcae3", serviceMetadata.get("invariantUUID"));
+ assertEquals("Service FDNT", serviceMetadata.get("name"));
+ assertEquals("true", serviceMetadata.get("serviceEcompNaming"));
+ }
+
+ @Test
+ //TODO add rainy flows
+ public void testGetAllottedResources() {
+ List<NodeTemplate> allottedResources = csarHelper.getAllottedResources();
+ assertEquals(1, allottedResources.size());
+ }
+
+
+ @AfterClass
+ public static void close(){
+ factory.close();
+ }
+ }
diff --git a/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-allotted-resources-4.csar b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-allotted-resources-4.csar
new file mode 100644
index 0000000..7b4cff2
--- /dev/null
+++ b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-allotted-resources-4.csar
Binary files differ
diff --git a/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-groups-status-supported-case-3.csar b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-groups-status-supported-case-3.csar
new file mode 100644
index 0000000..7286663
--- /dev/null
+++ b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-groups-status-supported-case-3.csar
Binary files differ
diff --git a/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-props-1.csar b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-props-1.csar
new file mode 100644
index 0000000..ceac90a
--- /dev/null
+++ b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-props-1.csar
Binary files differ
diff --git a/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-tt-metadata-2.csar b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-tt-metadata-2.csar
new file mode 100644
index 0000000..3cda214
--- /dev/null
+++ b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar-nt-tt-metadata-2.csar
Binary files differ
diff --git a/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar.csar b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar.csar
new file mode 100644
index 0000000..6179316
--- /dev/null
+++ b/sdc-tosca-parser/src/test/resources/csars/service-ServiceFdnt-csar.csar
Binary files differ
diff --git a/sdc-tosca-parser/src/test/resources/csars/service-vmme-csar.csar b/sdc-tosca-parser/src/test/resources/csars/service-vmme-csar.csar
new file mode 100644
index 0000000..416707c
--- /dev/null
+++ b/sdc-tosca-parser/src/test/resources/csars/service-vmme-csar.csar
Binary files differ