完善mock和测试

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@830 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-18 03:34:12 +00:00
parent 40ab2d3d3a
commit 683d2c1503
@@ -57,13 +57,30 @@ public class MockStatement implements Statement {
this.connection = fakeConnection;
}
@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface == null) {
return null;
}
if (iface.isInstance(this)) {
return (T) this;
}
return null;
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
if (iface == null) {
return false;
}
if (iface.isInstance(this)) {
return true;
}
return false;
}