diff --git a/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java b/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java index cc1a97d0a8..749823bb9e 100644 --- a/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java +++ b/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java @@ -1,5 +1,6 @@ package com.alibaba.druid.bvt.pool.basic; +import java.io.InputStream; import java.io.Reader; import java.sql.SQLException; import java.sql.Types; @@ -546,4 +547,213 @@ public class PoolableCallableStatementTest extends TestCase { Assert.assertNotNull(error); } } + + public void test_setNClob() throws Exception { + + stmt.setNClob(1, (Reader) null); + stmt.setNClob("1", (Reader) null); + + { + SQLException error = null; + try { + stmt.setNClob("0", (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setNClob(0, (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + public void test_setClob() throws Exception { + + stmt.setClob(1, (Reader) null); + stmt.setClob("1", (Reader) null); + + { + SQLException error = null; + try { + stmt.setClob("0", (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setClob(0, (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + public void test_setNCharacterStream() throws Exception { + + stmt.setNCharacterStream(1, (Reader) null); + stmt.setNCharacterStream("1", (Reader) null); + + { + SQLException error = null; + try { + stmt.setNCharacterStream("0", (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setNCharacterStream(0, (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + public void test_setCharacterStream() throws Exception { + + stmt.setCharacterStream(1, (Reader) null); + stmt.setCharacterStream("1", (Reader) null); + + { + SQLException error = null; + try { + stmt.setCharacterStream("0", (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setCharacterStream(0, (Reader) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + public void test_setBinaryStream() throws Exception { + + stmt.setBinaryStream(1, (InputStream) null); + stmt.setBinaryStream("1", (InputStream) null); + + { + SQLException error = null; + try { + stmt.setBinaryStream("0", (InputStream) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setBinaryStream(0, (InputStream) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + public void test_setBinaryStream_1() throws Exception { + + stmt.setBinaryStream(1, (InputStream) null, 1); + stmt.setBinaryStream("1", (InputStream) null, 1); + + { + SQLException error = null; + try { + stmt.setBinaryStream("0", (InputStream) null, 1); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setBinaryStream(0, (InputStream) null, 1); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + + public void test_setBinaryStream_2() throws Exception { + + stmt.setBinaryStream(1, (InputStream) null, 1L); + stmt.setBinaryStream("1", (InputStream) null, 1L); + + { + SQLException error = null; + try { + stmt.setBinaryStream("0", (InputStream) null, 1L); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setBinaryStream(0, (InputStream) null, 1L); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } + + public void test_setAsciiStream() throws Exception { + + stmt.setAsciiStream(1, (InputStream) null); + stmt.setAsciiStream("1", (InputStream) null); + + { + SQLException error = null; + try { + stmt.setAsciiStream("0", (InputStream) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + + { + SQLException error = null; + try { + stmt.setAsciiStream(0, (InputStream) null); + } catch (SQLException ex) { + error = ex; + } + Assert.assertNotNull(error); + } + } }