aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorYuli Shlosberg <ys9693@att.com>2017-11-28 16:08:18 +0200
committerYuli Shlosberg <ys9693@att.com>2017-11-28 16:14:47 +0200
commita6751002a0211f0b1d10c04183f5d35db9e83053 (patch)
tree7c309d19dbc80a5abffa11c63ec0ed812e9d5699 /src/test/java
parentb919d9920616f75cd9f683dd24c723c6b69a586d (diff)
add tests
Change-Id: I45ce436bb369275792b6c5e8a67b22c3158686da Issue-ID: SDC-695 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java2
-rw-r--r--src/test/java/org/openecomp/sdc/impl/myTest.java42
2 files changed, 43 insertions, 1 deletions
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java b/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java
index 72bb5df..288cea6 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java
+++ b/src/test/java/org/openecomp/sdc/impl/ToscaParserValidationIssueTest.java
@@ -46,7 +46,7 @@ public class ToscaParserValidationIssueTest extends SdcToscaParserBasicTest {
public void testMultiSinceConformanceLevelIssues() throws SdcToscaParserException {
ISdcCsarHelper Nfod2images = getCsarHelper("csars/service-Nfod2images-csar.csar");//conformance level 4.0
List<JToscaValidationIssue> notAnalyzedReport = factory.getNotAnalyzadExceptions();
- assertEquals( notAnalyzedReport.size(),17);
+ assertEquals( notAnalyzedReport.size(),2);
List<JToscaValidationIssue> warningsReport = factory.getWarningExceptions();
assertEquals( warningsReport.size(),0);
List<JToscaValidationIssue> criticalsReport = factory.getCriticalExceptions();
diff --git a/src/test/java/org/openecomp/sdc/impl/myTest.java b/src/test/java/org/openecomp/sdc/impl/myTest.java
new file mode 100644
index 0000000..2f0da7f
--- /dev/null
+++ b/src/test/java/org/openecomp/sdc/impl/myTest.java
@@ -0,0 +1,42 @@
+package org.openecomp.sdc.impl;
+
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.testng.annotations.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 java.io.File;
+import java.util.List;
+
+import static org.openecomp.sdc.impl.SdcToscaParserBasicTest.getCsarHelper;
+
+public class myTest {
+
+ static SdcToscaParserFactory factory;
+ static ISdcCsarHelper fdntCsarHelper;
+
+ @Test
+ public void testNoValidationIssues() throws SdcToscaParserException {
+
+
+// factory = SdcToscaParserFactory.getInstance();
+// fdntCsarHelper = getCsarHelper("csars/service-Oren1-csar-4.csar");
+//
+//
+// List<NodeTemplate> serviceNodeTemplatesByType = fdntCsarHelper.getServiceNodeTemplatesByType("org.openecomp.nodes.ForwardingPath");
+//
+// String target_range = fdntCsarHelper.getNodeTemplatePropertyLeafValue(serviceNodeTemplatesByType.get(0), "target_range");
+
+ }
+
+
+ protected static ISdcCsarHelper getCsarHelper(String path) throws SdcToscaParserException {
+ System.out.println("Parsing CSAR "+path+"...");
+ String fileStr1 = SdcToscaParserBasicTest.class.getClassLoader().getResource(path).getFile();
+ File file1 = new File(fileStr1);
+ ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(file1.getAbsolutePath());
+ return sdcCsarHelper;
+ }
+
+}