mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
完善mock和测试
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@773 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -36,7 +36,7 @@ public class PoolableCallableStatementTest extends TestCase {
|
||||
}
|
||||
|
||||
public void test_basic() throws Exception {
|
||||
Assert.assertEquals(raw, stmt.getRawPreparedStatement());
|
||||
Assert.assertEquals(raw, stmt.getCallableStatementRaw());
|
||||
}
|
||||
|
||||
public void test_callableStmt() throws Exception {
|
||||
|
||||
@@ -1194,4 +1194,139 @@ public class ResultSetTest extends TestCase {
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void test_getSQLXML() throws Exception {
|
||||
resultSet.next();
|
||||
|
||||
resultSet.getSQLXML(1);
|
||||
resultSet.getSQLXML("1");
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getSQLXML("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getSQLXML("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void test_getNClob() throws Exception {
|
||||
resultSet.next();
|
||||
|
||||
resultSet.getNClob(1);
|
||||
resultSet.getNClob("1");
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getNClob("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getNClob("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void test_getNString() throws Exception {
|
||||
resultSet.next();
|
||||
|
||||
resultSet.getNString(1);
|
||||
resultSet.getNString("1");
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getNString("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getNString("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void test_getNCharacterStream() throws Exception {
|
||||
resultSet.next();
|
||||
|
||||
resultSet.getNCharacterStream(1);
|
||||
resultSet.getNCharacterStream("1");
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getNCharacterStream("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getNCharacterStream("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void test_getCharacterStream() throws Exception {
|
||||
resultSet.next();
|
||||
|
||||
resultSet.getCharacterStream(1);
|
||||
resultSet.getCharacterStream("1");
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getCharacterStream("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
{
|
||||
SQLException error = null;
|
||||
try {
|
||||
resultSet.getCharacterStream("0");
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user