From: Jeff M. <cus...@us...> - 2002-06-19 15:26:30
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/com/mockobjects/sql Modified Files: MockConnection.java MockPreparedStatement.java MockResultSet.java MockSingleRowResultSet.java Log Message: Lots of small changes to mocks Index: MockConnection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockConnection.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockConnection.java 19 Jun 2002 15:26:25 -0000 1.2 @@ -1,16 +1,17 @@ package com.mockobjects.sql; -import java.sql.*; -import java.util.*; import com.mockobjects.*; +import java.sql.*; +import java.util.Map; + public class MockConnection extends MockObject implements Connection { private ExpectationCounter myCommitCalls = new ExpectationCounter("MockConnection.commit"); private ExpectationCounter myRollbackCalls = new ExpectationCounter("MockConnection.rollback"); private ExpectationCounter myCloseCalls = new ExpectationCounter("MockConnection.close"); private ExpectationCollection myPreparedStatementStrings = new ExpectationList("MockConnection.preparedStatementString"); - private ArrayList myPreparedStatements = new ArrayList(); + private ReturnObjectList myPreparedStatements = new ReturnObjectList("statements"); private SQLException myStatementException = null; private ExpectationCounter myCreateStatementCalls = new ExpectationCounter("MockConnection.createStatement"); @@ -21,10 +22,6 @@ private SQLException myIsClosedException; private SQLException myCloseException; - public MockConnection() { - super(); - } - public void setExpectedCloseCalls(int callCount) { myCloseCalls.setExpected(callCount); } @@ -46,7 +43,7 @@ } public void setupAddPreparedStatement(PreparedStatement prepared) { - myPreparedStatements.add(prepared); + myPreparedStatements.addObjectToReturn(prepared); } public void setupStatement(Statement statement) { @@ -60,12 +57,12 @@ public void clearWarnings() throws SQLException { } - public void setupCloseException(SQLException aCloseException){ + public void setupCloseException(SQLException aCloseException) { myCloseException = aCloseException; } public void close() throws SQLException { - if(myCloseException!=null){ + if(myCloseException != null) { throw myCloseException; } myCloseCalls.inc(); @@ -82,9 +79,9 @@ } public Statement createStatement( - int resultSetType, - int resultSetConcurrency) - throws SQLException { + int resultSetType, + int resultSetConcurrency) + throws SQLException { throw new UnsupportedOperationException(); } @@ -97,7 +94,7 @@ } public DatabaseMetaData getMetaData() - throws SQLException { + throws SQLException { throw new UnsupportedOperationException(); } @@ -113,16 +110,16 @@ throw new UnsupportedOperationException(); } - public void setupIsClosedException(SQLException aIsClosedException){ + public void setupIsClosedException(SQLException aIsClosedException) { myIsClosedException = aIsClosedException; } - public void setupIsClose(boolean aIsClosed){ + public void setupIsClose(boolean aIsClosed) { myIsClosed = aIsClosed; } public boolean isClosed() throws SQLException { - if(myIsClosedException!=null){ + if(myIsClosedException != null) { throw myIsClosedException; } return myIsClosed; @@ -137,29 +134,29 @@ } public CallableStatement prepareCall(String sql) - throws SQLException { + throws SQLException { throw new UnsupportedOperationException(); } public CallableStatement prepareCall( - String sql, - int resultSetType, - int resultSetConcurrency) - throws SQLException { + String sql, + int resultSetType, + int resultSetConcurrency) + throws SQLException { throw new UnsupportedOperationException(); } public PreparedStatement prepareStatement(String sql) throws SQLException { myPreparedStatementStrings.addActual(sql); throwStatementExceptionIfAny(); - return (PreparedStatement) myPreparedStatements.remove(0); + return (PreparedStatement) myPreparedStatements.nextReturnObject(); } public PreparedStatement prepareStatement( - String sql, - int resultSetType, - int resultSetConcurrency) - throws SQLException { + String sql, + int resultSetType, + int resultSetConcurrency) + throws SQLException { throw new UnsupportedOperationException(); } @@ -184,7 +181,7 @@ } public void setTransactionIsolation(int level) - throws SQLException { + throws SQLException { throw new UnsupportedOperationException(); } @@ -193,9 +190,8 @@ } private void throwStatementExceptionIfAny() throws SQLException { - if (null != myStatementException) { + if(null != myStatementException) { throw myStatementException; } } - -} +} \ No newline at end of file Index: MockPreparedStatement.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockPreparedStatement.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockPreparedStatement.java 19 Jun 2002 15:26:25 -0000 1.2 @@ -6,18 +6,24 @@ import java.math.BigDecimal; import com.mockobjects.*; -public class MockPreparedStatement extends MockStatement implements PreparedStatement { - private ExpectationSet mySetParameters = new ExpectationSet("MockPreparedStatement.setParameters"); - private ExpectationCounter myClearParametersCalls = new ExpectationCounter("MockPreparedStatement.clearParameters() calls"); +public class MockPreparedStatement extends MockStatement implements +PreparedStatement { + private ExpectationSet mySetParameters = + new ExpectationSet("MockPreparedStatement.setParameters"); + private ExpectationCounter myClearParametersCalls = + new ExpectationCounter("MockPreparedStatement.clearParameters() calls"); + private ExpectationSet myTargetSQLTypes = + new ExpectationSet("target sql types"); - public MockPreparedStatement() { - super(); - } public void addExpectedSetParameter(int parameterIndex, int intValue) { addExpectedSetParameter(parameterIndex, new Integer(intValue)); } + public void addExpectedTargetSQLType(int aTargetSQLType){ + myTargetSQLTypes.addExpected(new Integer(aTargetSQLType)); + } + public void addExpectedSetParameter(int parameterIndex, Object parameterValue) { mySetParameters.addExpected(new MapEntry(new Integer(parameterIndex), parameterValue)); } @@ -74,7 +80,7 @@ } public void addBatch() throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setNull(int param, int param1) throws SQLException { @@ -93,12 +99,14 @@ setObject(param, time); } - public void setObject(int param, Object obj, int targetSqlType, int scale) throws SQLException { - throw new UnsupportedOperationException(); + public void setObject(int param, Object anObject, int targetSqlType, int scale) throws SQLException { + notImplemented(); } - public void setObject(int param, Object obj, int targetSqlType) throws SQLException { - throw new UnsupportedOperationException(); + public void setObject(int param, Object anObject, int aTargetSQLType) + throws SQLException { + setObject(param, anObject); + myTargetSQLTypes.addActual(new Integer(aTargetSQLType)); } public void setRef(int param, Ref ref) throws SQLException { @@ -118,11 +126,11 @@ } public void setCharacterStream(int param, Reader reader, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setAsciiStream(int param, java.io.InputStream inputStream, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setDate(int param, Date date, Calendar calendar) throws SQLException { @@ -130,19 +138,19 @@ } public void setBinaryStream(int param, java.io.InputStream inputStream, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setUnicodeStream(int param, java.io.InputStream inputStream, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setBytes(int param, byte[] values) throws SQLException { setObject(param, values); } - public void setObject(int param, Object obj) throws SQLException { - mySetParameters.addActual(new MapEntry(new Integer(param), obj)); + public void setObject(int param, Object anObject) throws SQLException { + mySetParameters.addActual(new MapEntry(new Integer(param), anObject)); } public void setByte(int param, byte aByte) throws SQLException { @@ -154,11 +162,12 @@ } public ResultSetMetaData getMetaData() throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); + return null; } public void setTimestamp(int param, Timestamp timestamp, Calendar calendar) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setTime(int param, Time time) throws SQLException { @@ -170,7 +179,7 @@ } public void setNull(int param, int param1, String typeName) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setBigDecimal(int param, BigDecimal bigDecimal) throws SQLException { Index: MockResultSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockResultSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockResultSet.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockResultSet.java 19 Jun 2002 15:26:26 -0000 1.2 @@ -1,15 +1,15 @@ package com.mockobjects.sql; -import java.sql.*; -import java.sql.Date; -import java.util.*; -import java.math.BigDecimal; +import com.mockobjects.ExpectationCounter; +import com.mockobjects.MockObject; +import junit.framework.AssertionFailedError; + import java.io.InputStream; import java.io.Reader; - -import junit.framework.Assert; -import junit.framework.AssertionFailedError; -import com.mockobjects.*; +import java.math.BigDecimal; +import java.sql.*; +import java.util.Calendar; +import java.util.Map; /** * This is the base implementation of a mock result set. @@ -27,10 +27,6 @@ private ResultSetMetaData myMetaData; private Statement myStatement; - public MockResultSet() { - super(); - } - /** * Used as the base implementation for getting all types of object, * based on 1-based column index @@ -70,19 +66,19 @@ } public Array getArray(int i) throws SQLException { - return (Array)getObject(i); + return (Array) getObject(i); } public Array getArray(String colName) throws SQLException { - return (Array)getObject(colName); + return (Array) getObject(colName); } public InputStream getAsciiStream(int columnIndex) throws SQLException { - return (InputStream)getObject(columnIndex); + return (InputStream) getObject(columnIndex); } public InputStream getAsciiStream(String columnName) throws SQLException { - return (InputStream)getObject(columnName); + return (InputStream) getObject(columnName); } public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { @@ -90,87 +86,89 @@ } public BigDecimal getBigDecimal(int columnIndex) throws SQLException { - return (BigDecimal)getObject(columnIndex); + return (BigDecimal) getObject(columnIndex); } public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { - return (BigDecimal)getObject(columnIndex); + return (BigDecimal) getObject(columnIndex); } public BigDecimal getBigDecimal(String columnName) throws SQLException { - return (BigDecimal)getObject(columnName); + return (BigDecimal) getObject(columnName); } public InputStream getBinaryStream(int columnIndex) throws SQLException { - return (InputStream)getObject(columnIndex); + return (InputStream) getObject(columnIndex); } public InputStream getBinaryStream(String columnName) throws SQLException { - return (InputStream)getObject(columnName); + return (InputStream) getObject(columnName); } public Blob getBlob(int i) throws SQLException { - return (Blob)getObject(i); + return (Blob) getObject(i); } public Blob getBlob(String colName) throws SQLException { - return (Blob)getObject(colName); + return (Blob) getObject(colName); } public boolean getBoolean(int columnIndex) throws SQLException { - return ((Boolean)getObject(columnIndex)).booleanValue(); + return ((Boolean) getObject(columnIndex)).booleanValue(); } public boolean getBoolean(String columnName) throws SQLException { - return ((Boolean)getObject(columnName)).booleanValue(); + return ((Boolean) getObject(columnName)).booleanValue(); } public byte getByte(int columnIndex) throws SQLException { - return ((Byte)getObject(columnIndex)).byteValue(); + return ((Byte) getObject(columnIndex)).byteValue(); } public byte getByte(String columnName) throws SQLException { - return ((Byte)getObject(columnName)).byteValue(); + return ((Byte) getObject(columnName)).byteValue(); } public byte[] getBytes(int columnIndex) throws SQLException { - return (byte[])getObject(columnIndex); + return (byte[]) getObject(columnIndex); } public byte[] getBytes(String columnName) throws SQLException { - return (byte[])getObject(columnName); + return (byte[]) getObject(columnName); } public Reader getCharacterStream(int columnIndex) throws SQLException { - return (Reader)getObject(columnIndex); + return (Reader) getObject(columnIndex); } public Reader getCharacterStream(String columnName) throws SQLException { - return (Reader)getObject(columnName); + return (Reader) getObject(columnName); } public Clob getClob(int i) throws SQLException { - return (Clob)getObject(i); + return (Clob) getObject(i); } public Clob getClob(String colName) throws SQLException { - return (Clob)getObject(colName); + return (Clob) getObject(colName); } public String getCursorName() throws SQLException { - throw new AssertionFailedError("MockResultSet getCursorName not implemented"); + notImplemented(); + return null; } public int getConcurrency() throws SQLException { - throw new AssertionFailedError("MockResultSet getConcurrency not implemented"); + notImplemented(); + return 0; } public Date getDate(int columnIndex) throws SQLException { - return (Date)getObject(columnIndex); + return (Date) getObject(columnIndex); } public Date getDate(String columnName) throws SQLException { - return (Date)getObject(columnName); + return (Date) getObject(columnName); } public Date getDate(int columnIndex, Calendar cal) throws SQLException { @@ -182,27 +180,29 @@ } public double getDouble(int columnIndex) throws SQLException { - return ((Double)getObject(columnIndex)).doubleValue(); + return ((Double) getObject(columnIndex)).doubleValue(); } public double getDouble(String columnName) throws SQLException { - return ((Double)getObject(columnName)).doubleValue(); + return ((Double) getObject(columnName)).doubleValue(); } public int getFetchDirection() throws SQLException { - throw new AssertionFailedError("MockResultSet getFetchDirection not implemented"); + notImplemented(); + return 0; } public int getFetchSize() throws SQLException { - throw new AssertionFailedError("MockResultSet getFetchSize not implemented"); + notImplemented(); + return 0; } public float getFloat(int columnIndex) throws SQLException { - return ((Float)getObject(columnIndex)).floatValue(); + return ((Float) getObject(columnIndex)).floatValue(); } public float getFloat(String columnName) throws SQLException { - return ((Float)getObject(columnName)).floatValue(); + return ((Float) getObject(columnName)).floatValue(); } public int getInt(int columnIndex) throws SQLException { @@ -226,27 +226,29 @@ } public Object getObject(int i, Map map) throws SQLException { - throw new AssertionFailedError("MockResultSet getObject not implemented"); + notImplemented(); + return null; } public Object getObject(String colName, Map map) throws SQLException { - throw new AssertionFailedError("MockResultSet getObject not implemented"); + notImplemented(); + return null; } public Ref getRef(int i) throws SQLException { - return (Ref)getObject(i); + return (Ref) getObject(i); } public Ref getRef(String colName) throws SQLException { - return (Ref)getObject(colName); + return (Ref) getObject(colName); } public short getShort(String columnName) throws SQLException { - return ((Short)getObject(columnName)).shortValue(); + return ((Short) getObject(columnName)).shortValue(); } public short getShort(int columnIndex) throws SQLException { - return ((Short)getObject(columnIndex)).shortValue(); + return ((Short) getObject(columnIndex)).shortValue(); } public Statement getStatement() throws SQLException { @@ -254,19 +256,19 @@ } public String getString(int columnIndex) throws SQLException { - return (String)getObject(columnIndex); + return (String) getObject(columnIndex); } public String getString(String columnName) throws SQLException { - return (String)getObject(columnName); + return (String) getObject(columnName); } public Time getTime(int columnIndex) throws SQLException { - return (Time)getObject(columnIndex); + return (Time) getObject(columnIndex); } public Time getTime(String columnName) throws SQLException { - return (Time)getObject(columnName); + return (Time) getObject(columnName); } public Time getTime(int columnIndex, Calendar cal) throws SQLException { @@ -278,11 +280,11 @@ } public Timestamp getTimestamp(int columnIndex) throws SQLException { - return (Timestamp)getObject(columnIndex); + return (Timestamp) getObject(columnIndex); } public Timestamp getTimestamp(String columnName) throws SQLException { - return (Timestamp)getObject(columnName); + return (Timestamp) getObject(columnName); } public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { @@ -294,291 +296,307 @@ } public int getType() throws SQLException { - throw new AssertionFailedError("MockResultSet getType not implemented"); + notImplemented(); + return 0; } public InputStream getUnicodeStream(int columnIndex) throws SQLException { - return (InputStream)getObject(columnIndex); + return (InputStream) getObject(columnIndex); } public InputStream getUnicodeStream(String columnName) throws SQLException { - return (InputStream)getObject(columnName); + return (InputStream) getObject(columnName); } public SQLWarning getWarnings() throws SQLException { - throw new AssertionFailedError("MockResultSet getWarnings not implemented"); + notImplemented(); + return null; } public void clearWarnings() throws SQLException { - throw new AssertionFailedError("MockResultSet clearWarnings not implemented"); + notImplemented(); } public int findColumn(String columnName) throws SQLException { - throw new AssertionFailedError("MockResultSet findColumn not implemented"); + notImplemented(); + return 0; } public boolean isBeforeFirst() throws SQLException { - throw new AssertionFailedError("MockResultSet isBeforeFirst not implemented"); + notImplemented(); + return false; } public boolean isAfterLast() throws SQLException { - throw new AssertionFailedError("MockResultSet getFetchSize not implemented"); + notImplemented(); + return false; } public boolean isFirst() throws SQLException { - throw new AssertionFailedError("MockResultSet isFirst not implemented"); + notImplemented(); + return false; } public boolean isLast() throws SQLException { - throw new AssertionFailedError("MockResultSet isLast not implemented"); + notImplemented(); + return false; } public void beforeFirst() throws SQLException { - throw new AssertionFailedError("MockResultSet beforeFirst not implemented"); + notImplemented(); } public void afterLast() throws SQLException { - throw new AssertionFailedError("MockResultSet afterLast not implemented"); + notImplemented(); } public boolean first() throws SQLException { - throw new AssertionFailedError("MockResultSet first not implemented"); + notImplemented(); + return false; } public boolean last() throws SQLException { - throw new AssertionFailedError("MockResultSet last not implemented"); + notImplemented(); + return false; } public boolean absolute(int row) throws SQLException { - throw new AssertionFailedError("MockResultSet absolute not implemented"); + notImplemented(); + return false; } public boolean relative(int rows) throws SQLException { - throw new AssertionFailedError("MockResultSet relative not implemented"); + notImplemented(); + return false; } public boolean previous() throws SQLException { - throw new AssertionFailedError("MockResultSet previous not implemented"); + notImplemented(); + return false; } public void setFetchDirection(int direction) throws SQLException { - throw new AssertionFailedError("MockResultSet setFetchDirection not implemented"); + notImplemented(); } public void setFetchSize(int rows) throws SQLException { - throw new AssertionFailedError("MockResultSet setFetchSize not implemented"); + notImplemented(); } public boolean rowUpdated() throws SQLException { - throw new AssertionFailedError("MockResultSet rowUpdated not implemented"); + notImplemented(); + return false; } public boolean rowInserted() throws SQLException { - throw new AssertionFailedError("MockResultSet rowInserted not implemented"); + notImplemented(); + return false; } public boolean rowDeleted() throws SQLException { - throw new AssertionFailedError("MockResultSet rowDeleted not implemented"); + notImplemented(); + return false; } public void updateNull(int columnIndex) throws SQLException { - throw new AssertionFailedError("MockResultSet updateNull not implemented"); + notImplemented(); } public void updateBoolean(int columnIndex, boolean x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBoolean not implemented"); + notImplemented(); } public void updateByte(int columnIndex, byte x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateByte not implemented"); + notImplemented(); } public void updateShort(int columnIndex, short x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateShort not implemented"); + notImplemented(); } public void updateInt(int columnIndex, int x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateInt not implemented"); + notImplemented(); } public void updateLong(int columnIndex, long x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateLong not implemented"); + notImplemented(); } public void updateFloat(int columnIndex, float x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateFloat not implemented"); + notImplemented(); } public void updateDouble(int columnIndex, double x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDouble not implemented"); + notImplemented(); } public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBigDecimal not implemented"); + notImplemented(); } public void updateString(int columnIndex, String x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateString not implemented"); + notImplemented(); } public void updateBytes(int columnIndex, byte x[]) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBytes not implemented"); + notImplemented(); } public void updateDate(int columnIndex, Date x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDate not implemented"); + notImplemented(); } public void updateTime(int columnIndex, Time x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateTime not implemented"); + notImplemented(); } public void updateTimestamp(int columnIndex, Timestamp x) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateTimestamp not implemented"); + throws SQLException { + notImplemented(); } public void updateAsciiStream(int columnIndex, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateAsciiStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateBinaryStream(int columnIndex, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBinaryStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateCharacterStream(int columnIndex, - Reader x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateCharacterStream not implemented"); + Reader x, + int length) throws SQLException { + notImplemented(); } public void updateObject(int columnIndex, Object x, int scale) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + throws SQLException { + notImplemented(); } public void updateObject(int columnIndex, Object x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + notImplemented(); } public void updateNull(String columnName) throws SQLException { - throw new AssertionFailedError("MockResultSet updateNull not implemented"); + notImplemented(); } public void updateBoolean(String columnName, boolean x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBoolean not implemented"); + notImplemented(); } public void updateByte(String columnName, byte x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateByte not implemented"); + notImplemented(); } public void updateShort(String columnName, short x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateShort not implemented"); + notImplemented(); } public void updateInt(String columnName, int x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateInt not implemented"); + notImplemented(); } public void updateLong(String columnName, long x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateLong not implemented"); + notImplemented(); } public void updateFloat(String columnName, float x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateFloat not implemented"); + notImplemented(); } public void updateDouble(String columnName, double x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDouble not implemented"); + notImplemented(); } public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBigDecimal not implemented"); + notImplemented(); } public void updateString(String columnName, String x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateString not implemented"); + notImplemented(); } public void updateBytes(String columnName, byte x[]) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBytes not implemented"); + notImplemented(); } public void updateDate(String columnName, Date x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDate not implemented"); + notImplemented(); } public void updateTime(String columnName, Time x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateTime not implemented"); + notImplemented(); } public void updateTimestamp(String columnName, Timestamp x) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateTimestamp not implemented"); + throws SQLException { + notImplemented(); } public void updateAsciiStream(String columnName, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateAsciiStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateBinaryStream(String columnName, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBinaryStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateCharacterStream(String columnName, - Reader reader, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateCharacterStream not implemented"); + Reader reader, + int length) throws SQLException { + notImplemented(); } public void updateObject(String columnName, Object x, int scale) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + throws SQLException { + notImplemented(); } public void updateObject(String columnName, Object x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + notImplemented(); } public void insertRow() throws SQLException { - throw new AssertionFailedError("MockResultSet insertRow not implemented"); + notImplemented(); } public void updateRow() throws SQLException { - throw new AssertionFailedError("MockResultSet updateRow not implemented"); + notImplemented(); } public void deleteRow() throws SQLException { - throw new AssertionFailedError("MockResultSet deleteRow not implemented"); + notImplemented(); } public void refreshRow() throws SQLException { - throw new AssertionFailedError("MockResultSet refreshRow not implemented"); + notImplemented(); } public void cancelRowUpdates() throws SQLException { - throw new AssertionFailedError("MockResultSet cancelRowUpdates not implemented"); + notImplemented(); } public void moveToInsertRow() throws SQLException { - throw new AssertionFailedError("MockResultSet moveToInsertRow not implemented"); + notImplemented(); } public void moveToCurrentRow() throws SQLException { - throw new AssertionFailedError("MockResultSet moveToCurrentRow not implemented"); + notImplemented(); } public boolean wasNull() throws SQLException { - throw new AssertionFailedError("MockResultSet wasNull not implemented"); + notImplemented(); + return false; } } Index: MockSingleRowResultSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockSingleRowResultSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockSingleRowResultSet.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockSingleRowResultSet.java 19 Jun 2002 15:26:26 -0000 1.2 @@ -16,22 +16,19 @@ private ExpectationSqlRow myRow = new ExpectationSqlRow("single row"); private int myNextCallCount = 0; - public MockSingleRowResultSet() { - super(); - } - public MockSingleRowResultSet(Object[] values) { - this(); addExpectedIndexedValues(values); } + public MockSingleRowResultSet(){ + super(); + } + public MockSingleRowResultSet(String[] names, Object[] values) { - this(); addExpectedNamedValues(names, values); } public MockSingleRowResultSet(Map map) { - this(); addExpectedNamedValues(map); } |