Linux Foundation Collaborative Projects
index
:
dcaegen2/collectors/ves
2.0.0-ONAP
amsterdam
beijing
casablanca
dublin
elalto
frankfurt
frankfurt_old
guilin
honolulu
istanbul
jakarta
kohn
london
master
ves_synchronous
VNF Event Streaming collector
Grokmirror user
summary
refs
log
tree
commit
diff
stats
log msg
author
committer
range
path:
root
/
src
/
test
/
java
/
org
/
onap
/
dcae
/
vestest
/
TestSchemaValidation.java
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
+
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testsuccessfulschemavalidation() {
+
+ String valresult = CommonStartup.schemavalidate(payload, schema);
+ System.out.println("testsuccessfulschemavalidation:" + valresult);
+ Assert.assertEquals(valresult, "true");
+ }
+
+ @Test
+ public void testunsuccessfulschemavalidation() {
+ String valresult = null;
+ valresult = CommonStartup.schemavalidate(payloadinvalid, schema);
+ System.out.println("testunsuccessfulschemavalidation:" + valresult);
+ Assert.assertFalse(valresult.equals("true"));
+
+ }
+
+/*
+ @Test
+ public void testeventReceipt() {
+
+ DrumlinServlet webServlet = new DrumlinServlet();
+ DrumlinRequestContext ctx = new DrumlinRequestContext(webServlet, null, null, null, null, null);
+ EventReceipt er= new EventReceipt();
+ try {
+ EventReceipt.receiveVESEvent(null);
+ } catch ( NullPointerException e) {
+
+ e.printStackTrace();
+ }
+ Assert.assertEquals("true", "true");
+
+ }*/
+
+ @Test
+ public void testsafeclosefr() {
+
+
+ FileReader fr;
+ try {
+ fr = new FileReader("etc/CommonEventFormat_27.2.json");
+ EventReceipt.safeClose(fr);
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ Assert.assertEquals("true", "true");
+
+ }
+
+ @Test
+ public void testsafecloseis() {
+
+ InputStream is = new ByteArrayInputStream(StandardCharsets.UTF_16.encode("randomstring").array());
+ EventReceipt.safeClose(is);
+ Assert.assertEquals("true", "true");
+
+ }
+}
+