aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/data-provider/setup/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/setup/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/setup/src/test')
-rw-r--r--sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java4
-rw-r--r--sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestBaseReleaseInformation.java34
-rw-r--r--sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestHonoluluReleaseInformation.java34
-rw-r--r--sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestJakartaReleaseInformation.java46
-rw-r--r--sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBJakarta.java (renamed from sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBIstanbul.java)4
5 files changed, 120 insertions, 2 deletions
diff --git a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java
index 264f1203c..6fd4a40a4 100644
--- a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java
+++ b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/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
@@ -35,6 +37,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;
@@ -136,6 +139,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);
diff --git a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestBaseReleaseInformation.java b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestBaseReleaseInformation.java
new file mode 100644
index 000000000..143611f36
--- /dev/null
+++ b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestBaseReleaseInformation.java
@@ -0,0 +1,34 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.setup;
+
+import static org.junit.Assert.assertNotNull;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.ComponentName;
+
+public class TestBaseReleaseInformation {
+
+ protected void assertValidComponents(ReleaseInformation ri) {
+
+ assertNotNull(ri.getComponents());
+ assertNotNull(ri.getConverter(ri.getReleas(),ComponentName.FAULTCURRENT));
+ }
+}
diff --git a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestHonoluluReleaseInformation.java b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestHonoluluReleaseInformation.java
new file mode 100644
index 000000000..727d116fd
--- /dev/null
+++ b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestHonoluluReleaseInformation.java
@@ -0,0 +1,34 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.setup;
+
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.honolulu.HonoluluReleaseInformation;
+
+public class TestHonoluluReleaseInformation extends TestBaseReleaseInformation{
+
+ @Test
+ public void test() {
+ this.assertValidComponents(new HonoluluReleaseInformation());
+ }
+
+}
diff --git a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestJakartaReleaseInformation.java b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestJakartaReleaseInformation.java
new file mode 100644
index 000000000..6258e31c2
--- /dev/null
+++ b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestJakartaReleaseInformation.java
@@ -0,0 +1,46 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.setup;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import java.util.Set;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.ComponentName;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.jakarta.JakartaReleaseInformation;
+
+public class TestJakartaReleaseInformation {
+
+ @Test
+ public void testReleaseInformation() {
+ JakartaReleaseInformation ri = new JakartaReleaseInformation();
+ Set<ComponentName> components = ri.getComponents();
+ assertTrue(components.contains(ComponentName.USERDATA));
+ assertTrue(components.contains(ComponentName.REQUIRED_NETWORKELEMENT));
+ assertTrue(components.contains(ComponentName.CMLOG));
+ assertEquals("userdata", ri.getAlias(ComponentName.USERDATA));
+ assertEquals("networkelement-connection", ri.getAlias(ComponentName.REQUIRED_NETWORKELEMENT));
+ assertEquals("cmlog", ri.getAlias(ComponentName.CMLOG));
+ assertEquals("cmlog-v7", ri.getIndex(ComponentName.CMLOG));
+ }
+
+}
diff --git a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBIstanbul.java b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBJakarta.java
index 072ce2f6b..d657704fb 100644
--- a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBIstanbul.java
+++ b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBJakarta.java
@@ -34,7 +34,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.SdnrDbType;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.Release;
import ch.vorburger.exec.ManagedProcessException;
-public class TestMariaDBIstanbul {
+public class TestMariaDBJakarta {
private static final String MARIADB_USERNAME = "sdnrdb";
private static final String MARIADB_PASSWORD = "sdnrdb";
@@ -78,7 +78,7 @@ public class TestMariaDBIstanbul {
e.printStackTrace();
fail(e.getMessage());
}
- boolean success = provider.initDatabase(Release.ISTANBUL_R1, 1, 1, "", false, 1000);
+ boolean success = provider.initDatabase(Release.JAKARTA_R1, 1, 1, "", false, 1000);
assertTrue("init database failed",success);
try {
dbProvider.setControllerId();