Package com.alibaba.druid.support.logging

Examples of com.alibaba.druid.support.logging.Log


    }

    public void test_oracle() throws Exception {
        Field field = DruidDataSource.class.getDeclaredField("LOG");
        field.setAccessible(true);
        Log log = (Log) field.get(null);
        log.resetStat();
       
        Connection conn = dataSource.getConnection();
       
        conn.close();
       
        Assert.assertEquals(1, log.getErrorCount());
    }
View Full Code Here


    }

    public void test_connect() throws Exception {
        Field field = DruidDataSource.class.getDeclaredField("LOG");
        field.setAccessible(true);
        Log LOG = (Log) field.get(null);
       
        LOG.resetStat();
       
        Assert.assertEquals(0, LOG.getErrorCount());
       
        Connection conn = dataSource.getConnection();
        conn.close();
       
        Assert.assertEquals(1, LOG.getErrorCount());
    }
View Full Code Here

    }

    public void test_connect() throws Exception {
        Field field = DruidDataSource.class.getDeclaredField("LOG");
        field.setAccessible(true);
        Log LOG = (Log) field.get(null);
       
        LOG.resetStat();
       
        Assert.assertEquals(0, LOG.getErrorCount());

        Connection conn = dataSource.getConnection();
        conn.close();
       
        Assert.assertEquals(1, LOG.getErrorCount());
    }
View Full Code Here

    }

    public void test_connect() throws Exception {
        Field field = DruidDataSource.class.getDeclaredField("LOG");
        field.setAccessible(true);
        Log LOG = (Log) field.get(null);
       
        LOG.resetStat();
       
        Assert.assertEquals(0, LOG.getErrorCount());
        dataSource.init();
        Assert.assertEquals(0, LOG.getErrorCount());
    }
View Full Code Here

    }

    public void test_oracle() throws Exception {
        Field field = DruidDataSource.class.getDeclaredField("LOG");
        field.setAccessible(true);
        Log log = (Log) field.get(null);
        log.resetStat();
       
        Connection conn = dataSource.getConnection();
       
        conn.close();
       
       
        Assert.assertEquals(1, log.getErrorCount());
    }
View Full Code Here

        dataSource.setTestWhileIdle(true);

        Field field = DruidDataSource.class.getDeclaredField("LOG");
        dataSource.setValidationQuery("select 1");
        field.setAccessible(true);
        Log LOG = (Log) field.get(null);

        LOG.resetStat();

        Assert.assertEquals(0, LOG.getWarnCount());
        dataSource.init();
        Assert.assertEquals(0, LOG.getWarnCount());
    }
View Full Code Here

    public void test_warn() throws Exception {
        dataSource.setTestWhileIdle(false);

        Field field = DruidDataSource.class.getDeclaredField("LOG");
        field.setAccessible(true);
        Log LOG = (Log) field.get(null);

        LOG.resetStat();

        Assert.assertEquals(0, LOG.getWarnCount());
        dataSource.init();
        Assert.assertEquals(0, LOG.getWarnCount());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.support.logging.Log

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.