summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/parser/ManifestFileSplitterTest.java23
-rw-r--r--csarvalidation/src/test/resources/cvc/csar/parser/MainServiceTemplate.windows.mf10
2 files changed, 29 insertions, 4 deletions
diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/parser/ManifestFileSplitterTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/parser/ManifestFileSplitterTest.java
index b530691..11cddbe 100644
--- a/csarvalidation/src/test/java/org/onap/cvc/csar/parser/ManifestFileSplitterTest.java
+++ b/csarvalidation/src/test/java/org/onap/cvc/csar/parser/ManifestFileSplitterTest.java
@@ -21,19 +21,27 @@ import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.io.File;
+import java.net.URISyntaxException;
+
+import static org.onap.cvc.csar.cc.sol004.IntegrationTestUtils.absoluteFilePath;
/*
How to sing files see to README.txt file into test/resources folder
*/
public class ManifestFileSplitterTest {
- @Test
- public void shouldSplitManifestFileOnDataPartAndCMS() {
- File file = new File("./src/test/resources/cvc/csar/parser/MainServiceTemplate.mf");
+ private ManifestFileModel getModel(String resourceFilePath) throws URISyntaxException {
+ File file = new File(absoluteFilePath(resourceFilePath));
ManifestFileSplitter manifestFileSplitter = new ManifestFileSplitter();
+ return manifestFileSplitter.split(file);
+ }
- ManifestFileModel manifestFileModel = manifestFileSplitter.split(file);
+ @Test
+ public void shouldSplitManifestFileOnDataPartAndCMS() throws URISyntaxException {
+ String resource = "cvc/csar/parser/MainServiceTemplate.mf";
+ ManifestFileModel manifestFileModel = getModel(resource);
+ Assertions.assertThat(manifestFileModel.getNewLine()).isEqualTo("\n");
Assertions.assertThat(manifestFileModel.getData()).contains("metadata:",
" pnfd_name: RadioNode",
" pnfd_provider: Ericsson",
@@ -47,4 +55,11 @@ public class ManifestFileSplitterTest {
"-----END CMS-----"
);
}
+
+ @Test
+ public void shouldBeWindowsStyle() throws URISyntaxException {
+ String resource = "cvc/csar/parser/MainServiceTemplate.windows.mf";
+ ManifestFileModel manifestFileModel = getModel(resource);
+ Assertions.assertThat(manifestFileModel.getNewLine()).isEqualTo("\r\n");
+ }
}
diff --git a/csarvalidation/src/test/resources/cvc/csar/parser/MainServiceTemplate.windows.mf b/csarvalidation/src/test/resources/cvc/csar/parser/MainServiceTemplate.windows.mf
new file mode 100644
index 0000000..5703942
--- /dev/null
+++ b/csarvalidation/src/test/resources/cvc/csar/parser/MainServiceTemplate.windows.mf
@@ -0,0 +1,10 @@
+metadata:
+ pnfd_name: RadioNode
+ pnfd_provider: Ericsson
+ pnfd_archive_version: 1.0
+ pnfd_release_date_time: 2019-01-14T11:25:00+00:00
+
+-----BEGIN CMS-----
+MIIGDAYJKoZIhvcNAQcCoIIF/TCCBfkCAQExDTALBglghkgBZQMEAgEwCwYJKoZI
+hvcNAQcBoIIDRTCCA0EwggIpAhRJ6KO7OFR2BuRDZwcd2TT4/wrEqDANBgkqhkiG
+-----END CMS-----