完善mock和测试

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@786 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-16 00:39:49 +00:00
parent 4b7798248d
commit 8549dd0754
4 changed files with 178 additions and 33 deletions
@@ -739,41 +739,58 @@ public class MockResultSet implements ResultSet {
@Override
public void insertRow() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public void updateRow() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public void deleteRow() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public void refreshRow() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public void cancelRowUpdates() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public void moveToInsertRow() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public void moveToCurrentRow() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
}
@Override
public Statement getStatement() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
return statement;
}
@@ -909,14 +926,12 @@ public class MockResultSet implements ResultSet {
@Override
public RowId getRowId(int columnIndex) throws SQLException {
return null;
return (RowId) getObject(columnIndex);
}
@Override
public RowId getRowId(String columnLabel) throws SQLException {
return null;
return (RowId) getObject(columnLabel);
}
@Override
@@ -931,14 +946,16 @@ public class MockResultSet implements ResultSet {
@Override
public int getHoldability() throws SQLException {
if (closed) {
throw new SQLException("resultSet closed");
}
return 0;
}
@Override
public boolean isClosed() throws SQLException {
return false;
return closed;
}
@Override
@@ -1073,12 +1073,8 @@ public final class PoolableResultSet extends PoolableWrapper implements ResultSe
}
@Override
public Statement getStatement() throws SQLException {
try {
return stmt;
} catch (Throwable t) {
throw checkException(t);
}
public Statement getStatement() {
return stmt;
}
@Override