提交 de2dfbc4 authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

fix test case

上级 d41bc89b
...@@ -1724,7 +1724,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1724,7 +1724,7 @@ public class JdbcConnection extends TraceObject implements Connection {
try { try {
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCode("getClientInfo();"); debugCode("getClientInfo();");
} }
checkClosed(); checkClosed();
ArrayList<String> serverList = session.getClusterServers(); ArrayList<String> serverList = session.getClusterServers();
Properties p = new Properties(); Properties p = new Properties();
...@@ -1753,7 +1753,11 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1753,7 +1753,11 @@ public class JdbcConnection extends TraceObject implements Connection {
} }
checkClosed(); checkClosed();
Properties p = getClientInfo(); Properties p = getClientInfo();
return p.getProperty(name); String s = p.getProperty(name);
if (s == null) {
throw new SQLClientInfoException();
}
return s;
} catch (Exception e) { } catch (Exception e) {
throw logAndConvert(e); throw logAndConvert(e);
} }
......
...@@ -1180,7 +1180,6 @@ public class TestMetaData extends TestBase { ...@@ -1180,7 +1180,6 @@ public class TestMetaData extends TestBase {
private void testClientInfo() throws SQLException { private void testClientInfo() throws SQLException {
Connection conn = getConnection("metaData"); Connection conn = getConnection("metaData");
assertNull(conn.getClientInfo());
assertThrows(SQLClientInfoException.class, conn).getClientInfo("xxx"); assertThrows(SQLClientInfoException.class, conn).getClientInfo("xxx");
DatabaseMetaData meta = conn.getMetaData(); DatabaseMetaData meta = conn.getMetaData();
ResultSet rs = meta.getClientInfoProperties(); ResultSet rs = meta.getClientInfoProperties();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论