Sahil Takiar created HDFS-14386:
-----------------------------------
Summary: Improve libhdfs test coverage for failure paths
Key: HDFS-14386
URL: https://issues.apache.org/jira/browse/HDFS-14386
Project: Hadoop HDFS
Issue Type: Improvement
Components: hdfs-client, libhdfs, native
Reporter: Sahil Takiar
Assignee: Sahil Takiar
While working on HDFS-14304 and HDFS-14348, it seems that libhdfs does not have
great test coverage for failure paths. We found a few places in libhdfs where
we are not propagating / handling exceptions properly. The goal of this JIRA is
to improve test coverage for the failure / exception handling code in libhdfs.
I don't have a clear picture of how to do this, but here are some ideas:
(1) Create a dummy {{FileSystem}} where all operations throw an {{Exception}}
and call into that {{FileSystem}} using libhdfs.
(2) We already do things like trying to open a file that does not exist, we can
add tests that list a directory that does not exist, etc.
(3) It would be great if we could use some type of method stubbing (like
Mockito in Java) for JNI methods, so we could test that our usage of the JNI is
correct - e.g. if {{NewByteArray}} returns {{NULL}} do we actually throw an
exception?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]