diff --git a/src/main/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatement.java b/src/main/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatement.java index 585238f..6ef21fd 100644 --- a/src/main/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatement.java +++ b/src/main/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatement.java @@ -7,345 +7,294 @@ import java.sql.*; import java.util.Calendar; +@SuppressWarnings("java:S1448") // Long file with many methods required for implementing PreparedStatement class DelegatingPreparedStatement extends DelegatingStatement implements PreparedStatement { - public DelegatingPreparedStatement(final Statement delegate) { + private final PreparedStatement preparedDelegate; + + public DelegatingPreparedStatement(final PreparedStatement delegate) { super(delegate); + this.preparedDelegate = delegate; } @Override public ResultSet executeQuery() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'executeQuery'"); + return preparedDelegate.executeQuery(); } @Override public int executeUpdate() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'executeUpdate'"); + return preparedDelegate.executeUpdate(); } @Override public void setNull(final int parameterIndex, final int sqlType) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNull'"); + preparedDelegate.setNull(parameterIndex, sqlType); } @Override public void setBoolean(final int parameterIndex, final boolean x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBoolean'"); + preparedDelegate.setBoolean(parameterIndex, x); } @Override public void setByte(final int parameterIndex, final byte x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setByte'"); + preparedDelegate.setByte(parameterIndex, x); } @Override public void setShort(final int parameterIndex, final short x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setShort'"); + preparedDelegate.setShort(parameterIndex, x); } @Override public void setInt(final int parameterIndex, final int x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setInt'"); + preparedDelegate.setInt(parameterIndex, x); } @Override public void setLong(final int parameterIndex, final long x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setLong'"); + preparedDelegate.setLong(parameterIndex, x); } @Override public void setFloat(final int parameterIndex, final float x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setFloat'"); + preparedDelegate.setFloat(parameterIndex, x); } @Override public void setDouble(final int parameterIndex, final double x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setDouble'"); + preparedDelegate.setDouble(parameterIndex, x); } @Override public void setBigDecimal(final int parameterIndex, final BigDecimal x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBigDecimal'"); + preparedDelegate.setBigDecimal(parameterIndex, x); } @Override public void setString(final int parameterIndex, final String x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setString'"); + preparedDelegate.setString(parameterIndex, x); } @Override public void setBytes(final int parameterIndex, final byte[] x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBytes'"); + preparedDelegate.setBytes(parameterIndex, x); } @Override public void setDate(final int parameterIndex, final Date x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setDate'"); + preparedDelegate.setDate(parameterIndex, x); } @Override public void setTime(final int parameterIndex, final Time x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setTime'"); + preparedDelegate.setTime(parameterIndex, x); } @Override public void setTimestamp(final int parameterIndex, final Timestamp x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setTimestamp'"); + preparedDelegate.setTimestamp(parameterIndex, x); } @Override public void setAsciiStream(final int parameterIndex, final InputStream x, final int length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setAsciiStream'"); + preparedDelegate.setAsciiStream(parameterIndex, x, length); } @Override @SuppressWarnings("deprecation") public void setUnicodeStream(final int parameterIndex, final InputStream x, final int length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setUnicodeStream'"); + preparedDelegate.setUnicodeStream(parameterIndex, x, length); } @Override public void setBinaryStream(final int parameterIndex, final InputStream x, final int length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBinaryStream'"); + preparedDelegate.setBinaryStream(parameterIndex, x, length); } @Override public void clearParameters() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'clearParameters'"); + preparedDelegate.clearParameters(); } @Override public void setObject(final int parameterIndex, final Object x, final int targetSqlType) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setObject'"); + preparedDelegate.setObject(parameterIndex, x, targetSqlType); } @Override public void setObject(final int parameterIndex, final Object x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setObject'"); + preparedDelegate.setObject(parameterIndex, x); } @Override public boolean execute() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'execute'"); + return preparedDelegate.execute(); } @Override public void addBatch() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'addBatch'"); + preparedDelegate.addBatch(); } @Override public void setCharacterStream(final int parameterIndex, final Reader reader, final int length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setCharacterStream'"); + preparedDelegate.setCharacterStream(parameterIndex, reader, length); } @Override public void setRef(final int parameterIndex, final Ref x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setRef'"); + preparedDelegate.setRef(parameterIndex, x); } @Override public void setBlob(final int parameterIndex, final Blob x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBlob'"); + preparedDelegate.setBlob(parameterIndex, x); } @Override public void setClob(final int parameterIndex, final Clob x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setClob'"); + preparedDelegate.setClob(parameterIndex, x); } @Override public void setArray(final int parameterIndex, final Array x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setArray'"); + preparedDelegate.setArray(parameterIndex, x); } @Override public ResultSetMetaData getMetaData() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getMetaData'"); + return preparedDelegate.getMetaData(); } @Override public void setDate(final int parameterIndex, final Date x, final Calendar cal) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setDate'"); + preparedDelegate.setDate(parameterIndex, x, cal); } @Override public void setTime(final int parameterIndex, final Time x, final Calendar cal) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setTime'"); + preparedDelegate.setTime(parameterIndex, x, cal); } @Override public void setTimestamp(final int parameterIndex, final Timestamp x, final Calendar cal) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setTimestamp'"); + preparedDelegate.setTimestamp(parameterIndex, x, cal); } @Override public void setNull(final int parameterIndex, final int sqlType, final String typeName) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNull'"); + preparedDelegate.setNull(parameterIndex, sqlType, typeName); } @Override public void setURL(final int parameterIndex, final URL x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setURL'"); + preparedDelegate.setURL(parameterIndex, x); } @Override public ParameterMetaData getParameterMetaData() throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getParameterMetaData'"); + return preparedDelegate.getParameterMetaData(); } @Override public void setRowId(final int parameterIndex, final RowId x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setRowId'"); + preparedDelegate.setRowId(parameterIndex, x); } @Override public void setNString(final int parameterIndex, final String value) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNString'"); + preparedDelegate.setNString(parameterIndex, value); } @Override public void setNCharacterStream(final int parameterIndex, final Reader value, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNCharacterStream'"); + preparedDelegate.setNCharacterStream(parameterIndex, value, length); } @Override public void setNClob(final int parameterIndex, final NClob value) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNClob'"); + preparedDelegate.setNClob(parameterIndex, value); } @Override public void setClob(final int parameterIndex, final Reader reader, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setClob'"); + preparedDelegate.setClob(parameterIndex, reader, length); } @Override public void setBlob(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBlob'"); + preparedDelegate.setBlob(parameterIndex, inputStream, length); } @Override public void setNClob(final int parameterIndex, final Reader reader, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNClob'"); + preparedDelegate.setNClob(parameterIndex, reader, length); } @Override public void setSQLXML(final int parameterIndex, final SQLXML xmlObject) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setSQLXML'"); + preparedDelegate.setSQLXML(parameterIndex, xmlObject); } @Override public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scaleOrLength) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setObject'"); + preparedDelegate.setObject(parameterIndex, x, targetSqlType, scaleOrLength); } @Override public void setAsciiStream(final int parameterIndex, final InputStream x, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setAsciiStream'"); + preparedDelegate.setAsciiStream(parameterIndex, x, length); } @Override public void setBinaryStream(final int parameterIndex, final InputStream x, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBinaryStream'"); + preparedDelegate.setBinaryStream(parameterIndex, x, length); } @Override public void setCharacterStream(final int parameterIndex, final Reader reader, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setCharacterStream'"); + preparedDelegate.setCharacterStream(parameterIndex, reader, length); } @Override public void setAsciiStream(final int parameterIndex, final InputStream x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setAsciiStream'"); + preparedDelegate.setAsciiStream(parameterIndex, x); } @Override public void setBinaryStream(final int parameterIndex, final InputStream x) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBinaryStream'"); + preparedDelegate.setBinaryStream(parameterIndex, x); } @Override public void setCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setCharacterStream'"); + preparedDelegate.setCharacterStream(parameterIndex, reader); } @Override public void setNCharacterStream(final int parameterIndex, final Reader value) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNCharacterStream'"); + preparedDelegate.setNCharacterStream(parameterIndex, value); } @Override public void setClob(final int parameterIndex, final Reader reader) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setClob'"); + preparedDelegate.setClob(parameterIndex, reader); } @Override public void setBlob(final int parameterIndex, final InputStream inputStream) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBlob'"); + preparedDelegate.setBlob(parameterIndex, inputStream); } @Override public void setNClob(final int parameterIndex, final Reader reader) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNClob'"); + preparedDelegate.setNClob(parameterIndex, reader); } } diff --git a/src/main/java/org/itsallcode/jdbc/statement/DelegatingStatement.java b/src/main/java/org/itsallcode/jdbc/statement/DelegatingStatement.java index 28cae63..8a6d4be 100644 --- a/src/main/java/org/itsallcode/jdbc/statement/DelegatingStatement.java +++ b/src/main/java/org/itsallcode/jdbc/statement/DelegatingStatement.java @@ -2,6 +2,7 @@ import java.sql.*; +@SuppressWarnings("java:S1448") // Long file with many methods required for implementing Statement class DelegatingStatement implements Statement { private final Statement delegate; diff --git a/src/test/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatementTest.java b/src/test/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatementTest.java index 35eff48..d062045 100644 --- a/src/test/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatementTest.java +++ b/src/test/java/org/itsallcode/jdbc/statement/DelegatingPreparedStatementTest.java @@ -54,305 +54,303 @@ void setByte() throws SQLException { } @Test - public void setShort() throws SQLException { + void setShort() throws SQLException { testee().setShort(1, (short) 2); verify(getStatementMock()).setShort(1, (short) 2); } @Test - public void setInt() throws SQLException { + void setInt() throws SQLException { testee().setInt(1, 2); verify(getStatementMock()).setInt(1, 2); } @Test - public void setLong() throws SQLException { + void setLong() throws SQLException { testee().setLong(1, 2); verify(getStatementMock()).setLong(1, 2); } @Test - public void setFloat() throws SQLException { + void setFloat() throws SQLException { testee().setFloat(1, (float) 2.2); verify(getStatementMock()).setFloat(1, (float) 2.2); } @Test - public void setDouble() throws SQLException { + void setDouble() throws SQLException { testee().setDouble(1, 2.2); verify(getStatementMock()).setDouble(1, 2.2); } @Test - public void setBigDecimal() throws SQLException { + void setBigDecimal() throws SQLException { testee().setBigDecimal(1, new BigDecimal(2)); verify(getStatementMock()).setBigDecimal(1, new BigDecimal(2)); } @Test - public void setString() throws SQLException { + void setString() throws SQLException { testee().setString(1, "x"); verify(getStatementMock()).setString(1, "x"); } @Test - public void setBytes() throws SQLException { + void setBytes() throws SQLException { testee().setBytes(1, new byte[] { (byte) 2 }); verify(getStatementMock()).setBytes(1, new byte[] { (byte) 2 }); } @Test - public void setDate(@Mock final Date date) throws SQLException { + void setDate(@Mock final Date date) throws SQLException { testee().setDate(1, date); verify(getStatementMock()).setDate(eq(1), same(date)); } @Test - public void setTime(@Mock final Time time) throws SQLException { + void setTime(@Mock final Time time) throws SQLException { testee().setTime(1, time); verify(getStatementMock()).setTime(eq(1), same(time)); } @Test - public void setTimestamp(@Mock final Timestamp timestamp) throws SQLException { + void setTimestamp(@Mock final Timestamp timestamp) throws SQLException { testee().setTimestamp(1, timestamp); verify(getStatementMock()).setTimestamp(eq(1), same(timestamp)); } @Test - public void setAsciiStream(@Mock final InputStream stream) throws SQLException { + void setAsciiStream(@Mock final InputStream stream) throws SQLException { testee().setAsciiStream(1, stream); verify(getStatementMock()).setAsciiStream(eq(1), same(stream)); } @Test @SuppressWarnings("deprecation") - public void setUnicodeStream(@Mock final InputStream stream) throws SQLException { + void setUnicodeStream(@Mock final InputStream stream) throws SQLException { testee().setUnicodeStream(1, stream, 2); verify(getStatementMock()).setUnicodeStream(eq(1), same(stream), eq(2)); } @Test - public void setBinaryStream(@Mock final InputStream stream) throws SQLException { - testee().setBinaryStream(1, stream, 2); - verify(getStatementMock()).setBinaryStream(eq(1), same(stream), eq(2)); + void setBinaryStream(@Mock final InputStream stream) throws SQLException { + testee().setBinaryStream(1, stream); + verify(getStatementMock()).setBinaryStream(eq(1), same(stream)); } @Test - public void clearParameters() throws SQLException { + void clearParameters() throws SQLException { testee().clearParameters(); verify(getStatementMock()).clearParameters(); } @Test - public void setObject(@Mock final Object object) throws SQLException { + void setObject(@Mock final Object object) throws SQLException { testee().setObject(1, object); verify(getStatementMock()).setObject(eq(1), same(object)); } @Test - public void setObjectWithTargetType(@Mock final Object object) throws SQLException { + void setObjectWithTargetType(@Mock final Object object) throws SQLException { testee().setObject(1, object, 2); verify(getStatementMock()).setObject(eq(1), same(object), eq(2)); } @Test - public void execute() throws SQLException { + void execute() throws SQLException { when(getStatementMock().execute()).thenReturn(true); assertTrue(testee().execute()); } @Test - public void addBatch() throws SQLException { + void addBatch() throws SQLException { testee().addBatch(); verify(getStatementMock()).addBatch(); } @Test - public void setCharacterStreamWithIntLength(@Mock final Reader x) throws SQLException { + void setCharacterStreamWithIntLength(@Mock final Reader x) throws SQLException { testee().setCharacterStream(1, x, 2); verify(getStatementMock()).setCharacterStream(eq(1), same(x), eq(2)); } @Test - public void setRef(@Mock final Ref x) throws SQLException { + void setRef(@Mock final Ref x) throws SQLException { testee().setRef(1, x); verify(getStatementMock()).setRef(eq(1), same(x)); } @Test - public void setBlob(@Mock final Blob x) throws SQLException { + void setBlob(@Mock final Blob x) throws SQLException { testee().setBlob(1, x); verify(getStatementMock()).setBlob(eq(1), same(x)); } @Test - public void setClob(@Mock final Clob x) throws SQLException { + void setClob(@Mock final Clob x) throws SQLException { testee().setClob(1, x); verify(getStatementMock()).setClob(eq(1), same(x)); } @Test - public void setArray(@Mock final Array x) throws SQLException { + void setArray(@Mock final Array x) throws SQLException { testee().setArray(1, x); verify(getStatementMock()).setArray(eq(1), same(x)); } @Test - public void getMetaData(@Mock final ResultSetMetaData metaData) throws SQLException { + void getMetaData(@Mock final ResultSetMetaData metaData) throws SQLException { when(getStatementMock().getMetaData()).thenReturn(metaData); assertSame(metaData, testee().getMetaData()); } @Test - public void setDate(final Date x, final Calendar cal) throws SQLException { + void setDate(@Mock final Date x, @Mock final Calendar cal) throws SQLException { testee().setDate(1, x, cal); verify(getStatementMock()).setDate(eq(1), same(x), same(cal)); } @Test - public void setTime(@Mock final Time x, @Mock final Calendar cal) throws SQLException { + void setTime(@Mock final Time x, @Mock final Calendar cal) throws SQLException { testee().setTime(1, x, cal); verify(getStatementMock()).setTime(eq(1), same(x), same(cal)); } @Test - public void setTimestamp(@Mock final Timestamp x, @Mock final Calendar cal) throws SQLException { + void setTimestamp(@Mock final Timestamp x, @Mock final Calendar cal) throws SQLException { testee().setTimestamp(1, x, cal); verify(getStatementMock()).setTimestamp(eq(1), same(x), same(cal)); } @Test - public void setNullWithType() throws SQLException { + void setNullWithType() throws SQLException { testee().setNull(1, 2, "type"); verify(getStatementMock()).setNull(1, 2, "type"); } @Test - public void setURL(@Mock final URL x) throws SQLException { + void setURL(@Mock final URL x) throws SQLException { testee().setURL(1, x); verify(getStatementMock()).setURL(eq(1), same(x)); } @Test - public void getParameterMetaData(final ParameterMetaData metaData) throws SQLException { + void getParameterMetaData(@Mock final ParameterMetaData metaData) throws SQLException { when(getStatementMock().getParameterMetaData()).thenReturn(metaData); assertSame(metaData, testee().getParameterMetaData()); } @Test - public void setRowId(@Mock final RowId x) throws SQLException { + void setRowId(@Mock final RowId x) throws SQLException { testee().setRowId(1, x); verify(getStatementMock()).setRowId(eq(1), same(x)); } @Test - public void setNString() throws SQLException { + void setNString() throws SQLException { testee().setNString(1, "value"); verify(getStatementMock()).setNString(1, "value"); } @Test - public void setNCharacterStreamWithLength(@Mock final Reader value, final long length) + void setNCharacterStreamWithLength(@Mock final Reader value) throws SQLException { testee().setNCharacterStream(1, value, 2L); verify(getStatementMock()).setNCharacterStream(eq(1), same(value), eq(2L)); } @Test - public void setNClob(@Mock final NClob value) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNClob'"); + void setNClob(@Mock final NClob value) throws SQLException { + testee().setNClob(1, value); + verify(getStatementMock()).setNClob(eq(1), same(value)); } @Test - public void setClobWithLength(@Mock final Reader reader, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setClob'"); + void setClobWithLength(@Mock final Reader reader) throws SQLException { + testee().setClob(1, reader, 2L); + verify(getStatementMock()).setClob(eq(1), same(reader), eq(2L)); } @Test - public void setBlobWithLength(@Mock final InputStream inputStream, final long length) - throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBlob'"); + void setBlobWithLength(@Mock final InputStream inputStream) throws SQLException { + testee().setBlob(1, inputStream, 2L); + verify(getStatementMock()).setBlob(eq(1), same(inputStream), eq(2L)); } @Test - public void setNClob(@Mock final Reader reader, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setNClob'"); + void setNClobWithLength(@Mock final Reader reader) throws SQLException { + testee().setNClob(1, reader, 2L); + verify(getStatementMock()).setNClob(eq(1), same(reader), eq(2L)); } @Test - public void setSQLXML(@Mock final SQLXML xmlObject) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setSQLXML'"); + void setSQLXML(@Mock final SQLXML xmlObject) throws SQLException { + testee().setSQLXML(1, xmlObject); + verify(getStatementMock()).setSQLXML(eq(1), same(xmlObject)); } @Test - public void setObjectWithTypeAndLength(@Mock final Object x, final int targetSqlType, final int scaleOrLength) - throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setObject'"); + void setObjectWithTypeAndLength(@Mock final Object x) throws SQLException { + testee().setObject(1, x, 2, 3); + verify(getStatementMock()).setObject(eq(1), same(x), eq(2), eq(3)); } @Test - public void setAsciiStreamWithLength(@Mock final InputStream x, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setAsciiStream'"); + void setAsciiStreamWithIntLength(@Mock final InputStream x) throws SQLException { + testee().setAsciiStream(1, x, 2); + verify(getStatementMock()).setAsciiStream(eq(1), same(x), eq(2)); } @Test - public void setBinaryStreamWithLenght(@Mock final InputStream x, final long length) throws SQLException { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'setBinaryStream'"); + void setBinaryStreamWithIntLength(@Mock final InputStream x) throws SQLException { + testee().setBinaryStream(1, x, 2); + verify(getStatementMock()).setBinaryStream(eq(1), same(x), eq(2)); } @Test - public void setCharacterStreamWithLongLength(@Mock final Reader reader) throws SQLException { + void setCharacterStreamWithLongLength(@Mock final Reader reader) throws SQLException { testee().setCharacterStream(1, reader, 2L); verify(getStatementMock()).setCharacterStream(eq(1), same(reader), eq(2L)); } @Test - public void setAsciiStream(@Mock final InputStream x) throws SQLException { - testee().set(1, x); - verify(getStatementMock()).set(eq(1), same(x)); + void setAsciiStreamWithLongLength(@Mock final InputStream x) throws SQLException { + testee().setAsciiStream(1, x, 2L); + verify(getStatementMock()).setAsciiStream(eq(1), same(x), eq(2L)); } @Test - public void setBinaryStream(@Mock final InputStream x) throws SQLException { - testee().setBinaryStream(1, x); - verify(getStatementMock()).setBinaryStream(eq(1), same(x)); + void setBinaryStreamWithLongLength(@Mock final InputStream x) throws SQLException { + testee().setBinaryStream(1, x, 2L); + verify(getStatementMock()).setBinaryStream(eq(1), same(x), eq(2L)); } @Test - public void setCharacterStream(@Mock final Reader reader) throws SQLException { + void setCharacterStream(@Mock final Reader reader) throws SQLException { testee().setCharacterStream(1, reader); verify(getStatementMock()).setCharacterStream(eq(1), same(reader)); } @Test - public void setNCharacterStream(@Mock final Reader value) throws SQLException { + void setNCharacterStream(@Mock final Reader value) throws SQLException { testee().setNCharacterStream(1, value); verify(getStatementMock()).setNCharacterStream(eq(1), same(value)); } @Test - public void setClob(@Mock final Reader reader) throws SQLException { + void setClob(@Mock final Reader reader) throws SQLException { testee().setClob(1, reader); verify(getStatementMock()).setClob(eq(1), same(reader)); } @Test - public void setBlob(@Mock final InputStream inputStream) throws SQLException { + void setBlob(@Mock final InputStream inputStream) throws SQLException { testee().setBlob(1, inputStream); verify(getStatementMock()).setBlob(eq(1), same(inputStream)); } @Test - public void setNClob(@Mock final Reader reader) throws SQLException { + void setNClob(@Mock final Reader reader) throws SQLException { testee().setNClob(1, reader); verify(getStatementMock()).setNClob(eq(1), same(reader)); }