Package com.alibaba.druid.pool

Examples of com.alibaba.druid.pool.DruidDataSource$CreateConnectionTask


public class StatFilterOpenClobCountTest2 extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();

        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setFilters("stat");
        dataSource.setTestOnBorrow(false);
        dataSource.getProxyFilters().add(new FilterAdapter() {
View Full Code Here


    private DruidDataSource dataSource;

    @Override
    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:h2:mem:test");
        //dataSource.setUrl("jdbc:mysql://localhost:3306/druid-monitor");
        dataSource.setUsername("druid");
        dataSource.setPassword("druid");
        dataSource.setInitialSize(1);
View Full Code Here

import com.alibaba.druid.pool.DruidDataSource;


public class ClearFilterTest extends TestCase {
    public void test_filters() throws Exception {
        DruidDataSource dataSource = new DruidDataSource();
        Assert.assertEquals(0, dataSource.getProxyFilters().size());
        dataSource.setFilters("encoding");
        Assert.assertEquals(1, dataSource.getProxyFilters().size());
        dataSource.setFilters("!stat");
        Assert.assertEquals(1, dataSource.getProxyFilters().size());
        Assert.assertEquals(StatFilter.class.getName(), dataSource.getFilterClassNames().get(0));
        dataSource.setClearFiltersEnable(false);
        dataSource.setFilters("!encoding");
        Assert.assertEquals(StatFilter.class.getName(), dataSource.getFilterClassNames().get(0));
        Assert.assertEquals(EncodingConvertFilter.class.getName(), dataSource.getFilterClassNames().get(1));
       
        dataSource.setConnectionProperties("druid.clearFiltersEnable=false");
        Assert.assertFalse(dataSource.isClearFiltersEnable());
       
        dataSource.setConnectionProperties("druid.clearFiltersEnable=true");
        Assert.assertTrue(dataSource.isClearFiltersEnable());
       
        dataSource.setConnectionProperties("druid.clearFiltersEnable=xx"); // no change
        Assert.assertTrue(dataSource.isClearFiltersEnable());
       
        dataSource.close();
    }
View Full Code Here

public class SavepointTest extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setInitialSize(1);

    }
View Full Code Here

    private DruidDataSource dataSource;

    private AtomicInteger   validCount = new AtomicInteger();

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setTestWhileIdle(true);
        dataSource.setTimeBetweenEvictionRunsMillis(20);
        dataSource.setValidationQuery("select 'x'");
View Full Code Here

public class DruidDataSourceTest_oracle2 extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setFilters("stat");
        dataSource.setDbType("oracle");
        dataSource.setPoolPreparedStatements(true);
View Full Code Here

public class StatFilterReadBytesLengthTest extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();

        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setFilters("stat");
        dataSource.setTestOnBorrow(false);
        dataSource.getProxyFilters().add(new FilterAdapter() {
View Full Code Here

public class DruidPooledResultSetTest2 extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
    }
View Full Code Here

public class PSCacheTest extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:x1");
        dataSource.setPoolPreparedStatements(true);
        dataSource.setMaxOpenPreparedStatements(10);
    }
View Full Code Here

public class PropertyTest_filters extends TestCase {
    private DruidDataSource dataSource;

    public void test_stat() {
        System.setProperty("druid.filters", "stat");
        dataSource = new DruidDataSource();
        Assert.assertEquals(1, dataSource.getProxyFilters().size());
        Assert.assertEquals("com.alibaba.druid.filter.stat.StatFilter", dataSource.getFilterClassNames().get(0));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.pool.DruidDataSource$CreateConnectionTask

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.