完善mock和测试

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@785 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-16 00:29:39 +00:00
parent 09c328aa9c
commit 4b7798248d
@@ -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);
}
}
}