summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test/java/org/onap
diff options
context:
space:
mode:
authorAvinashS <avinash.s@huawei.com>2017-09-21 19:21:01 +0530
committerAvinashS <avinash.s@huawei.com>2017-09-21 19:21:01 +0530
commit2d896d9051f4b05518a5da0c4b86b18ab1e0677d (patch)
tree92a676c0384f89da885442b773b9a85e564c08c8 /csarvalidation/src/test/java/org/onap
parent554973c890c5b794ba41422c5b73552ab8faf5f8 (diff)
Added validation for MainServiceTemplate
Added code for validation of MainServiceTemplate requires further cleanup and smart schema validation. Change-Id: I65ecd9ec0d1b5ee32d50583b2670a1ce532d74e7 IssueId: VNFSDK-96 Signed-off-by: AvinashS <avinash.s@huawei.com>
Diffstat (limited to 'csarvalidation/src/test/java/org/onap')
-rw-r--r--csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java62
1 files changed, 48 insertions, 14 deletions
diff --git a/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java b/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
index 46d7beb..be764a1 100644
--- a/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
+++ b/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
@@ -32,33 +32,67 @@ public class CsarValidatorTest {
Pattern pattern = Pattern.compile(regex);
private String csarFile = classLoader.getResource("enterprise2DC.csar").getFile();
Matcher matcher = pattern.matcher(csarFile);
- String dir2 = System.getProperty("file.separator")+csarFile.substring(1);
+ String dir2 = System.getProperty("file.separator") + csarFile.substring(1);
String packageId = UUID.randomUUID().toString();
- CsarValidator csarValidator = new CsarValidator(packageId, dir2);
+ private String csarFile2 = classLoader.getResource("sample.csar").getFile();
+ String sample2 = System.getProperty("file.separator") + csarFile2.substring(1);
+ String packageId2 = UUID.randomUUID().toString();
+
+
+
@Test
- public void testValidateCsarMeta() {
- boolean result = CsarValidator.validateCsarMeta();
- assertEquals(true, result == true);
- System.out.println("inside testValidateCsarMeta : " + result);
+ public void testAll() {
+ CsarValidator csarValidator = new CsarValidator(packageId, dir2);
+ testValidateCsar(csarValidator);
+
+ CsarValidator csarValidator2 = new CsarValidator(packageId2, sample2);
+ testValidateCsar(csarValidator2);
+
}
@Test
- public void testValidateCsarIntegrity() {
- boolean result = csarValidator.validateCsarIntegrity(dir2);
+ public void testIndividual() {
+ CsarValidator csarValidator = new CsarValidator(packageId, dir2);
+ testValidateCsarMeta(csarValidator);
+ testValidateCsarIntegrity(csarValidator);
+ testValidateToscaMeta(csarValidator);
+
+ CsarValidator csarValidator2 = new CsarValidator(packageId2, sample2);
+ testValidateCsarIntegrity(csarValidator2);
+ testValidateToscaMeta(csarValidator2);
+ testValidateMainService(csarValidator2); //Rel1 specific test case
+ }
+
+
+
+ private void testValidateCsarMeta(CsarValidator cv) {
+ boolean result = cv.validateCsarMeta();
assertEquals(true, result == true);
- System.out.println("inside testValidateCsarIntegrity : " + result);
}
- @Test
- public void testValidateToscaMeta() {
- boolean result = csarValidator.validateToscaMeta();
+
+ private void testValidateCsarIntegrity(CsarValidator cv) {
+ boolean result = cv.validateCsarIntegrity(dir2);
+ assertEquals(true, result == true);
+ }
+
+
+ private void testValidateToscaMeta(CsarValidator cv) {
+ boolean result = cv.validateToscaMeta();
assertEquals(true, result == true);
- System.out.println("inside testValidateToscaMeta : " + result);
}
-}
+ private void testValidateMainService(CsarValidator cv) {
+ boolean result = cv.validateMainService();
+ assertEquals(true, result == true);
+ }
+ private void testValidateCsar(CsarValidator cv) {
+ boolean result = cv.validateCsar();
+ assertEquals(true, result == true);
+ }
+}