Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
fb78186b
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,发现更多精彩内容 >>
提交
fb78186b
编写于
8月 27, 2018
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add BinaryResultSetRowPacketTest but ignored
上级
5b44a80a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
72 addition
and
9 deletion
+72
-9
sharding-proxy/src/test/java/io/shardingsphere/proxy/transport/mysql/packet/command/AllMySQLCommandPacketTests.java
...port/mysql/packet/command/AllMySQLCommandPacketTests.java
+11
-9
sharding-proxy/src/test/java/io/shardingsphere/proxy/transport/mysql/packet/command/query/binary/execute/BinaryProtocolValueTest.java
...command/query/binary/execute/BinaryProtocolValueTest.java
+10
-0
sharding-proxy/src/test/java/io/shardingsphere/proxy/transport/mysql/packet/command/query/binary/execute/BinaryResultSetRowPacketTest.java
...nd/query/binary/execute/BinaryResultSetRowPacketTest.java
+51
-0
未找到文件。
sharding-proxy/src/test/java/io/shardingsphere/proxy/transport/mysql/packet/command/AllMySQLCommandPacketTests.java
浏览文件 @
fb78186b
...
...
@@ -27,6 +27,7 @@ import io.shardingsphere.proxy.transport.mysql.packet.command.query.QueryRespons
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.BinaryStatementRegistryTest
;
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.close.ComStmtClosePacketTest
;
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.execute.BinaryProtocolValueTest
;
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.execute.BinaryResultSetRowPacketTest
;
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.execute.NullBitmapTest
;
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.prepare.ComStmtPrepareOKPacketTest
;
import
io.shardingsphere.proxy.transport.mysql.packet.command.query.text.TextResultSetRowPacketTest
;
...
...
@@ -42,17 +43,18 @@ import org.junit.runners.Suite.SuiteClasses;
CommandPacketFactoryTest
.
class
,
CommandResponsePacketsTest
.
class
,
QueryResponsePacketsTest
.
class
,
BinaryStatementRegistryTest
.
class
,
NullBitmapTest
.
class
,
BinaryStatementRegistryTest
.
class
,
NullBitmapTest
.
class
,
BinaryProtocolValueTest
.
class
,
FieldCountPacketTest
.
class
,
ColumnDefinition41PacketTest
.
class
,
TextResultSetRowPacketTest
.
class
,
ComFieldListPacketTest
.
class
,
ComQueryPacketTest
.
class
,
FieldCountPacketTest
.
class
,
ColumnDefinition41PacketTest
.
class
,
TextResultSetRowPacketTest
.
class
,
ComFieldListPacketTest
.
class
,
ComQueryPacketTest
.
class
,
ComStmtPrepareOKPacketTest
.
class
,
BinaryResultSetRowPacketTest
.
class
,
ComStmtPrepareOKPacketTest
.
class
,
ComStmtClosePacketTest
.
class
,
ComStmtClosePacketTest
.
class
,
ComInitDbPacketTest
.
class
,
ComPingPacketTest
.
class
,
ComQuitPacketTest
.
class
,
...
...
sharding-proxy/src/test/java/io/shardingsphere/proxy/transport/mysql/packet/command/query/binary/execute/BinaryProtocolValueTest.java
浏览文件 @
fb78186b
...
...
@@ -108,6 +108,11 @@ public final class BinaryProtocolValueTest {
assertThat
(
new
BinaryProtocolValue
(
ColumnType
.
MYSQL_TYPE_TIME
,
payload
).
read
(),
is
((
Object
)
new
Timestamp
(
0L
)));
}
@Test
(
expected
=
IllegalArgumentException
.
class
)
public
void
assertReadUnsupported
()
{
new
BinaryProtocolValue
(
ColumnType
.
MYSQL_TYPE_NULL
,
payload
).
read
();
}
@Test
public
void
assertWriteStringLenenc
()
{
new
BinaryProtocolValue
(
ColumnType
.
MYSQL_TYPE_STRING
,
payload
).
write
(
"value"
);
...
...
@@ -177,4 +182,9 @@ public final class BinaryProtocolValueTest {
new
BinaryProtocolValue
(
ColumnType
.
MYSQL_TYPE_TIME
,
payload
).
write
(
new
Timestamp
(
0L
));
verify
(
payload
).
writeTime
(
new
Timestamp
(
0L
));
}
@Test
(
expected
=
IllegalArgumentException
.
class
)
public
void
assertWriteUnsupported
()
{
new
BinaryProtocolValue
(
ColumnType
.
MYSQL_TYPE_NULL
,
payload
).
write
(
payload
);
}
}
sharding-proxy/src/test/java/io/shardingsphere/proxy/transport/mysql/packet/command/query/binary/execute/BinaryResultSetRowPacketTest.java
0 → 100644
浏览文件 @
fb78186b
/*
* Copyright 2016-2018 shardingsphere.io.
* <p>
* Licensed 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.
* </p>
*/
package
io.shardingsphere.proxy.transport.mysql.packet.command.query.binary.execute
;
import
io.shardingsphere.proxy.transport.mysql.constant.ColumnType
;
import
io.shardingsphere.proxy.transport.mysql.packet.MySQLPacketPayload
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Mock
;
import
org.mockito.junit.MockitoJUnitRunner
;
import
java.util.Arrays
;
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
@RunWith
(
MockitoJUnitRunner
.
class
)
public
final
class
BinaryResultSetRowPacketTest
{
@Mock
private
MySQLPacketPayload
payload
;
@Test
@Ignore
public
void
assertWrite
()
{
BinaryResultSetRowPacket
actual
=
new
BinaryResultSetRowPacket
(
1
,
2
,
Arrays
.<
Object
>
asList
(
"value"
,
null
),
Arrays
.
asList
(
ColumnType
.
MYSQL_TYPE_STRING
,
ColumnType
.
MYSQL_TYPE_STRING
));
assertThat
(
actual
.
getSequenceId
(),
is
(
1
));
assertThat
(
actual
.
getData
(),
is
(
Arrays
.<
Object
>
asList
(
"value"
,
null
)));
actual
.
write
(
payload
);
verify
(
payload
,
times
(
2
)).
writeInt1
(
0x00
);
verify
(
payload
).
writeStringLenenc
(
"value"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录