|
@@ -29,6 +29,7 @@ import org.apache.hadoop.fs.s3a.performance.AbstractS3ACostTest;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.junit.runners.Parameterized;
|
|
|
+import org.assertj.core.api.Assertions;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
@@ -258,6 +259,36 @@ public class ITestS3AFileOperationCost extends AbstractS3ACostTest {
|
|
|
GET_FILE_STATUS_FNFE);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testCostOfRootFileStatus() throws Throwable {
|
|
|
+ Path root = path("/");
|
|
|
+ S3AFileStatus rootStatus = verifyRawInnerGetFileStatus(
|
|
|
+ root,
|
|
|
+ false,
|
|
|
+ StatusProbeEnum.ALL,
|
|
|
+ ROOT_FILE_STATUS_PROBE);
|
|
|
+ String rootStatusContent = rootStatus.toString();
|
|
|
+ Assertions.assertThat(rootStatus.isDirectory())
|
|
|
+ .describedAs("Status returned should be a directory "
|
|
|
+ + rootStatusContent)
|
|
|
+ .isEqualTo(true);
|
|
|
+ Assertions.assertThat(rootStatus.isEmptyDirectory())
|
|
|
+ .isEqualTo(Tristate.UNKNOWN);
|
|
|
+
|
|
|
+ rootStatus = verifyRawInnerGetFileStatus(
|
|
|
+ root,
|
|
|
+ true,
|
|
|
+ StatusProbeEnum.ALL,
|
|
|
+ FILE_STATUS_DIR_PROBE);
|
|
|
+ Assertions.assertThat(rootStatus.isDirectory())
|
|
|
+ .describedAs("Status returned should be a directory "
|
|
|
+ + rootStatusContent)
|
|
|
+ .isEqualTo(true);
|
|
|
+ Assertions.assertThat(rootStatus.isEmptyDirectory())
|
|
|
+ .isNotEqualByComparingTo(Tristate.UNKNOWN);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testIsDirIsFileMissingPath() throws Throwable {
|
|
|
describe("performing isDir and isFile on a missing file");
|