27bd839b8081376300bfa8e808a03a08ae0faeed
[portal/sdk.git] /
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : Portal SDK
4 * ================================================================================
5 * Copyright 2018 TechMahindra
6 *=================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *     http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20 package org.onap.portalsdk.analytics.system.fusion.adapter;
21
22 import static org.junit.Assert.*;
23 import static org.mockito.Mockito.mock;
24 import static org.mockito.Mockito.verify;
25 import static org.mockito.Mockito.when;
26
27 import java.beans.PropertyVetoException;
28 import java.sql.Connection;
29 import java.sql.SQLException;
30 import java.util.Map;
31
32 import javax.servlet.ServletContext;
33 import javax.sql.ConnectionPoolDataSource;
34 import javax.sql.PooledConnection;
35
36 import org.junit.Test;
37 import org.mockito.Mock;
38
39 import com.mchange.v2.c3p0.ComboPooledDataSource;
40 import com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource;
41 import com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager;
42 import com.mchange.v2.c3p0.impl.DbAuth;
43
44 public class FusionAdapterTest {
45         
46         FusionAdapter fa=new FusionAdapter();
47         ComboPooledDataSource dataSource;
48         Map<String,ComboPooledDataSource> dataSourceMap;
49         ServletContext servletContext;
50         @Test
51         public void test() {
52         fa.setDataSource(dataSource);   
53         fa.setdataSourceMap(dataSourceMap);
54         fa.setServletContext(servletContext);
55         assertEquals(fa.getDataSource(), dataSource);
56         assertEquals(fa.getServletContext(), servletContext);
57         }
58 }