完善mock和测试

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@773 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-15 22:18:31 +00:00
parent 2c8592a70b
commit 6477f4a65e
3 changed files with 144 additions and 13 deletions
@@ -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);
}
}
}