提交 205b27ca authored 作者: Thomas Mueller's avatar Thomas Mueller

More tests

上级 d48aa1ba
......@@ -129,6 +129,17 @@ public class TestPreparedStatement extends TestBase {
setUnicodeStream(1, (InputStream) null, 0);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, prep).
setArray(1, (Array) null);
ParameterMetaData meta = prep.getParameterMetaData();
assertTrue(meta.toString(), meta.toString().endsWith("parameterCount=1"));
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, meta).isWrapperFor(Object.class);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, meta).unwrap(Object.class);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, conn).isWrapperFor(Object.class);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, conn).unwrap(Object.class);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, conn).createSQLXML();
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, conn).createArrayOf("Integer", new Object[0]);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, conn).createStruct("Integer", new Object[0]);
}
private static void testChangeType(Connection conn) throws SQLException {
......
......@@ -37,6 +37,7 @@ public class TestStatement extends TestBase {
public void test() throws Exception {
deleteDb("statement");
conn = getConnection("statement");
testUnsupportedOperations();
testTraceError();
testSavepoint();
testConnectionRollback();
......@@ -46,6 +47,12 @@ public class TestStatement extends TestBase {
conn.close();
deleteDb("statement");
}
private void testUnsupportedOperations() throws Exception {
Statement stat = conn.createStatement();
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).isWrapperFor(Object.class);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).unwrap(Object.class);
}
private void testTraceError() throws Exception {
if (config.memory || config.networked || config.traceLevelFile != 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论