diff options
author | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-03-13 18:31:21 +0200 |
---|---|---|
committer | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-03-13 18:31:21 +0200 |
commit | d5ec7bf55217508e2b5cebe640d586598379f97a (patch) | |
tree | 4bbe052d2eb67c11c5fbc22998c95e55e7aef4d0 /vid-app-common/src/test/java/org/onap/vid/dao | |
parent | 80098ffa01c5a0f4dd5b99f41c31d51e9dc25762 (diff) |
Unit tests
Change-Id: Ib9f73b7ba5a509610896b8bbdc02c180e60ee959
Issue-ID: VID-197
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/dao')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java b/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java new file mode 100644 index 00000000..843883cd --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java @@ -0,0 +1,97 @@ +package org.onap.vid.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.junit.Assert; +import org.junit.Test; + +public class FnAppDoaImplTest { + + private FnAppDoaImpl createTestSubject() { + return new FnAppDoaImpl(); + } + + @Test + public void testGetConnection() throws Exception { + String driver2 = ""; + String url = ""; + String username = ""; + String password = ""; + Connection result; + + // test 1 + url = null; + username = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 2 + url = ""; + username = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 3 + username = null; + url = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 4 + username = ""; + url = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 5 + password = null; + url = null; + username = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 6 + password = ""; + url = null; + username = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + } + + @Test + public void testCleanup() throws Exception { + ResultSet rs = null; + PreparedStatement st = null; + + // test 1 + rs = null; + FnAppDoaImpl.cleanup(rs, st, null); + + // test 2 + st = null; + FnAppDoaImpl.cleanup(rs, st, null); + + // test 3 + FnAppDoaImpl.cleanup(rs, st, null); + } + + @Test + public void testGetProfileCount() throws Exception { + FnAppDoaImpl testSubject; + String driver = ""; + String URL = ""; + String username = ""; + String password = ""; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProfileCount(driver, URL, username, password); + } +}
\ No newline at end of file |