summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test/java
diff options
context:
space:
mode:
authorAvinashS <avinash.s@huawei.com>2017-09-20 10:13:15 +0000
committerAvinashS <avinash.s@huawei.com>2017-09-20 10:13:15 +0000
commita04f31a2b6aa49cc0646a35bf6f7f7566bb1c331 (patch)
treef03f6353a616c9e50e7e1380adb133894e1fab44 /csarvalidation/src/test/java
parent56c184e1622436654d9f12b1098a8020a6323a3a (diff)
Updated validation for CSIT
Lib interface for CSIT with marketplace Change-Id: I73c68b2f8f7a3940cb175cce2397abd4a4deaff4 IssueId: VNFSDK-90 Signed-off-by: AvinashS <avinash.s@huawei.com>
Diffstat (limited to 'csarvalidation/src/test/java')
-rw-r--r--csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java (renamed from csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarParserTest.java)20
1 files changed, 11 insertions, 9 deletions
diff --git a/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarParserTest.java b/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
index ce9ba5b..46d7beb 100644
--- a/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarParserTest.java
+++ b/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
@@ -16,42 +16,44 @@
package org.onap.validation.csarvalidationtest;
import org.junit.Test;
-import org.onap.validation.csar.CsarParser;
+import org.onap.validation.csar.CsarValidator;
+import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-public class CsarParserTest {
+public class CsarValidatorTest {
String regex = "^\\/[a-zA-Z]\\:\\/";
ClassLoader classLoader = getClass().getClassLoader();
Pattern pattern = Pattern.compile(regex);
- private String configFile = classLoader.getResource("enterprise2DC.csar").getFile();
- Matcher matcher = pattern.matcher(configFile);
- String dir2 = "/"+configFile.substring(1);
+ private String csarFile = classLoader.getResource("enterprise2DC.csar").getFile();
+ Matcher matcher = pattern.matcher(csarFile);
+ String dir2 = System.getProperty("file.separator")+csarFile.substring(1);
+ String packageId = UUID.randomUUID().toString();
- CsarParser csarParser = new CsarParser(dir2);
+ CsarValidator csarValidator = new CsarValidator(packageId, dir2);
@Test
public void testValidateCsarMeta() {
- boolean result = CsarParser.validateCsarMeta();
+ boolean result = CsarValidator.validateCsarMeta();
assertEquals(true, result == true);
System.out.println("inside testValidateCsarMeta : " + result);
}
@Test
public void testValidateCsarIntegrity() {
- boolean result = csarParser.validateCsarIntegrity(dir2);
+ boolean result = csarValidator.validateCsarIntegrity(dir2);
assertEquals(true, result == true);
System.out.println("inside testValidateCsarIntegrity : " + result);
}
@Test
public void testValidateToscaMeta() {
- boolean result = csarParser.validateToscaMeta();
+ boolean result = csarValidator.validateToscaMeta();
assertEquals(true, result == true);
System.out.println("inside testValidateToscaMeta : " + result);
}