aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/data-provider/provider/src/test
diff options
context:
space:
mode:
authorJakub Dominik <j.dominik@samsung.com>2021-10-14 15:12:55 +0200
committerDan Timoney <dtimoney@att.com>2021-11-18 13:19:44 +0000
commit98aeaac496ac868a97ce9096c1c51ce9a133992a (patch)
treee3e4a52f786f4dbe271485366f0a0c8d74edc85f /sdnr/wt/data-provider/provider/src/test
parent5d3bfaac4bc7a8b7b030757e1f35795667915a2b (diff)
Extend SDNC persistent service to store CM
Extend SDNC persistent service to store received CM events into Elasticsearch and MariaDB Issue-ID: CCSDK-3497 Signed-off-by: Jakub Dominik <j.dominik@samsung.com> Change-Id: I39983e59ef6512ad6c3864d47aebe1d615897146 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/data-provider/provider/src/test')
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java133
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java62
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestUserdata.java11
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java11
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java4
5 files changed, 210 insertions, 11 deletions
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java
index c407859d5..d59a0784f 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java
@@ -5,6 +5,8 @@
* Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
* All rights reserved.
* ================================================================================
+ * Update Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved.
+ * =================================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -47,6 +49,9 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.DataProviderYangToolsMapper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmNotificationType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmOperation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmSourceIndicator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceOutputBuilder;
@@ -66,6 +71,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultlog;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadCmlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadCmlogListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadCmlogListOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListOutputBuilder;
@@ -588,6 +596,92 @@ public class TestCRUDforDatabase {
}
@Test
+ public void testCMLog() {
+ System.out.println("Starting CM log test...");
+ String dbId = clearAndCreateCMEntity("1", Entity.Cmlog.getName(),
+ "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateCmlogInput");
+ // ==READ===========================
+ System.out.println("try to read entry");
+
+ ReadCmlogListInput readinput = new ReadCmlogListInputBuilder()
+ .setFilter(YangHelper2.getListOrMap(FilterKey.class,
+ new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+ .setPagination(getPagination(20, 1)).build();
+
+ ReadCmlogListOutputBuilder readResult = null;
+ try {
+ readResult = dbProvider.readCMLogList(readinput);
+
+ } catch (Exception e) {
+ fail("CM log not read: " + e.getMessage());
+ }
+
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.Data>
+ data = readResult.getData();
+
+ assertNotNull(data);
+ assertEquals("1", dbId);
+ assertEquals(1, data.size());
+ assertEquals("node-1", data.get(0).getNodeId());
+ assertEquals(1, data.get(0).getCounter().intValue());
+ assertEquals(CmNotificationType.NotifyMOIChanges, data.get(0).getNotificationType());
+ assertEquals("123", data.get(0).getNotificationId());
+ assertEquals(CmSourceIndicator.MANAGEMENTOPERATION, data.get(0).getSourceIndicator());
+ assertEquals(CmOperation.REPLACE, data.get(0).getOperation());
+ assertEquals("pnf-registration:true", data.get(0).getValue());
+
+ //== UPDATE ================================
+ System.out.println("try to update entry");
+
+ dbRawProvider.doUpdateOrCreate(Entity.Cmlog.getName(), "1",
+ "{'node-id': 'test4657-78','operation': 'CREATE', 'notification-id': '1'}");
+
+ System.out.println("try to search entry 1");
+ readinput = new ReadCmlogListInputBuilder()
+ .setFilter(YangHelper2.getListOrMap(FilterKey.class,
+ new FilterBuilder().setProperty("node-id").setFiltervalue("test").build()))
+ .setPagination(getPagination(20, 1)).build();
+
+ //== VERIFY UPDATE ================================
+ readResult = dbProvider.readCMLogList(readinput);
+ data = readResult.getData();
+
+ assertNotNull(data);
+ System.out.println(data);
+ assertEquals(0, data.size());
+
+ System.out.println("try to search entry 2");
+ readinput = new ReadCmlogListInputBuilder()
+ .setFilter(YangHelper2.getListOrMap(FilterKey.class,
+ new FilterBuilder().setProperty("node-id").setFiltervalue("test*").build()))
+ .setPagination(getPagination(20, 1)).build();
+
+ readResult = dbProvider.readCMLogList(readinput);
+ data = readResult.getData();
+
+ assertEquals(1, data.size());
+ assertEquals("test4657-78", data.get(0).getNodeId());
+ assertEquals("CREATE", data.get(0).getOperation().toString());
+ assertEquals("1", data.get(0).getNotificationId());
+
+ //== DELETE ================================
+
+ System.out.println("try to clear entry");
+ try {
+ dbRawProvider.doRemove(Entity.Cmlog.getName(), dbId);
+ } catch (Exception e) {
+ fail("problem deleting entry: " + e.getMessage());
+ }
+
+ //== VERIFY DELETE ===========================
+ System.out.println("verify entries deleted");
+ readResult = dbProvider
+ .readCMLogList(new ReadFaultlogListInputBuilder().setPagination(getPagination(20, 1)).build());
+ data = readResult.getData();
+ assertEquals(0, data.size());
+ }
+
+ @Test
public void testFaultCurrent() {
System.out.println("Starting faultCurrent test...");
String dbId = null;
@@ -1459,6 +1553,45 @@ public class TestCRUDforDatabase {
return dbId;
}
+ private String clearAndCreateCMEntity(String initialDbId, String entityType, String implementedInterface) {
+ // ==CLEAR BEFORE TEST============================
+ System.out.println("try to clear entry");
+ try {
+ dbRawProvider.doRemove(entityType, QueryBuilders.matchAllQuery());
+ } catch (Exception e) {
+ fail("problem deleting: " + e.getMessage());
+ }
+ return createCMEntity(initialDbId, entityType, implementedInterface);
+ }
+
+ private String createCMEntity(String initialDbId, String entityType, String implementedInterface) {
+ // ==CREATE============================
+ System.out.println("try to create entry");
+ String dbId = null;
+
+ try {
+ dbId = dbRawProvider.doUpdateOrCreate(entityType, initialDbId,
+ "{\n" + "\"timestamp\": \"2019-10-28T11:55:58.3Z\",\n"
+ + "\" object-id\": \"LP-MWPS-RADIO\",\n"
+ + "\"node-id\": \"node-1\",\n"
+ + "\"counter\": 1,\n"
+ + "\"notification-type\": \"" + CmNotificationType.NotifyMOIChanges.toString() + "\",\n"
+ + "\"notification-id\": 123,\n"
+ + "\"source-indicator\": \"" + CmSourceIndicator.MANAGEMENTOPERATION.toString() + "\",\n"
+ + "\" path\": \"https://samsung.com/3GPP/simulation/network-function/ves=1\",\n"
+ + "\"operation\": \"" + CmOperation.REPLACE.toString() + "\",\n"
+ + "\"value\": \"pnf-registration:true\",\n"
+ + "\"implemented-interface\": \"" + implementedInterface + "\"\n"
+ + "}");
+
+ } catch (Exception e) {
+ fail("Problem creating CM log entry" + e.getMessage());
+ }
+
+ return dbId;
+ }
+
+
private String createPerformanceData(String initialDbId, GranularityPeriodType timeInterval, String scannerId,
String uuidInterface, String nodename) {
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java
index dc5e049fd..0db019005 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java
@@ -5,6 +5,8 @@
* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
* All rights reserved.
* ================================================================================
+ * Update Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved.
+ * =================================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -38,12 +40,18 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteByQueryRequest;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.DatabaseDataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.data.entity.FaultEntityManager;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.data.entity.HtDatabaseEventsService;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.impl.ElasticSearchDataProvider;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmNotificationType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmOperation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmSourceIndicator;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmlogEntity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionLogStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity;
@@ -77,6 +85,7 @@ public class TestEventService {
private static final String NODEID = "node1";
private static final String NODEID2 = "node2";
+ private static final String NODEID3 = "node3";
private static final String OBJECTREFID1 = "objid1";
private static final String OBJECTREFID2 = "objid2";
@@ -122,6 +131,19 @@ public class TestEventService {
assertTrue(nodeIds.size() == 1);
}
+
+ @Test
+ public void testGenSpecificEsId() {
+ String objectRefOld = FaultEntityManager.genSpecificEsId(createFault(NODEID, "[layerProtocol="+OBJECTREFID1+"]", "abc", SeverityType.Major));
+ assertEquals(String.format("%s/%s/%s", NODEID, OBJECTREFID1, "abc"), objectRefOld);
+ String objectRefOld2 = FaultEntityManager.genSpecificEsId(createFault(NODEID2, "[layerProtocol="+OBJECTREFID2+"]", "abcde", SeverityType.Major));
+ assertEquals(String.format("%s/%s/%s", NODEID2, OBJECTREFID2, "abcde"), objectRefOld2);
+ String objectRef = FaultEntityManager.genSpecificEsId(createFault(NODEID, OBJECTREFID1, "abc", SeverityType.Major));
+ assertEquals(String.format("%s/%s/%s", NODEID, OBJECTREFID1, "abc"), objectRef);
+ String objectRef2 = FaultEntityManager.genSpecificEsId(createFault(NODEID2, OBJECTREFID2, "abcde", SeverityType.Major));
+ assertEquals(String.format("%s/%s/%s", NODEID2, OBJECTREFID2, "abcde"), objectRef2);
+ }
+
private static FaultcurrentEntity createFault(String nodeId, String objectRefId, String problem,
SeverityType severity) {
return createFault(nodeId, objectRefId, problem, severity, NetconfTimeStampImpl.getConverter().getTimeStamp());
@@ -146,6 +168,7 @@ public class TestEventService {
service.doIndexClean(now);
clearDbEntity(Entity.Eventlog);
clearDbEntity(Entity.Faultlog);
+ clearDbEntity(Entity.Cmlog);
TestCRUDforDatabase.trySleep(1000);
service.writeEventLog(createEventLog(NODEID, OBJECTREFID1, "aaa", "abc", 1));
service.writeEventLog(createEventLog(NODEID, OBJECTREFID1, "aaa", "avasvas", 2));
@@ -153,19 +176,27 @@ public class TestEventService {
service.writeFaultLog(createFaultLog(NODEID, OBJECTREFID2, "problem", SeverityType.Major, 1));
service.writeFaultLog(createFaultLog(NODEID, OBJECTREFID2, "problem", SeverityType.NonAlarmed, 2));
service.writeFaultLog(createFaultLog(NODEID2, OBJECTREFID2, "problem", SeverityType.Major, 1));
+
+ service.writeCMLog(createCMLog(NODEID3, 1, CmNotificationType.NotifyMOIChanges,
+ "1", CmSourceIndicator.MANAGEMENTOPERATION, CmOperation.CREATE, "value"));
+
TestCRUDforDatabase.trySleep(100);
now = new Date();
long numOlds = service.getNumberOfOldObjects(now);
- assertEquals(5, numOlds);
+ assertEquals(6, numOlds);
TestCRUDforDatabase.trySleep(100);
service.writeFaultLog(createFaultLog(NODEID, OBJECTREFID2, "problem", SeverityType.Major, 3));
service.writeFaultLog(createFaultLog(NODEID, OBJECTREFID2, "problem", SeverityType.NonAlarmed, 5));
service.writeFaultLog(createFaultLog(NODEID, OBJECTREFID2, "problem", SeverityType.Major, 6));
+
+ service.writeCMLog(createCMLog(NODEID3, 2, CmNotificationType.NotifyMOIChanges,
+ "2", CmSourceIndicator.SONOPERATION, CmOperation.REPLACE, "value2"));
+
numOlds = service.getNumberOfOldObjects(now);
- assertEquals(5, numOlds);
+ assertEquals(6, numOlds);
now = new Date();
numOlds = service.getNumberOfOldObjects(now);
- assertEquals(8, numOlds);
+ assertEquals(10, numOlds);
service.doIndexClean(now);
numOlds = service.getNumberOfOldObjects(now);
assertEquals(0, numOlds);
@@ -292,6 +323,31 @@ public class TestEventService {
/**
* @param nodeId
+ * @param counter
+ * @param notificationType
+ * @param notificationId
+ * @param sourceIndicator
+ * @param operation
+ * @param value
+ * @return
+ */
+ private static CmlogEntity createCMLog(String nodeId, int counter, CmNotificationType notificationType,
+ String notificationId, CmSourceIndicator sourceIndicator,
+ CmOperation operation, String value) {
+ return new CmlogBuilder()
+ .setNodeId(nodeId)
+ .setCounter(counter)
+ .setNotificationType(notificationType)
+ .setNotificationId(notificationId)
+ .setSourceIndicator(sourceIndicator)
+ .setOperation(operation)
+ .setValue(value)
+ .setTimestamp(NetconfTimeStampImpl.getConverter().getTimeStamp())
+ .build();
+ }
+
+ /**
+ * @param nodeId
* @param objectId
* @param problem
* @param severity
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestUserdata.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestUserdata.java
index 3fcbdb84c..ce4044780 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestUserdata.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestUserdata.java
@@ -21,11 +21,11 @@
*/
package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import org.apache.sshd.common.util.io.IoUtils;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
@@ -35,7 +35,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest;
public class TestUserdata {
- private static final String USERNAME = "admin";
+ private static final String USERNAME = "admin132";
private static HtDatabaseClient dbRawProvider;
private static HtUserdataManagerImpl userDbProvider;
@@ -55,17 +55,18 @@ public class TestUserdata {
}
}
- @Ignore
@Test
public void test1() {
String fullContent = "";
+ boolean success = false;
try {
fullContent = getFileContent("/userdata/full.json");
- userDbProvider.setUserdata(USERNAME, fullContent);
+ success = userDbProvider.setUserdata(USERNAME, fullContent);
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
}
+ assertTrue("problem writing data into db",success);
trySleep(2000);
@@ -89,6 +90,6 @@ public class TestUserdata {
}
private static String getFileContent(String filename) throws IOException {
- return String.join("\n", IoUtils.readAllLines(TestTree.class.getResourceAsStream(filename)));
+ return String.join("\n", IoUtils.readAllLines(TestUserdata.class.getResourceAsStream(filename)));
}
}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java
index f3171d3b1..adcb523c0 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java
@@ -54,6 +54,8 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.yangschema.YangSchemaHt
public class TestYangProvider {
private static final String TESTPATH = "cache/schema/";
+ private static final String TESTPATH_BASE = "cache/";
+ private static final String TESTPATH_SEPERATE_1 = TESTPATH_BASE+"abc1/";
@BeforeClass
@@ -76,7 +78,9 @@ public class TestYangProvider {
new File(TESTPATH + new YangFilename("module4", "2010-05-01").getFilename()).createNewFile();
new File(TESTPATH + new YangFilename("module5", "2010-01-11").getFilename()).createNewFile();
new File(TESTPATH + new YangFilename("module6", "2010-01-01").getFilename()).createNewFile();
- } catch (IOException | ParseException e) {
+ Files.createDirectories(new File(TESTPATH_SEPERATE_1).toPath(), attr);
+ new File(TESTPATH_SEPERATE_1 + new YangFilename("module7", "2011-01-01").getFilename()).createNewFile();
+ } catch (IOException | ParseException e) {
}
}
@@ -93,17 +97,18 @@ public class TestYangProvider {
@Test
public void testExisting() {
- YangFileProvider provider = new YangFileProvider(TESTPATH);
+ YangFileProvider provider = new YangFileProvider(TESTPATH_BASE, TESTPATH);
assertTrue(provider.hasFileForModule("module1", "2010-01-01"));
assertTrue(provider.hasFileForModule("module2"));
assertTrue(provider.hasFileForModule("module3"));
assertFalse(provider.hasFileForModule("module5", "2010-01-01"));
+ assertTrue(provider.hasFileForModule("module7"));
}
@Test
public void testRevision() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- YangFileProvider provider = new YangFileProvider(TESTPATH);
+ YangFileProvider provider = new YangFileProvider(TESTPATH_BASE, TESTPATH);
YangFilename f1 = provider.getFileForModule("module1", "2010-01-01");
assertEquals("module1", f1.getModule());
assertEquals(sdf.parse("2010-01-01"), f1.getRevision());
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java
index 276bcf4a1..18efde235 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java
@@ -5,6 +5,8 @@
* Copyright (C) 2021 highstreet technologies GmbH Intellectual Property.
* All rights reserved.
* ================================================================================
+ * Update Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved.
+ * =================================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -34,6 +36,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.SqlDBConfig;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.data.SqlDBDataProvider;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.database.SqlDBMapper;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.database.SqlDBMapper.UnableToMapClassException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmlogEntity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
@@ -127,6 +130,7 @@ public class MariaDBTestBase {
createTable(dbService, EventlogEntity.class, Entity.Eventlog, true);
createTable(dbService, FaultcurrentEntity.class, Entity.Faultcurrent, false);
createTable(dbService, FaultlogEntity.class, Entity.Faultlog, true);
+ createTable(dbService, CmlogEntity.class, Entity.Cmlog, true);
createTable(dbService, GuicutthroughEntity.class, Entity.Guicutthrough, true);
createTable(dbService, Pmdata15mEntity.class, Entity.Historicalperformance15min, false);
createTable(dbService, Pmdata24hEntity.class, Entity.Historicalperformance24h, false);