aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java
blob: e7a7e3a37710b0978937bec6071fd2083105a4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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);
        Assert.assertEquals(null, result);

        // test 2
        url = "";
        username = null;
        password = null;
        result = FnAppDoaImpl.getConnection(driver2, url, username);
        Assert.assertEquals(null, result);

        // test 3
        username = null;
        url = null;
        password = null;
        result = FnAppDoaImpl.getConnection(driver2, url, username);
        Assert.assertEquals(null, result);

        // test 4
        username = "";
        url = null;
        password = null;
        result = FnAppDoaImpl.getConnection(driver2, url, username);
        Assert.assertEquals(null, result);

        // test 5
        password = null;
        url = null;
        username = null;
        result = FnAppDoaImpl.getConnection(driver2, url, username);
        Assert.assertEquals(null, result);

        // test 6
        password = "";
        url = null;
        username = null;
        result = FnAppDoaImpl.getConnection(driver2, url, username);
        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);
    }
}