use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterExecErrorTest method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat");
dataSource.setTestOnBorrow(false);
dataSource.getProxyFilters().add(new FilterAdapter() {
@Override
public ResultSetProxy statement_executeQuery(FilterChain chain, StatementProxy statement, String sql) throws SQLException {
throw new SQLException();
}
@Override
public ResultSetProxy preparedStatement_executeQuery(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
throw new SQLException();
}
});
dataSource.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterExecuteFirstResultSetTest method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat");
dataSource.setTestOnBorrow(false);
MockDriver driver = new MockDriver() {
public MockPreparedStatement createMockPreparedStatement(MockConnection conn, String sql) {
return new MyMockPreparedStatement(conn, sql);
}
};
dataSource.setDriver(driver);
dataSource.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class FilterChainTest_Clob_2 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
MockCallableStatement mockStmt = new MockCallableStatement(null, "") {
@Override
public Object getObject(int parameterIndex) throws SQLException {
invokeCount++;
return new MockClob();
}
};
statement = new CallableStatementProxyImpl(new ConnectionProxyImpl(null, null, null, 0), mockStmt, "", 1);
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class FilterChainTest_NClob method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
ConnectionProxyImpl conn = new ConnectionProxyImpl(dataSource, null, new Properties(), 0);
statement = new StatementProxyImpl(conn, null, 1);
mockResultSet = new MockResultSet(null) {
public Object getObject(int columnIndex) throws SQLException {
invokeCount++;
return new MockNClob();
}
};
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class FilterChainTest_Clob method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
ConnectionProxyImpl conn = new ConnectionProxyImpl(dataSource, null, new Properties(), 0);
statement = new StatementProxyImpl(conn, null, 1);
mockResultSet = new MockResultSet(null) {
public Object getObject(int columnIndex) throws SQLException {
invokeCount++;
return new MockClob();
}
};
}
Aggregations