Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
8a6c13bf
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8a6c13bf
编写于
9月 05, 2020
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor HikariJDBCParameterDecoratorTest
上级
ecbb9f29
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
24 deletion
+17
-24
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/decorator/HikariJDBCParameterDecoratorTest.java
...atasource/decorator/HikariJDBCParameterDecoratorTest.java
+17
-24
未找到文件。
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/decorator/HikariJDBCParameterDecoratorTest.java
浏览文件 @
8a6c13bf
...
...
@@ -18,44 +18,37 @@
package
org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.decorator
;
import
com.zaxxer.hikari.HikariDataSource
;
import
org.junit.Before
;
import
org.junit.Test
;
import
java.util.Properties
;
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assert
Equals
;
import
static
org
.
junit
.
Assert
.
assert
Same
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
final
class
HikariJDBCParameterDecoratorTest
{
private
HikariJDBCParameterDecorator
hikariJDBCParameterDecorator
;
@Before
public
void
setUp
()
{
hikariJDBCParameterDecorator
=
new
HikariJDBCParameterDecorator
();
}
@Test
public
void
assertGetTypeResultIsHikariDataSource
()
{
assert
Equals
(
HikariDataSource
.
class
,
hikariJDBCParameterDecorator
.
getType
());
assert
Same
(
HikariDataSource
.
class
,
new
HikariJDBCParameterDecorator
()
.
getType
());
}
@Test
public
void
assertDecoratedHikariDataSource
()
{
HikariDataSource
hikariDataSource
=
new
HikariDataSource
();
hikariJDBCParameterDecorator
.
decorate
(
hikariDataSource
);
Properties
prop
ertie
s
=
hikariDataSource
.
getDataSourceProperties
();
assertThat
(
prop
ertie
s
.
getProperty
(
"useServerPrepStmts"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"cachePrepStmts"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"prepStmtCacheSize"
),
is
(
"250"
));
assertThat
(
prop
ertie
s
.
getProperty
(
"prepStmtCacheSqlLimit"
),
is
(
"2048"
));
assertThat
(
prop
ertie
s
.
getProperty
(
"useLocalSessionState"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"rewriteBatchedStatements"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"cacheResultSetMetadata"
),
is
(
Boolean
.
FALSE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"cacheServerConfiguration"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"elideSetAutoCommits"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"maintainTimeStats"
),
is
(
Boolean
.
FALSE
.
toString
()));
assertThat
(
prop
ertie
s
.
getProperty
(
"netTimeoutForStreamingResults"
),
is
(
"0"
));
assertThat
(
prop
ertie
s
.
getProperty
(
"tinyInt1isBit"
),
is
(
Boolean
.
FALSE
.
toString
()));
new
HikariJDBCParameterDecorator
()
.
decorate
(
hikariDataSource
);
Properties
props
=
hikariDataSource
.
getDataSourceProperties
();
assertThat
(
props
.
getProperty
(
"useServerPrepStmts"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
props
.
getProperty
(
"cachePrepStmts"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
props
.
getProperty
(
"prepStmtCacheSize"
),
is
(
"250"
));
assertThat
(
props
.
getProperty
(
"prepStmtCacheSqlLimit"
),
is
(
"2048"
));
assertThat
(
props
.
getProperty
(
"useLocalSessionState"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
props
.
getProperty
(
"rewriteBatchedStatements"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
props
.
getProperty
(
"cacheResultSetMetadata"
),
is
(
Boolean
.
FALSE
.
toString
()));
assertThat
(
props
.
getProperty
(
"cacheServerConfiguration"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
props
.
getProperty
(
"elideSetAutoCommits"
),
is
(
Boolean
.
TRUE
.
toString
()));
assertThat
(
props
.
getProperty
(
"maintainTimeStats"
),
is
(
Boolean
.
FALSE
.
toString
()));
assertThat
(
props
.
getProperty
(
"netTimeoutForStreamingResults"
),
is
(
"0"
));
assertThat
(
props
.
getProperty
(
"tinyInt1isBit"
),
is
(
Boolean
.
FALSE
.
toString
()));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录