summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-10-02 01:10:21 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-10-02 01:10:39 +0530
commit2f5bc084af648187c9fcffb8ff6472f8755c034d (patch)
tree3e0073226f4639cc479b2a35a1d97d92f126471f
parent6f094ba9114abf9983bb6de3b365919b88df3af3 (diff)
added test cases to CachedDataSource
to increase code coverage Issue-ID: CCSDK-595 Change-Id: I7d5a5ed59538e7d6e1a7d00dfba690eedc7c2e22 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--dblib/provider/src/test/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/dblib/provider/src/test/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceTest.java b/dblib/provider/src/test/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceTest.java
index c463f38b..45268107 100644
--- a/dblib/provider/src/test/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceTest.java
+++ b/dblib/provider/src/test/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceTest.java
@@ -1,10 +1,12 @@
package org.onap.ccsdk.sli.core.dblib;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
@@ -94,4 +96,26 @@ public class CachedDataSourceTest {
assertEquals("passw0rd", ((JdbcDBCachedDataSource) ds).getDbPasswd());
assertEquals("testdb01", ((JdbcDBCachedDataSource) ds).toString());
}
+
+ @Test
+ public void testIsInitialised() {
+ assertTrue(ds.isInitialized());
+ }
+
+ @Test
+ public void testIsWrapperFor() throws SQLException {
+ assertFalse(ds.isWrapperFor(CachedDataSource.class));
+ }
+
+ @Test
+ public void testGetSetNextErrorReportTime() throws SQLException {
+ ds.setNextErrorReportTime(1L);
+ assertEquals(1L, ds.getNextErrorReportTime());
+ }
+
+ @Test
+ public void testGetSetGlobalHostName() throws SQLException {
+ ds.setGlobalHostName("hostName");
+ assertEquals("hostName", ds.getGlobalHostName());
+ }
} \ No newline at end of file