config.setUrl("");
DataSourceProxyImpl dataSource = new DataSourceProxyImpl(null, config);
JdbcDataSourceStat dataSourceStat = dataSource.getDataSourceStat();
StatFilter filter = new StatFilter();
filter.init(dataSource);
dataSourceStat.reset();
Assert.assertNull(StatFilter.getStatFilter(dataSource));
Assert.assertNull(dataSourceStat.getSqlStat(Integer.MAX_VALUE));
Assert.assertNull(dataSourceStat.getConnectionStat().getConnectLastTime());
FilterChain chain = new FilterChainImpl(dataSource) {
public ConnectionProxy connection_connect(Properties info) throws SQLException {
throw new SQLException();
}
};
Exception error = null;
try {
filter.connection_connect(chain, new Properties());
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
Assert.assertEquals(1, dataSourceStat.getConnectionStat().getConnectErrorCount());