Package com.alibaba.druid.pool

Examples of com.alibaba.druid.pool.DruidDataSourceFactory


    protected void tearDown() throws Exception {
        JdbcUtils.close(dataSource);
    }

    public void test_factory() throws Exception {
        DruidDataSourceFactory factory = new DruidDataSourceFactory();

        Reference ref = new Reference(DataSource.class.getName());
        ref.add(new StringRefAddr(DruidDataSourceFactory.PROP_REMOVEABANDONED, "true"));
        ref.add(new StringRefAddr(DruidDataSourceFactory.PROP_MAXACTIVE, "20"));

        Hashtable<String, String> env = new Hashtable<String, String>();

        dataSource = (DruidDataSource) factory.getObjectInstance(ref, null, null, env);

        Assert.assertTrue(dataSource.isRemoveAbandoned());
        Assert.assertEquals(20, dataSource.getMaxActive());
    }
View Full Code Here


public class DruidDataSourceFactoryTest extends TestCase {

    @SuppressWarnings("serial")
    public void test_factory() throws Exception {
        DruidDataSourceFactory factory = new DruidDataSourceFactory();

        Assert.assertNull(factory.getObjectInstance(null, null, null, null));
        Assert.assertNull(factory.getObjectInstance(new Reference("javax.sql.Date"), null, null, null));

        Reference ref = new Reference("javax.sql.DataSource");
        ref.add(new RefAddr("user") {

            @Override
            public Object getContent() {
                return null;
            }

        });
        ref.add(new RefAddr("defaultReadOnly") {

            @Override
            public Object getContent() {
                return Boolean.TRUE;
            }

        });

        factory.getObjectInstance(ref, null, null, new Hashtable<Object, Object>());
    }
View Full Code Here

import com.alibaba.druid.pool.DruidDataSourceFactory;

public class DruidDataSourceFactoryTest0 extends TestCase {

    public void test_factory_null() throws Exception {
        DruidDataSourceFactory factory = new DruidDataSourceFactory();
        Assert.assertNull(factory.getObjectInstance(null, null, null, null));
    }
View Full Code Here

        DruidDataSourceFactory factory = new DruidDataSourceFactory();
        Assert.assertNull(factory.getObjectInstance(null, null, null, null));
    }
   
    public void test_factory_null_1() throws Exception {
        DruidDataSourceFactory factory = new DruidDataSourceFactory();
        Assert.assertNull(factory.getObjectInstance(new Object(), null, null, null));
    }
View Full Code Here

            JdbcUtils.close(dataSource);
        }
    }

    public void test_getObjectInstance() throws Exception {
        Assert.assertNull(new DruidDataSourceFactory().getObjectInstance(null, null, null, null));
    }
View Full Code Here

    public void test_getObjectInstance() throws Exception {
        Assert.assertNull(new DruidDataSourceFactory().getObjectInstance(null, null, null, null));
    }
   
    public void test_getObjectInstance_1() throws Exception {
        Assert.assertNull(new DruidDataSourceFactory().getObjectInstance(new Object(), null, null, null));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.pool.DruidDataSourceFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.