sijie closed pull request #1182: MockBookKeeperTestCase failed on casting 
ByteBufList
URL: https://github.com/apache/bookkeeper/pull/1182
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 f17764857..ffb85f58e 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 @@ protected void setupBookieClientReadEntry() {
             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 @@ protected void setupBookieClientAddEntry() {
             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 =


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to