tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhiyu...@apache.org
Subject [2/8] tez git commit: TEZ-3867. testSendCustomProcessorEvent try to get array out of read only ByteBuffer (Zhiyuan Yang via kshukla)
Date Wed, 13 Dec 2017 00:01:44 GMT
TEZ-3867. testSendCustomProcessorEvent try to get array out of read only ByteBuffer (Zhiyuan
Yang via kshukla)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/c85f9277
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/c85f9277
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/c85f9277

Branch: refs/heads/branch-0.9.1
Commit: c85f9277429c65570749de5769e5c74b9849a112
Parents: b61e55c
Author: Kuhu Shukla <kshukla@yahoo-inc.com>
Authored: Wed Nov 29 06:57:46 2017 -0600
Committer: Kuhu Shukla <kshukla@yahoo-inc.com>
Committed: Wed Nov 29 06:57:55 2017 -0600

----------------------------------------------------------------------
 .../apache/tez/dag/app/dag/impl/TestVertexManager.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/c85f9277/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexManager.java
b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexManager.java
index c850d68..f7a6037 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexManager.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexManager.java
@@ -278,7 +278,15 @@ public class TestVertexManager {
     verify(mockHandler, times(1)).handle(requestCaptor.capture());
     CustomProcessorEvent cpe =
       (CustomProcessorEvent)(requestCaptor.getValue().getEvents().get(0).getEvent());
-    assertArrayEquals(payload, cpe.getPayload().array());
+
+    // should be able to get payload any times
+    for (int i = 0; i < 2; i++) {
+      ByteBuffer payloadBuffer = cpe.getPayload();
+      assertEquals(payload.length, payloadBuffer.remaining());
+      for (byte aPayload : payload) {
+        assertEquals(aPayload, payloadBuffer.get());
+      }
+    }
   }
 
   public static class CustomVertexManager extends VertexManagerPlugin {


Mime
View raw message