summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorPavel Aharoni <pa0916@att.com>2017-06-07 17:24:33 +0300
committerPavel Aharoni <pa0916@att.com>2017-06-07 17:24:33 +0300
commit8c51a2f78333e3217dac4345955f89fc3867a503 (patch)
tree4202117f435fc9b01d0ea578f29090901aa7356a /src/test
parenta107ab008758d78ace5ad95ae7435c5244358f10 (diff)
[SDC-28] JTOSCA initial commit
Change-Id: Ic0ede56c1cc513e632c36954a4227317ae357020 Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org.openecomp.sdc.toscaparser/JToscaMetadataParse.java26
-rw-r--r--src/test/resources/csars/csar_hello_world.csarbin0 -> 936 bytes
-rw-r--r--src/test/resources/csars/service-ServiceFdnt-csar.csarbin0 -> 40171 bytes
3 files changed, 26 insertions, 0 deletions
diff --git a/src/test/java/org.openecomp.sdc.toscaparser/JToscaMetadataParse.java b/src/test/java/org.openecomp.sdc.toscaparser/JToscaMetadataParse.java
new file mode 100644
index 0000000..584a0fd
--- /dev/null
+++ b/src/test/java/org.openecomp.sdc.toscaparser/JToscaMetadataParse.java
@@ -0,0 +1,26 @@
+package org.openecomp.sdc.toscaparser;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.util.LinkedHashMap;
+
+import org.junit.Test;
+import org.openecomp.sdc.toscaparser.api.ToscaTemplate;
+import org.openecomp.sdc.toscaparser.api.common.JToscaException;
+
+public class JToscaMetadataParse {
+
+ @Test
+ public void testMetadataParsedCorrectly() throws JToscaException {
+ String fileStr = JToscaMetadataParse.class.getClassLoader().getResource("csars/csar_hello_world.csar").getFile();
+ File file = new File(fileStr);
+ ToscaTemplate toscaTemplate = new ToscaTemplate(file.getAbsolutePath(), null, true, null);
+ LinkedHashMap<String, Object> metadataProperties = toscaTemplate.getMetaProperties("TOSCA.meta");
+ assertNotNull(metadataProperties);
+ Object entryDefinition = metadataProperties.get("Entry-Definitions");
+ assertNotNull(entryDefinition);
+ assertEquals("tosca_helloworld.yaml", entryDefinition);
+ }
+}
diff --git a/src/test/resources/csars/csar_hello_world.csar b/src/test/resources/csars/csar_hello_world.csar
new file mode 100644
index 0000000..43ffbbc
--- /dev/null
+++ b/src/test/resources/csars/csar_hello_world.csar
Binary files differ
diff --git a/src/test/resources/csars/service-ServiceFdnt-csar.csar b/src/test/resources/csars/service-ServiceFdnt-csar.csar
new file mode 100644
index 0000000..983dc9b
--- /dev/null
+++ b/src/test/resources/csars/service-ServiceFdnt-csar.csar
Binary files differ