steveloughran commented on a change in pull request #716: HADOOP-16205
Backporting ABFS driver from trunk to branch 2.0
URL: https://github.com/apache/hadoop/pull/716#discussion_r275092799
##########
File path:
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractGetFileStatusTest.java
##########
@@ -272,38 +275,22 @@ public void testListFilesNoDir() throws Throwable {
}
}
- @Test
+ @Test (expected = FileNotFoundException.class)
public void testLocatedStatusNoDir() throws Throwable {
describe("test the LocatedStatus call on a path which is not present");
- try {
- RemoteIterator<LocatedFileStatus> iterator
- = getFileSystem().listLocatedStatus(path("missing"));
- fail("Expected an exception, got an iterator: " + iterator);
- } catch (FileNotFoundException expected) {
- // expected
- }
+ getFileSystem().listLocatedStatus(path("missing"));
Review comment:
I'd prefer retaining the intercept() code of trunk. I know java 7 hates
l-expressions, but we've done the backport elsewhere: see
org.apache.hadoop.fs.s3a.s3guard.AbstractS3GuardToolTestBase for some examples.
IntellJ IDEA will actually do the conversion from an lambda expression to a
Callable for you if you ask it nicely
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]