public void test_stat() throws Exception {
Assert.assertTrue(dataSource.isInited());
EncodingConvertFilter filter = (EncodingConvertFilter) dataSource.getProxyFilters().get(0);
DruidPooledConnection conn = dataSource.getConnection();
final String PARAM_VALUE = "中国";
CallableStatement stmt = conn.prepareCall("select ?");
stmt.setString(1, PARAM_VALUE);
MockCallableStatement raw = stmt.unwrap(MockCallableStatement.class);
stmt.execute();
String param1 = (String) raw.getParameters().get(0);
String C_TEXT = new String(param1.getBytes(SERVER_ENCODING), CLIENT_ENCODING);
Assert.assertEquals(PARAM_VALUE, C_TEXT);
Assert.assertFalse(param1.equals(PARAM_VALUE));
MyResultSet rawRs = new MyResultSet(raw);
rawRs.setValue(filter.encode((ConnectionProxy) conn.getConnection(), text));
raw.getOutParameters().add(rawRs);
ResultSet rs = (ResultSet) stmt.getObject(1);