use of com.alibaba.druid.mock.MockDriver in project druid by alibaba.
the class Bug_for_happyday517 method setUp.
protected void setUp() throws Exception {
super.setUp();
originalDataSourceCount = DruidDataSourceStatManager.getInstance().getDataSourceList().size();
driver = new MockDriver();
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat,trace,log4j,encoding");
}
use of com.alibaba.druid.mock.MockDriver in project druid by alibaba.
the class Bug_for_happyday517_3 method setUp.
protected void setUp() throws Exception {
originalDataSourceCount = DruidDataSourceStatManager.getInstance().getDataSourceList().size();
driver = new MockDriver();
dataSource = new DruidDataSource();
dataSource.setDriver(driver);
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat,trace,log4j,encoding");
dataSource.setDefaultAutoCommit(false);
}
use of com.alibaba.druid.mock.MockDriver in project druid by alibaba.
the class Bug_for_happyday517_2 method setUp.
protected void setUp() throws Exception {
originalDataSourceCount = DruidDataSourceStatManager.getInstance().getDataSourceList().size();
final MockPreparedStatement mockStatement = new MockPreparedStatement(null, null) {
public boolean execute() throws SQLException {
throw exception;
}
};
driver = new MockDriver() {
public Connection connect(String url, Properties info) throws SQLException {
super.connect(url, info);
return new MockConnection(driver, url, info) {
public PreparedStatement prepareStatement(String sql) throws SQLException {
return mockStatement;
}
};
}
};
dataSource = new DruidDataSource();
dataSource.setDriver(driver);
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat,trace,log4j,encoding");
}
use of com.alibaba.druid.mock.MockDriver in project druid by alibaba.
the class Bug_for_xuershan method setUp.
protected void setUp() throws Exception {
driver = new MockDriver() {
public ResultSet createResultSet(MockPreparedStatement stmt) {
return null;
}
};
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xx");
dataSource.setDriver(driver);
}
use of com.alibaba.druid.mock.MockDriver in project druid by alibaba.
the class TestPoolPreparedStatement2 method setUp.
protected void setUp() throws Exception {
DruidDataSourceStatManager.clear();
driver = new MockDriver();
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setDriver(driver);
dataSource.setInitialSize(1);
dataSource.setMaxActive(2);
dataSource.setMaxIdle(2);
dataSource.setMinIdle(1);
// 300 / 10
dataSource.setMinEvictableIdleTimeMillis(300 * 1000);
// 180 / 10
dataSource.setTimeBetweenEvictionRunsMillis(10);
dataSource.setTestWhileIdle(true);
dataSource.setTestOnBorrow(false);
dataSource.setValidationQuery("SELECT 1");
dataSource.setFilters("stat");
dataSource.setPoolPreparedStatements(false);
dataSource.setMaxPoolPreparedStatementPerConnectionSize(20);
// ((StatFilter) dataSource.getProxyFilters().get(0)).setMaxSqlStatCount(100);
}
Aggregations