Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
a67c09f9
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 搜索 >>
未验证
提交
a67c09f9
编写于
8月 15, 2019
作者:
L
Liang Zhang
提交者:
GitHub
8月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2856 from FujiwaraTakumi/dev
add unit test cases about mariadb;
上级
6f6da87b
165883c3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
6 deletion
+63
-6
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
...ransaction/xa/jta/datasource/XADataSourceFactoryTest.java
+8
-1
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
...asource/properties/XADataSourceDefinitionFactoryTest.java
+6
-5
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/dialect/MariaDBXADataSourceDefinitionTest.java
...properties/dialect/MariaDBXADataSourceDefinitionTest.java
+49
-0
未找到文件。
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
浏览文件 @
a67c09f9
...
...
@@ -21,6 +21,7 @@ import com.microsoft.sqlserver.jdbc.SQLServerXADataSource;
import
org.apache.shardingsphere.core.database.DatabaseTypes
;
import
org.h2.jdbcx.JdbcDataSource
;
import
org.junit.Test
;
import
org.mariadb.jdbc.MariaDbDataSource
;
import
org.postgresql.xa.PGXADataSource
;
import
javax.sql.XADataSource
;
...
...
@@ -35,7 +36,13 @@ public final class XADataSourceFactoryTest {
XADataSource
xaDataSource
=
XADataSourceFactory
.
build
(
DatabaseTypes
.
getActualDatabaseType
(
"H2"
));
assertThat
(
xaDataSource
,
instanceOf
(
JdbcDataSource
.
class
));
}
@Test
public
void
assertCreateMariaDBXADataSource
()
{
XADataSource
xaDataSource
=
XADataSourceFactory
.
build
(
DatabaseTypes
.
getActualDatabaseType
(
"MariaDB"
));
assertThat
(
xaDataSource
,
instanceOf
(
MariaDbDataSource
.
class
));
}
@Test
public
void
assertCreatePGXADataSource
()
{
XADataSource
xaDataSource
=
XADataSourceFactory
.
build
(
DatabaseTypes
.
getActualDatabaseType
(
"PostgreSQL"
));
...
...
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
浏览文件 @
a67c09f9
...
...
@@ -18,11 +18,7 @@
package
org.apache.shardingsphere.transaction.xa.jta.datasource.properties
;
import
org.apache.shardingsphere.core.database.DatabaseTypes
;
import
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.H2XADataSourceDefinition
;
import
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.MySQLXADataSourceDefinition
;
import
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.OracleXADataSourceDefinition
;
import
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.PostgreSQLXADataSourceDefinition
;
import
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.SQLServerXADataSourceDefinition
;
import
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.*
;
import
org.junit.Test
;
import
static
org
.
hamcrest
.
CoreMatchers
.
instanceOf
;
...
...
@@ -39,6 +35,11 @@ public final class XADataSourceDefinitionFactoryTest {
public
void
assertCreateXAPropertiesForMySQL
()
{
assertThat
(
XADataSourceDefinitionFactory
.
getXADataSourceDefinition
(
DatabaseTypes
.
getActualDatabaseType
(
"MySQL"
)),
instanceOf
(
MySQLXADataSourceDefinition
.
class
));
}
@Test
public
void
assertCreateXAPropertiesForMariaDB
()
{
assertThat
(
XADataSourceDefinitionFactory
.
getXADataSourceDefinition
(
DatabaseTypes
.
getActualDatabaseType
(
"MariaDB"
)),
instanceOf
(
MariaDBXADataSourceDefinition
.
class
));
}
@Test
public
void
assertCreateXAPropertiesForPostgreSQL
()
{
...
...
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/dialect/MariaDBXADataSourceDefinitionTest.java
0 → 100644
浏览文件 @
a67c09f9
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect
;
import
org.apache.shardingsphere.core.config.DatabaseAccessConfiguration
;
import
org.hamcrest.CoreMatchers
;
import
org.junit.Test
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Properties
;
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
final
class
MariaDBXADataSourceDefinitionTest
{
@Test
public
void
assertGetXADriverClassName
()
{
assertThat
(
new
MariaDBXADataSourceDefinition
().
getXADriverClassName
(),
CoreMatchers
.<
Collection
<
String
>>
is
(
Arrays
.
asList
(
org
.
mariadb
.
jdbc
.
MariaDbDataSource
.
class
.
getName
())));
}
@Test
public
void
assertGetXAProperties
()
{
Properties
actual
=
new
MariaDBXADataSourceDefinition
().
getXAProperties
(
new
DatabaseAccessConfiguration
(
"jdbc:mysql://127.0.0.1:3306/demo"
,
"root"
,
"root"
));
assertThat
(
actual
.
getProperty
(
"user"
),
is
(
"root"
));
assertThat
(
actual
.
getProperty
(
"password"
),
is
(
"root"
));
assertThat
(
actual
.
getProperty
(
"url"
),
is
(
"jdbc:mysql://127.0.0.1:3306/demo"
));
assertThat
(
actual
.
getProperty
(
"ServerName"
),
is
(
"127.0.0.1"
));
assertThat
(
actual
.
getProperty
(
"port"
),
is
(
"3306"
));
assertThat
(
actual
.
getProperty
(
"DatabaseName"
),
is
(
"demo"
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录