|
@@ -176,7 +176,21 @@ public class TestWebHdfsFileSystemContract extends FileSystemContractBaseTest {
|
|
}
|
|
}
|
|
|
|
|
|
public void testSeek() throws IOException {
|
|
public void testSeek() throws IOException {
|
|
- final Path p = new Path("/test/testSeek");
|
|
|
|
|
|
+ final Path dir = new Path("/test/testSeek");
|
|
|
|
+ assertTrue(fs.mkdirs(dir));
|
|
|
|
+
|
|
|
|
+ { //test zero file size
|
|
|
|
+ final Path zero = new Path(dir, "zero");
|
|
|
|
+ fs.create(zero).close();
|
|
|
|
+
|
|
|
|
+ int count = 0;
|
|
|
|
+ final FSDataInputStream in = fs.open(zero);
|
|
|
|
+ for(; in.read() != -1; count++);
|
|
|
|
+ in.close();
|
|
|
|
+ assertEquals(0, count);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ final Path p = new Path(dir, "file");
|
|
createFile(p);
|
|
createFile(p);
|
|
|
|
|
|
final int one_third = data.length/3;
|
|
final int one_third = data.length/3;
|
|
@@ -248,7 +262,6 @@ public class TestWebHdfsFileSystemContract extends FileSystemContractBaseTest {
|
|
final FSDataInputStream in = fs.open(root);
|
|
final FSDataInputStream in = fs.open(root);
|
|
in.read();
|
|
in.read();
|
|
fail();
|
|
fail();
|
|
- fail();
|
|
|
|
} catch(IOException e) {
|
|
} catch(IOException e) {
|
|
WebHdfsFileSystem.LOG.info("This is expected.", e);
|
|
WebHdfsFileSystem.LOG.info("This is expected.", e);
|
|
}
|
|
}
|