steveloughran commented on code in PR #6003:
URL: https://github.com/apache/hadoop/pull/6003#discussion_r1318926470
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java:
##########
@@ -146,6 +148,30 @@ public void testCreateNonRecursive2() throws Exception {
assertIsFile(fs, testFile);
}
+ @Test
+ public void testCreateOnRoot() throws Exception {
+ final AzureBlobFileSystem fs = getFileSystem();
+ Path testFile = path(AbfsHttpConstants.ROOT_PATH);
+ try {
Review Comment:
you shouldn't need the double catch. intercept() will return the caught
exception, type case to the class of arg 1, so can be asserted on. and if an
exception is not the one expected, the stack trace is *too important to lose*.
so rethrow it or use as the cause of an assertion error
```java
AbfsRestOperationException e = intercept(...)
if (e.getStatusCode()!=HTTP_CONFLICT) {
// rethrow if its not the expected one.
throw e;
}
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java:
##########
@@ -146,6 +149,26 @@ public void testCreateNonRecursive2() throws Exception {
assertIsFile(fs, testFile);
}
+ @Test
+ public void testCreateOnRoot() throws Exception {
Review Comment:
aah. well, do that then. it's off by default to stop people accidentally
deleting their local disk and then complaining. (this has never happened,
but...)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]