[
https://issues.apache.org/jira/browse/HDFS-6194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13968572#comment-13968572
]
Haohui Mai commented on HDFS-6194:
----------------------------------
bq. This setting is required. If status is not initialized, getInputStream()
will fail by NPE.
This is because the code mocked the class that is supposed to be tested:
{code}
+ ByteRangeInputStream bris =
+ mock(ByteRangeInputStream.class, CALLS_REAL_METHODS);
{code}
What it should have done is to mock the dependency of {{ByteRangeInputStream}},
and to test the functionality of {{ByteRangeInputStream}}, but not to mock
{{ByteRangeInputStream}} itself.
> 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.3.patch, HDFS-6194.4.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)