提交 2e659700 authored 作者: Thomas Mueller's avatar Thomas Mueller

Fix test cases.

上级 b09e18fc
...@@ -112,8 +112,8 @@ public class TestResultSet extends TestBase { ...@@ -112,8 +112,8 @@ public class TestResultSet extends TestBase {
assertTrue(rs == rs.unwrap(Object.class)); assertTrue(rs == rs.unwrap(Object.class));
assertTrue(rs == rs.unwrap(ResultSet.class)); assertTrue(rs == rs.unwrap(ResultSet.class));
assertTrue(rs == rs.unwrap(rs.getClass())); assertTrue(rs == rs.unwrap(rs.getClass()));
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, rs). assertThrows(ErrorCode.INVALID_VALUE_2, rs).
unwrap(Object.class); unwrap(Integer.class);
} }
private void testReuseSimpleResult() throws SQLException { private void testReuseSimpleResult() throws SQLException {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
package org.h2.test.jdbc; package org.h2.test.jdbc;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLClientInfoException; import java.sql.SQLClientInfoException;
import java.sql.SQLException; import java.sql.SQLException;
...@@ -57,15 +56,14 @@ public class TestStatement extends TestBase { ...@@ -57,15 +56,14 @@ public class TestStatement extends TestBase {
private void testUnwrap() throws SQLException { private void testUnwrap() throws SQLException {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
assertTrue(stat.isWrapperFor(Object.class)); assertTrue(stat.isWrapperFor(Object.class));
assertTrue(stat.isWrapperFor(DatabaseMetaData.class)); assertTrue(stat.isWrapperFor(Statement.class));
assertTrue(stat.isWrapperFor(stat.getClass())); assertTrue(stat.isWrapperFor(stat.getClass()));
assertFalse(stat.isWrapperFor(Integer.class));
assertTrue(stat == stat.unwrap(Object.class)); assertTrue(stat == stat.unwrap(Object.class));
assertTrue(stat == stat.unwrap(DatabaseMetaData.class)); assertTrue(stat == stat.unwrap(Statement.class));
assertTrue(stat == stat.unwrap(stat.getClass())); assertTrue(stat == stat.unwrap(stat.getClass()));
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat). assertThrows(ErrorCode.INVALID_VALUE_2, stat).
isWrapperFor(Object.class); unwrap(Integer.class);
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).
unwrap(Object.class);
} }
private void testUnsupportedOperations() throws Exception { private void testUnsupportedOperations() throws Exception {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论