arunsarin85 commented on code in PR #11337:
URL: https://github.com/apache/ozone/pull/11337#discussion_r4140159291
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestStreamBlockInputStream.java:
##########
@@ -124,9 +144,8 @@ private void runTestReadKey(String key, int bufferSize,
boolean randomReadOffset
if (read == -1) {
break;
}
- for (int i = 0; i < read; i++) {
- assertEquals(inputData[pos + i], buffer[i], "pos=" + pos + ", i=" +
i);
- }
+ assertArrayEquals(Arrays.copyOfRange(inputData, pos, pos + read),
+ Arrays.copyOfRange(buffer, 0, read), "pos=" + pos);
Review Comment:
Added a patch !
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestStreamBlockInputStream.java:
##########
@@ -175,19 +194,16 @@ void runTestPositionedRead(ByteBuffer buffer,
KeyInputStream in, int pos, int le
void assertData(int pos, int length, ByteBuffer buffer) {
buffer.flip();
assertEquals(length, buffer.remaining());
- for (int i = 0; i < length; i++) {
- assertEquals(inputData[pos + i], buffer.get(i), "pos=" + pos + ", i=" +
i);
- }
- }
-
- @Test
- void testAllWithPreRead() throws Exception {
- runTestAll(true);
+ byte[] actual = new byte[length];
+ buffer.get(actual);
+ assertArrayEquals(Arrays.copyOfRange(inputData, pos, pos + length), actual,
Review Comment:
Added a patch !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]