use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterOpenBlobCountTest 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 Blob resultSet_getBlob(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new MockBlob();
}
@Override
public Blob resultSet_getBlob(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
return new MockBlob();
}
});
dataSource.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterOpenBlobCountTest2 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 Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new MockBlob();
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
return new MockBlob();
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex, java.util.Map<String, Class<?>> map) throws SQLException {
return new MockBlob();
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnIndex, java.util.Map<String, Class<?>> map) throws SQLException {
return new MockBlob();
}
});
dataSource.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterOpenClobCountTest2 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 Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new ClobProxyImpl(result.getStatementProxy().getConnectionProxy().getDirectDataSource(), result.getStatementProxy().getConnectionProxy(), new MockClob());
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
return new ClobProxyImpl(result.getStatementProxy().getConnectionProxy().getDirectDataSource(), result.getStatementProxy().getConnectionProxy(), new MockClob());
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex, java.util.Map<String, Class<?>> map) throws SQLException {
return new ClobProxyImpl(result.getStatementProxy().getConnectionProxy().getDirectDataSource(), result.getStatementProxy().getConnectionProxy(), new MockClob());
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnIndex, java.util.Map<String, Class<?>> map) throws SQLException {
return new ClobProxyImpl(result.getStatementProxy().getConnectionProxy().getDirectDataSource(), result.getStatementProxy().getConnectionProxy(), new MockClob());
}
});
dataSource.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class FilterChainTest_ResultSet_2 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
ConnectionProxyImpl conn = new ConnectionProxyImpl(dataSource, null, new Properties(), 0);
MockCallableStatement mockStmt = new MockCallableStatement(null, "") {
@Override
public Object getObject(int parameterIndex) throws SQLException {
invokeCount++;
return new MockResultSet(null);
}
};
statement = new CallableStatementProxyImpl(conn, mockStmt, "", 1);
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class ConfigFilterTest2 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setFilters("config");
}
Aggregations