svn merge -c 1367702 FIXES: HADOOP-8637. FilterFileSystem#setWriteChecksum is broken (daryn via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1367703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-07-31 19:00:03 +00:00
parent 6fe821a14a
commit 30ba954741
3 changed files with 27 additions and 1 deletions

View File

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

View File

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

View File

@ -286,6 +286,30 @@ public class TestFilterFileSystem {
checkFsConf(flfs, conf, 3); 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) private void checkInit(FilterFileSystem fs, boolean expectInit)
throws Exception { throws Exception {
URI uri = URI.create("filter:/"); URI uri = URI.create("filter:/");