Dushyanth, thank you for the patch.
public static final String AZURE_STORAGE_BLOBNOTFOUND_ERRORCODE = "BlobNotFound";
public static final String AZURE_STORAGE_RESOURCENOTFOUND_ERRORCODE = "RESOURCE_NOT_FOUND";
Instead of repeating these constants within hadoop-azure, do you want to use com.microsoft.azure.storage#BLOB_NOT_FOUND and #RESOURCE_NOT_FOUND? (BTW, is the second one really meant to have a value of "ResourceNotFound"? That's how it's defined in the SDK.
throw new FileNotFoundException();
Please pass a descriptive string to help with troubleshooting any time you call an exception constructor. For a FileNotFoundException, including the file path is very helpful.
The exception unwinding logic is repeated multiple times. Can that be refactored into a shared helper method?
Since the files are deleted and the correctness of the test depends on getting the exception, I didn't close the streams.
Please ensure all streams get closed anyway at the end of the test. If you need the stream to be left open while doing some other logic and running assertions, then that's fine, but proper cleanup at the end of a test run is still good practice.
I think adding the AbstractFSContract suite of tests can be done as improvement.
This has come up as feedback on multiple code reviews. The contract tests are a great way to catch early if a FileSystem implementation is not satisfying the semantics that Hadoop expects. I appreciate controlling the scope of this patch, but I also see this as a deferred maintenance problem, ultimately causing more churn as patches come in piecemeal.
HADOOP-12535 to track work on the contract tests. Dushyanth, I tentatively assigned this to you. If this is not something that you're going to work on, please unassign it, so that someone else interested in the community can pick it up.