[
https://issues.apache.org/jira/browse/HDFS-6194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13965658#comment-13965658
]
Haohui Mai commented on HDFS-6194:
----------------------------------
{code}
+ doNothing().when(mockConnection).connect();
+ doNothing().when(mockConnection).disconnect();
{code}
They are no-ops.
{code}
+ Whitebox.setInternalState(bris, "resolvedURL", rMock);
+ Whitebox.setInternalState(bris, "startPos", 0);
+ Whitebox.setInternalState(bris, "currentPos", 0);
+ Whitebox.setInternalState(bris, "status",
+ ByteRangeInputStream.StreamStatus.SEEK);
+ assertEquals("Initial call made incorrectly (offset check)",
+ 0, bris.startPos);
{code}
The high level goal is to verify that the seek() method is written correctly.
The test code should not depend on the internal state of the
{{ByteRangeInputStream}}. Instead, it should verify {{seek()}} calls the
methods underlying objects (i.e., {{URLOpener}}, {{URLConnection}}) correctly.
Please see check how this is done before HDFS-5570.
> Create new tests for {{ByteRangeInputStream}}
> ---------------------------------------------
>
> Key: HDFS-6194
> URL: https://issues.apache.org/jira/browse/HDFS-6194
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Haohui Mai
> Assignee: Akira AJISAKA
> Attachments: HDFS-6194.2.patch, HDFS-6194.patch
>
>
> HDFS-5570 removes old tests for {{ByteRangeInputStream}}, because the tests
> only are tightly coupled with hftp / hsftp. New tests need to be written
> because the same class is also used by {{WebHdfsFileSystem}}.
--
This message was sent by Atlassian JIRA
(v6.2#6252)