From: Jeff M. <cus...@us...> - 2002-12-04 12:39:26
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/1.4/com/mockobjects/sql In directory sc8-pr-cvs1:/tmp/cvs-serv26378/src/jdk/1.4/com/mockobjects/sql Modified Files: MockConnection.java Added Files: MockConnection2.java Log Message: Added a new implementation of MockConnection called MockConnection2 which starts to make use of ReturnObjectBag Added new constructor to MockMultiRowResultSet to provide better naming of mocks when raising errors --- NEW FILE: MockConnection2.java --- package com.mockobjects.sql; import java.sql.Savepoint; import java.sql.SQLException; /** * MockConnection2 is a tempary replacement for the MockConnection. * It differs from the MockConnection in the way in which preparedstatements * are handled. The changes are significant enough to break compatiblity with * exsising testcases so MockConnection2 provides a migration path to the new * system of handling preparedstatements. * This calls will eventually be merged back into MockConnection when it is felt * systems using the classes have been provided with enough time to migrate. */ public class MockConnection2 extends CommonMockConnection2{ private final MockConnection connection = new MockConnection(); public MockConnection2() { } public MockConnection2(String name) { super(name); } public void releaseSavepoint(Savepoint savepoint) throws SQLException { connection.releaseSavepoint(savepoint); } public void rollback(Savepoint savepoint) throws SQLException { connection.rollback(savepoint); } public Savepoint setSavepoint() throws SQLException { return connection.setSavepoint(); } public Savepoint setSavepoint(String name) throws SQLException { return connection.setSavepoint(); } } Index: MockConnection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/1.4/com/mockobjects/sql/MockConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockConnection.java 28 Jun 2002 17:35:39 -0000 1.1 +++ MockConnection.java 4 Dec 2002 12:39:23 -0000 1.2 @@ -2,68 +2,26 @@ import java.sql.*; +/** + * @deprecated Use temporary class MockConnection2 + * @see MockConnection2 + */ public class MockConnection extends CommonMockConnection{ - public void setHoldability(int holdability) throws SQLException { - notImplemented(); - } - - public int getHoldability() throws SQLException { - notImplemented(); - return 0; - } - - public Savepoint setSavepoint() throws SQLException { - notImplemented(); - return null; - } - - public Savepoint setSavepoint(String name) throws SQLException { - notImplemented(); - return null; - } - - public void rollback(Savepoint savepoint) throws SQLException { - notImplemented(); - } public void releaseSavepoint(Savepoint savepoint) throws SQLException { notImplemented(); } - public Statement createStatement(int resultSetType, int resultSetConcurrency, - int resultSetHoldability) throws SQLException { - notImplemented(); - return null; - } - - public PreparedStatement prepareStatement(String sql, int resultSetType, - int resultSetConcurrency, int resultSetHoldability) - throws SQLException { - notImplemented(); - return null; - } - - public CallableStatement prepareCall(String sql, int resultSetType, - int resultSetConcurrency, - int resultSetHoldability) throws SQLException { - notImplemented(); - return null; - } - - public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) - throws SQLException { + public void rollback(Savepoint savepoint) throws SQLException { notImplemented(); - return null; } - public PreparedStatement prepareStatement(String sql, int columnIndexes[]) - throws SQLException { + public Savepoint setSavepoint() throws SQLException { notImplemented(); return null; } - public PreparedStatement prepareStatement(String sql, String columnNames[]) - throws SQLException { + public Savepoint setSavepoint(String name) throws SQLException { notImplemented(); return null; } |