This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new d8adde3 MockBookKeeperTestCase failed on casting ByteBufList
d8adde3 is described below
commit d8adde373f3d0a9a6831992003b1d0048d7285d2
Author: Sijie Guo <[email protected]>
AuthorDate: Mon Feb 19 22:30:21 2018 -0800
MockBookKeeperTestCase failed on casting ByteBufList
Descriptions of the changes in this PR:
*Problem*
Issue #1141 introduces ByteBufList. But `MockBookKeeperTestCase` still
assumes `ByteBuf`. So it fails somes test cases
that use `MockBookKeeperTestCase`
*Solution*
Fix `MockBookKeeperTestCase` to expect `ByteBufList` instead of `ByteBuf`.
Author: Sijie Guo <[email protected]>
Reviewers: Matteo Merli <[email protected]>
This closes #1182 from sijie/fix_mock_bookkeeper_test_case
---
.../java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java
index f177648..ffb85f5 100644
---
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java
@@ -474,9 +474,9 @@ public abstract class MockBookKeeperTestCase {
any(BookkeeperInternalCallbacks.ReadEntryCallback.class), any());
}
- private byte[] extractEntryPayload(long ledgerId, long entryId, ByteBuf
toSend)
+ private byte[] extractEntryPayload(long ledgerId, long entryId,
ByteBufList toSend)
throws BKException.BKDigestMatchException {
- ByteBuf toSendCopy = Unpooled.copiedBuffer(toSend);
+ ByteBuf toSendCopy = Unpooled.copiedBuffer(toSend.toArray());
toSendCopy.resetReaderIndex();
DigestManager macManager = null;
try {
@@ -500,7 +500,7 @@ public abstract class MockBookKeeperTestCase {
BookieSocketAddress bookieSocketAddress = (BookieSocketAddress)
args[0];
long ledgerId = (Long) args[1];
long entryId = (Long) args[3];
- ByteBuf toSend = (ByteBuf) args[4];
+ ByteBufList toSend = (ByteBufList) args[4];
Object ctx = args[6];
int options = (int) args[7];
boolean isRecoveryAdd =
--
To stop receiving notification emails like this one, please contact
[email protected].