Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
04f0f2ce
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,发现更多精彩内容 >>
提交
04f0f2ce
编写于
7月 05, 2017
作者:
H
haocao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor integrate test cases 8th.
上级
7af99396
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
26 deletion
+23
-26
sharding-jdbc-core/src/test/java/com/dangdang/ddframe/rdb/integrate/AbstractDBUnitTest.java
...om/dangdang/ddframe/rdb/integrate/AbstractDBUnitTest.java
+18
-12
sharding-jdbc-core/src/test/java/com/dangdang/ddframe/rdb/integrate/tbl/AbstractShardingTablesOnlyDBUnitTest.java
...b/integrate/tbl/AbstractShardingTablesOnlyDBUnitTest.java
+3
-1
sharding-jdbc-core/src/test/java/com/dangdang/ddframe/rdb/sharding/jdbc/AllJDBCTests.java
.../com/dangdang/ddframe/rdb/sharding/jdbc/AllJDBCTests.java
+2
-13
未找到文件。
sharding-jdbc-core/src/test/java/com/dangdang/ddframe/rdb/integrate/AbstractDBUnitTest.java
浏览文件 @
04f0f2ce
...
...
@@ -32,7 +32,6 @@ import org.dbunit.dataset.ITable;
import
org.dbunit.dataset.xml.FlatXmlDataSetBuilder
;
import
org.h2.tools.RunScript
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
javax.sql.DataSource
;
import
java.io.File
;
...
...
@@ -67,19 +66,26 @@ public abstract class AbstractDBUnitTest {
databaseTestSQL
=
currentDatabaseTestSQL
(
DB_ENV
);
}
@BeforeClass
public
static
void
createSchema
()
throws
SQLException
{
Connection
conn
;
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
for
(
String
database
:
Arrays
.
asList
(
"db"
,
"dbtbl"
,
"nullable"
,
"master"
,
"slave"
))
{
conn
=
createDataSource
(
database
+
"_"
+
i
).
getConnection
();
RunScript
.
execute
(
conn
,
new
InputStreamReader
(
AbstractDBUnitTest
.
class
.
getClassLoader
().
getResourceAsStream
(
"integrate/schema/table/"
+
database
+
".sql"
)));
conn
.
close
();
static
{
createSchema
();
}
private
static
void
createSchema
()
{
try
{
Connection
conn
;
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
for
(
String
database
:
Arrays
.
asList
(
"db"
,
"dbtbl"
,
"nullable"
,
"master"
,
"slave"
))
{
conn
=
createDataSource
(
database
+
"_"
+
i
).
getConnection
();
RunScript
.
execute
(
conn
,
new
InputStreamReader
(
AbstractDBUnitTest
.
class
.
getClassLoader
().
getResourceAsStream
(
"integrate/schema/table/"
+
database
+
".sql"
)));
conn
.
close
();
}
}
conn
=
createDataSource
(
"tbl"
).
getConnection
();
RunScript
.
execute
(
conn
,
new
InputStreamReader
(
AbstractDBUnitTest
.
class
.
getClassLoader
().
getResourceAsStream
(
"integrate/schema/table/tbl.sql"
)));
conn
.
close
();
}
catch
(
final
SQLException
ex
)
{
ex
.
printStackTrace
();
}
conn
=
createDataSource
(
"tbl"
).
getConnection
();
RunScript
.
execute
(
conn
,
new
InputStreamReader
(
AbstractDBUnitTest
.
class
.
getClassLoader
().
getResourceAsStream
(
"integrate/schema/table/tbl.sql"
)));
conn
.
close
();
}
@Before
...
...
sharding-jdbc-core/src/test/java/com/dangdang/ddframe/rdb/integrate/tbl/AbstractShardingTablesOnlyDBUnitTest.java
浏览文件 @
04f0f2ce
...
...
@@ -86,6 +86,8 @@ public abstract class AbstractShardingTablesOnlyDBUnitTest extends AbstractDBUni
@AfterClass
public
static
void
clear
()
{
isShutdown
=
true
;
shardingDataSource
.
close
();
if
(
null
!=
shardingDataSource
)
{
shardingDataSource
.
close
();
}
}
}
sharding-jdbc-core/src/test/java/com/dangdang/ddframe/rdb/sharding/jdbc/AllJDBCTests.java
浏览文件 @
04f0f2ce
...
...
@@ -17,14 +17,9 @@
package
com.dangdang.ddframe.rdb.sharding.jdbc
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.ConnectionAdapterTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.DataSourceAdapterTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.*
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.invocation.JdbcMethodInvocationTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.PreparedStatementAdapterTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.ResultSetAdapterTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.ResultSetGetterAdapterTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.invocation.SetParameterMethodInvocationTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.adapter.StatementAdapterTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.core.connection.ShardingConnectionTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.core.datasource.MasterSlaveDataSourceTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.core.datasource.ShardingDataSourceTest
;
...
...
@@ -33,13 +28,7 @@ import com.dangdang.ddframe.rdb.sharding.jdbc.core.resultset.GeneratedKeysResult
import
com.dangdang.ddframe.rdb.sharding.jdbc.core.statement.ShardingPreparedStatementTableOnlyTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.core.statement.ShardingPreparedStatementTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.core.statement.ShardingStatementTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedGeneratedKeysResultSetTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedOperationConnectionTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedOperationDataSourceTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedOperationPreparedStatementTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedOperationResultSetTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedOperationStatementTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.UnsupportedUpdateOperationResultSetTest
;
import
com.dangdang.ddframe.rdb.sharding.jdbc.unsupported.*
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录