Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f9f6a372
提交
f9f6a372
authored
4月 10, 2016
作者:
Niklas Mehner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Checkstyle / add copyright header / add missing test
上级
5bdfd153
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
89 行增加
和
5 行删除
+89
-5
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+2
-2
TestConnection.java
h2/src/test/org/h2/test/jdbc/TestConnection.java
+5
-0
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+0
-1
TestStatement.java
h2/src/test/org/h2/test/jdbc/TestStatement.java
+0
-2
TestMode.java
h2/src/test/org/h2/test/unit/TestMode.java
+82
-0
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
f9f6a372
...
...
@@ -128,7 +128,7 @@ public class JdbcConnection extends TraceObject implements Connection {
this
.
url
=
ci
.
getURL
();
closeOld
();
watcher
=
CloseWatcher
.
register
(
this
,
session
,
keepOpenStackTrace
);
this
.
clientInfo
=
new
HashMap
<
String
,
String
>
();
this
.
clientInfo
=
new
HashMap
<
String
,
String
>();
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
...
...
@@ -152,7 +152,7 @@ public class JdbcConnection extends TraceObject implements Connection {
this
.
getReadOnly
=
clone
.
getReadOnly
;
this
.
rollback
=
clone
.
rollback
;
this
.
watcher
=
null
;
this
.
clientInfo
=
new
HashMap
<
String
,
String
>
(
clone
.
clientInfo
);
this
.
clientInfo
=
new
HashMap
<
String
,
String
>(
clone
.
clientInfo
);
}
/**
...
...
h2/src/test/org/h2/test/jdbc/TestConnection.java
浏览文件 @
f9f6a372
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
jdbc
;
import
org.h2.test.TestBase
;
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
f9f6a372
...
...
@@ -10,7 +10,6 @@ import java.sql.DatabaseMetaData;
import
java.sql.Driver
;
import
java.sql.ResultSet
;
import
java.sql.ResultSetMetaData
;
import
java.sql.SQLClientInfoException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Types
;
...
...
h2/src/test/org/h2/test/jdbc/TestStatement.java
浏览文件 @
f9f6a372
...
...
@@ -7,12 +7,10 @@ package org.h2.test.jdbc;
import
java.sql.Connection
;
import
java.sql.ResultSet
;
import
java.sql.SQLClientInfoException
;
import
java.sql.SQLException
;
import
java.sql.Savepoint
;
import
java.sql.Statement
;
import
java.util.HashMap
;
import
java.util.Properties
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.SysProperties
;
...
...
h2/src/test/org/h2/test/unit/TestMode.java
0 → 100644
浏览文件 @
f9f6a372
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
unit
;
import
org.h2.engine.Mode
;
import
org.h2.test.TestBase
;
/**
* Unit test for the Mode class.
*/
public
class
TestMode
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
@Override
public
void
test
()
throws
Exception
{
testDb2ClientInfo
();
testDerbyClientInfo
();
testHsqlDbClientInfo
();
testMsSqlServerClientInfo
();
testMySqlClientInfo
();
testOracleClientInfo
();
testPostgresqlClientInfo
();
}
private
void
testDb2ClientInfo
()
{
Mode
db2Mode
=
Mode
.
getInstance
(
"DB2"
);
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientAccountingInformation"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientUser"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientCorrelationToken"
).
matches
());
assertFalse
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
}
private
void
testDerbyClientInfo
()
{
Mode
derbyMode
=
Mode
.
getInstance
(
"Derby"
);
assertNull
(
derbyMode
.
supportedClientInfoPropertiesRegEx
);
}
private
void
testHsqlDbClientInfo
()
{
Mode
hsqlMode
=
Mode
.
getInstance
(
"HSQLDB"
);
assertNull
(
hsqlMode
.
supportedClientInfoPropertiesRegEx
);
}
private
void
testMsSqlServerClientInfo
()
{
Mode
msSqlMode
=
Mode
.
getInstance
(
"MSSQLServer"
);
assertNull
(
msSqlMode
.
supportedClientInfoPropertiesRegEx
);
}
private
void
testMySqlClientInfo
()
{
Mode
mySqlMode
=
Mode
.
getInstance
(
"MySQL"
);
assertTrue
(
mySqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyString"
).
matches
());
}
private
void
testOracleClientInfo
()
{
Mode
oracleMode
=
Mode
.
getInstance
(
"Oracle"
);
assertTrue
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContaining.aDot"
).
matches
());
assertFalse
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContainingNoDot"
).
matches
());
}
private
void
testPostgresqlClientInfo
()
{
Mode
postgresqlMode
=
Mode
.
getInstance
(
"PostgreSQL"
);
assertTrue
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertFalse
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论