use of com.alibaba.druid.proxy.jdbc.ResultSetProxy 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.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class FilterChainTest_ResultSet method test_resultSet_getObject.
public void test_resultSet_getObject() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
ResultSet clob = (ResultSet) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), 1);
Assert.assertTrue(clob instanceof ResultSetProxy);
Assert.assertEquals(1, invokeCount);
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class FilterChainTest_ResultSet method test_resultSet_getObject_1.
public void test_resultSet_getObject_1() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
ResultSet clob = (ResultSet) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), "1");
Assert.assertTrue(clob instanceof ResultSetProxy);
Assert.assertEquals(1, invokeCount);
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class FilterChainTest_ResultSet_2 method test_getObject_1.
public void test_getObject_1() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
ResultSet clob = (ResultSet) chain.callableStatement_getObject(statement, "1");
Assert.assertTrue(clob instanceof ResultSetProxy);
Assert.assertEquals(1, invokeCount);
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class FilterChainTest_ResultSet_2 method test_getObject_3.
public void test_getObject_3() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
ResultSet clob = (ResultSet) chain.callableStatement_getObject(statement, "1", Collections.<String, Class<?>>emptyMap());
Assert.assertTrue(clob instanceof ResultSetProxy);
Assert.assertEquals(1, invokeCount);
}
Aggregations