aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorVijay <vv770d@att.com>2017-09-14 00:23:11 +0000
committerVijay <vv770d@att.com>2017-09-14 00:43:57 +0000
commitbff565387a2f4c0c50566a87c77699480217459d (patch)
treed841b9a37a13160eedcfef99a3c371a48fd0ad14 /src/test/java/org
parent6098325c5bd53dd1a483b3d082e1872dd6e7cef5 (diff)
update to fix junit and coverage
Issue-Id:DCAEGEN2-82 Change-Id: Ib43e0e5caaf7be9c07df68faf68f0af7ceb3a595 Signed-off-by: Vijay <vv770d@att.com>
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/onap/dcae/vestest/InputJsonValidation.java6
-rw-r--r--src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java19
2 files changed, 19 insertions, 6 deletions
diff --git a/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java b/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java
index 0913608a..336cb92f 100644
--- a/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java
+++ b/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java
@@ -63,7 +63,7 @@ public class InputJsonValidation {
String schema=null;
try {
- schema = new JsonParser().parse(new FileReader(VESCollectorJunitTest.schemaFile)).toString();
+ schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json")).toString();
//System.out.println("Schema value: " + schema.toString());
} catch (JsonIOException e) {
// TODO Auto-generated catch block
@@ -108,7 +108,8 @@ public class InputJsonValidation {
String schema=null;
try {
- schema = new JsonParser().parse(new FileReader(VESCollectorJunitTest.schemaFile)).toString();
+ System.out.println("XX debug" + VESCollectorJunitTest.schemaFile);
+ schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json")).toString();
} catch (JsonIOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -167,3 +168,4 @@ public class InputJsonValidation {
}
}
+
diff --git a/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java b/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java
index 0e737175..eb1ebfde 100644
--- a/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java
+++ b/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java
@@ -32,10 +32,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
+import org.json.JSONObject;
import org.junit.Test;
public class VESCollectorJunitTest {
- public static String schemaFile=null;
+ public static String schemaFile="etc/CommonEventFormat_27.2.json";
public static String output;
@@ -53,8 +54,12 @@ public class VESCollectorJunitTest {
input = new FileInputStream("etc/collector.properties");
try {
prop.load(input);
- schemaFile=prop.getProperty("collector.schema.file");
+ //schemaFile=prop.getProperty("collector.schema.file");
+ JSONObject schemaFileJson = new JSONObject(prop.getProperty("collector.schema.file"));
+ System.out.println("JSON Schemafile" + schemaFileJson);
+ //schemaFile = schemaFileJson.getString("v4");
+
System.out.println( "Schema file location: "+ schemaFile);
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -65,7 +70,7 @@ public class VESCollectorJunitTest {
e.printStackTrace();
}
- assertEquals(message,output);
+ assertEquals("true",output);
}
@@ -78,8 +83,13 @@ public class VESCollectorJunitTest {
input = new FileInputStream("etc/collector.properties");
try {
prop.load(input);
- schemaFile=prop.getProperty("collector.schema.file");
+
+ //schemaFile=prop.getProperty("collector.schema.file");
+ JSONObject schemaFileJson = new JSONObject(prop.getProperty("collector.schema.file"));
+ System.out.println("JSON Schemafile" + schemaFileJson);
+ //schemaFile = schemaFileJson.getString("v4");
+
System.out.println( "Schema file location: "+ schemaFile);
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -107,3 +117,4 @@ public class VESCollectorJunitTest {
}
+