2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 package org.onap.portalsdk.analytics.system.fusion.adapter;
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;
27 import java.beans.PropertyVetoException;
28 import java.sql.Connection;
29 import java.sql.SQLException;
32 import javax.servlet.ServletContext;
33 import javax.sql.ConnectionPoolDataSource;
34 import javax.sql.PooledConnection;
36 import org.junit.Test;
37 import org.mockito.Mock;
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;
44 public class FusionAdapterTest {
46 FusionAdapter fa=new FusionAdapter();
47 ComboPooledDataSource dataSource;
48 Map<String,ComboPooledDataSource> dataSourceMap;
49 ServletContext servletContext;
52 fa.setDataSource(dataSource);
53 fa.setdataSourceMap(dataSourceMap);
54 fa.setServletContext(servletContext);
55 assertEquals(fa.getDataSource(), dataSource);
56 assertEquals(fa.getServletContext(), servletContext);