HADOOP-11432. Fix SymlinkBaseTest#testCreateLinkUsingPartQualPath2. (Liang Xie via gera)

This commit is contained in:
Gera Shegalov 2015-01-30 18:36:37 -08:00
parent 054a947989
commit 26c2de36e2
3 changed files with 11 additions and 4 deletions

View File

@ -805,6 +805,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11523. StorageException complaining " no lease ID" when updating HADOOP-11523. StorageException complaining " no lease ID" when updating
FolderLastModifiedTime in WASB. (Duo Xu via cnauroth) FolderLastModifiedTime in WASB. (Duo Xu via cnauroth)
HADOOP-11432. Fix SymlinkBaseTest#testCreateLinkUsingPartQualPath2.
(Liang Xie via gera)
Release 2.6.1 - UNRELEASED Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -45,12 +45,13 @@ import org.apache.hadoop.fs.permission.AclEntry;
import org.apache.hadoop.fs.permission.AclStatus; import org.apache.hadoop.fs.permission.AclStatus;
import org.apache.hadoop.fs.permission.FsAction; import org.apache.hadoop.fs.permission.FsAction;
import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.fs.InvalidPathException;
import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.SecurityUtil;
import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.util.Progressable; import org.apache.hadoop.util.Progressable;
import com.google.common.annotations.VisibleForTesting;
/** /**
* This class provides an interface for implementors of a Hadoop file system * This class provides an interface for implementors of a Hadoop file system
* (analogous to the VFS of Unix). Applications do not access this class; * (analogous to the VFS of Unix). Applications do not access this class;
@ -80,6 +81,9 @@ public abstract class AbstractFileSystem {
/** The statistics for this file system. */ /** The statistics for this file system. */
protected Statistics statistics; protected Statistics statistics;
@VisibleForTesting
static final String NO_ABSTRACT_FS_ERROR = "No AbstractFileSystem configured for scheme";
private final URI myUri; private final URI myUri;
public Statistics getStatistics() { public Statistics getStatistics() {
@ -154,8 +158,8 @@ public abstract class AbstractFileSystem {
Class<?> clazz = conf.getClass(fsImplConf, null); Class<?> clazz = conf.getClass(fsImplConf, null);
if (clazz == null) { if (clazz == null) {
throw new UnsupportedFileSystemException(String.format( throw new UnsupportedFileSystemException(String.format(
"%s=null: No AbstractFileSystem configured for scheme: %s", "%s=null: %s: %s",
fsImplConf, uri.getScheme())); fsImplConf, NO_ABSTRACT_FS_ERROR, uri.getScheme()));
} }
return (AbstractFileSystem) newInstance(clazz, uri, conf); return (AbstractFileSystem) newInstance(clazz, uri, conf);
} }

View File

@ -578,7 +578,7 @@ public abstract class SymlinkBaseTest {
// Expected // Expected
if (wrapper instanceof FileContextTestWrapper) { if (wrapper instanceof FileContextTestWrapper) {
GenericTestUtils.assertExceptionContains( GenericTestUtils.assertExceptionContains(
"No AbstractFileSystem configured for scheme: null", e); AbstractFileSystem.NO_ABSTRACT_FS_ERROR, e);
} else if (wrapper instanceof FileSystemTestWrapper) { } else if (wrapper instanceof FileSystemTestWrapper) {
assertEquals("No FileSystem for scheme: null", e.getMessage()); assertEquals("No FileSystem for scheme: null", e.getMessage());
} }