use of com.alibaba.druid.filter.stat.StatFilter in project druid by alibaba.
the class StatFilterConcurrentTest method setUp.
public void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setMaxActive(100);
statFilter = new StatFilter();
dataSource.getProxyFilters().add(statFilter);
dataSource.setConnectionProperties("executeSleep=1");
}
use of com.alibaba.druid.filter.stat.StatFilter in project druid by alibaba.
the class StatFilterTest3 method test_dbType_error.
public void test_dbType_error() throws Exception {
StatFilter filter = new StatFilter();
filter.setDbType("mysql");
filter.setMergeSql(true);
Assert.assertEquals("mysql", filter.getDbType());
Assert.assertEquals("sdafawer asf ", filter.mergeSql("sdafawer asf "));
}
use of com.alibaba.druid.filter.stat.StatFilter in project druid by alibaba.
the class StatFilterTest3 method test_merge.
public void test_merge() throws Exception {
StatFilter filter = new StatFilter();
filter.setDbType("mysql");
filter.setMergeSql(false);
Assert.assertEquals("mysql", filter.getDbType());
Assert.assertEquals("select 'x' limit 1", filter.mergeSql("select 'x' limit 1"));
}
Aggregations