HADOOP-8637. FilterFileSystem#setWriteChecksum is broken (daryn via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1367702 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-07-31 18:58:43 +00:00
parent a37272e0e3
commit 75be1e0e76
3 changed files with 27 additions and 1 deletions

View File

@ -867,6 +867,8 @@ Release 0.23.3 - UNRELEASED
HADOOP-8635. Cannot cancel paths registered deleteOnExit (daryn via bobby)
HADOOP-8637. FilterFileSystem#setWriteChecksum is broken (daryn via bobby)
Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -376,7 +376,7 @@ public class FilterFileSystem extends FileSystem {
@Override
public void setWriteChecksum(boolean writeChecksum) {
fs.setVerifyChecksum(writeChecksum);
fs.setWriteChecksum(writeChecksum);
}
@Override

View File

@ -286,6 +286,30 @@ public class TestFilterFileSystem {
checkFsConf(flfs, conf, 3);
}
@Test
public void testVerifyChecksumPassthru() {
FileSystem mockFs = mock(FileSystem.class);
FileSystem fs = new FilterFileSystem(mockFs);
fs.setVerifyChecksum(false);
verify(mockFs).setVerifyChecksum(eq(false));
reset(mockFs);
fs.setVerifyChecksum(true);
verify(mockFs).setVerifyChecksum(eq(true));
}
@Test
public void testWriteChecksumPassthru() {
FileSystem mockFs = mock(FileSystem.class);
FileSystem fs = new FilterFileSystem(mockFs);
fs.setWriteChecksum(false);
verify(mockFs).setWriteChecksum(eq(false));
reset(mockFs);
fs.setWriteChecksum(true);
verify(mockFs).setWriteChecksum(eq(true));
}
private void checkInit(FilterFileSystem fs, boolean expectInit)
throws Exception {
URI uri = URI.create("filter:/");