aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test
diff options
context:
space:
mode:
authorshaheen_vz <shaheen.shaik@verizon.com>2018-10-19 17:48:18 +0530
committerOren Kleks <orenkle@amdocs.com>2018-12-18 08:43:12 +0000
commita47b9ec93001399802933e6b2f1c30e13a689181 (patch)
tree83228a8dfa0c3c70e226c0ac87a306f3de56078c /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test
parentc9e7a45f31a60ec51b770febae2213f5b7668960 (diff)
MainServiceTemplate multiple location support
Issue-ID: SDC-1744 Signed-off-by: Shaheen Shaik<shaheen.shaik@verizon.com>: Change-Id: I77e4ede6b2177ba66a4de8da824d9c7fd86f5705
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/MetadataParsingTest.java32
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Invalidtosca.meta3
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Validtosca.meta4
3 files changed, 39 insertions, 0 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/MetadataParsingTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/MetadataParsingTest.java
new file mode 100644
index 0000000000..46a563a25e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/MetadataParsingTest.java
@@ -0,0 +1,32 @@
+package org.openecomp.sdc.vendorsoftwareproduct.upload.csar;
+
+import org.junit.Test;
+import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.OnboardingToscaMetadata;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import static org.junit.Assert.assertEquals;
+
+public class MetadataParsingTest {
+
+ @Test
+ public void testNoEntryDefinitions() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/metadata/Invalidtosca.meta")) {
+ OnboardingToscaMetadata onboardingToscaMetadata = new OnboardingToscaMetadata(is);
+ assertEquals(onboardingToscaMetadata.getEntryDefinitionsPath(), null);
+ }
+ }
+
+ @Test
+ public void testValidMetadataFile() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/metadata/Validtosca.meta")) {
+ OnboardingToscaMetadata onboardingToscaMetadata = new OnboardingToscaMetadata(is);
+ assertEquals(onboardingToscaMetadata.getEntryDefinitionsPath(), "Definitions/MainServiceTemplate.yaml");
+ }
+
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Invalidtosca.meta b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Invalidtosca.meta
new file mode 100644
index 0000000000..e9f08025dc
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Invalidtosca.meta
@@ -0,0 +1,3 @@
+TOSCA-Meta-File-Version: 1.0
+CSAR-Version: 1.1
+Created-By: Feng yuanxing
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Validtosca.meta b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Validtosca.meta
new file mode 100644
index 0000000000..1f3980547c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager.csar/metadata/Validtosca.meta
@@ -0,0 +1,4 @@
+TOSCA-Meta-File-Version: 1.0
+CSAR-Version: 1.1
+Created-By: Feng yuanxing
+Entry-Definitions: Definitions/MainServiceTemplate.yaml