提交 fb78186b 编写于 作者: T terrymanu

add BinaryResultSetRowPacketTest but ignored

上级 5b44a80a
......@@ -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,
......
......@@ -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);
}
}
/*
* 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.
先完成此消息的编辑!
想要评论请 注册