|
@@ -18,11 +18,14 @@
|
|
package org.apache.hadoop.fs;
|
|
package org.apache.hadoop.fs;
|
|
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
|
+import org.apache.hadoop.fs.FileSystem.Statistics;
|
|
|
|
+
|
|
import static org.apache.hadoop.fs.FileSystemTestHelper.*;
|
|
import static org.apache.hadoop.fs.FileSystemTestHelper.*;
|
|
|
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
import static org.junit.Assert.*;
|
|
|
|
+
|
|
import org.junit.Before;
|
|
import org.junit.Before;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
|
|
|
|
@@ -233,4 +236,16 @@ public class TestLocalFileSystem {
|
|
assertTrue("Did not delete file", fs.delete(file1));
|
|
assertTrue("Did not delete file", fs.delete(file1));
|
|
assertTrue("Did not delete non-empty dir", fs.delete(dir1));
|
|
assertTrue("Did not delete non-empty dir", fs.delete(dir1));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void testStatistics() throws Exception {
|
|
|
|
+ FileSystem.getLocal(new Configuration());
|
|
|
|
+ int fileSchemeCount = 0;
|
|
|
|
+ for (Statistics stats : FileSystem.getAllStatistics()) {
|
|
|
|
+ if (stats.getScheme().equals("file")) {
|
|
|
|
+ fileSchemeCount++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ assertEquals(1, fileSchemeCount);
|
|
|
|
+ }
|
|
}
|
|
}
|