提交 ac16fb6c 编写于 作者: C cherrylzhao

for #1963 add assertRemoveIfPresent test case for MySQLBinaryStatementRegistryTest.

上级 5a1c7f8d
......@@ -23,7 +23,7 @@ import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.ad
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.admin.quit.MySQLComQuitPacketTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.MySQLColumnDefinition41PacketTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.MySQLFieldCountPacketTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.MySQLMySQLBinaryStatementRegistryTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.MySQLBinaryStatementRegistryTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.close.MySQLComStmtClosePacketTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.execute.MySQLBinaryResultSetRowPacketTest;
import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.execute.MySQLComStmtExecutePacketTest;
......@@ -43,7 +43,7 @@ import org.junit.runners.Suite.SuiteClasses;
MySQLCommandPacketTypeLoaderTest.class,
MySQLMySQLCommandPacketTypeTest.class,
MySQLMySQLCommandPacketFactoryTest.class,
MySQLMySQLBinaryStatementRegistryTest.class,
MySQLBinaryStatementRegistryTest.class,
MySQLNullBitmapTest.class,
AllMySQLBinaryProtocolTests.class,
MySQLFieldCountPacketTest.class,
......
......@@ -23,9 +23,10 @@ import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
public final class MySQLMySQLBinaryStatementRegistryTest {
public final class MySQLBinaryStatementRegistryTest {
private final String sql = "SELECT * FROM tbl WHERE id=?";
......@@ -51,4 +52,12 @@ public final class MySQLMySQLBinaryStatementRegistryTest {
assertThat(actual.getSql(), is(sql));
assertThat(actual.getParametersCount(), is(1));
}
@Test
public void assertRemoveIfPresent() {
MySQLBinaryStatementRegistry.getInstance().register(sql, 1);
MySQLBinaryStatementRegistry.getInstance().remove(1);
MySQLBinaryStatement actual = MySQLBinaryStatementRegistry.getInstance().getBinaryStatement(1);
assertNull(actual);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册