HADOOP-9638. Merging change r1492297 from trunk to branch-2.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1492314 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f913f4c8ff
commit
7f2848ba73
|
@ -256,6 +256,9 @@ Release 2.1.0-beta - UNRELEASED
|
|||
|
||||
HADOOP-9581. hadoop --config non-existent directory should result in error
|
||||
(Ashwin Shankar via jlowe)
|
||||
|
||||
HADOOP-9638. Parallel test changes caused invalid test path for several HDFS
|
||||
tests on Windows (Andrey Klochkov via cnauroth)
|
||||
|
||||
HADOOP-9532. HADOOP_CLIENT_OPTS is appended twice by Windows cmd scripts.
|
||||
(Chris Nauroth via suresh)
|
||||
|
|
|
@ -65,7 +65,13 @@ public abstract class FileContextMainOperationsBaseTest {
|
|||
|
||||
public Path localFsRootPath;
|
||||
|
||||
protected final FileContextTestHelper fileContextTestHelper = new FileContextTestHelper();
|
||||
protected final FileContextTestHelper fileContextTestHelper =
|
||||
createFileContextHelper();
|
||||
|
||||
protected FileContextTestHelper createFileContextHelper() {
|
||||
return new FileContextTestHelper();
|
||||
}
|
||||
|
||||
protected static FileContext fc;
|
||||
|
||||
final private static PathFilter DEFAULT_FILTER = new PathFilter() {
|
||||
|
|
|
@ -42,7 +42,15 @@ public final class FileContextTestHelper {
|
|||
* Create a context with test root relative to the <wd>/build/test/data
|
||||
*/
|
||||
public FileContextTestHelper() {
|
||||
testRootDir = System.getProperty("test.build.data", "target/test/data") + "/" + RandomStringUtils.randomAlphanumeric(10);
|
||||
this(System.getProperty("test.build.data", "target/test/data") + "/" +
|
||||
RandomStringUtils.randomAlphanumeric(10));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a context with the given test root
|
||||
*/
|
||||
public FileContextTestHelper(String testRootDir) {
|
||||
this.testRootDir = testRootDir;
|
||||
}
|
||||
|
||||
public static int getDefaultBlockSize() {
|
||||
|
|
|
@ -75,7 +75,11 @@ public class ViewFsBaseTest {
|
|||
Configuration conf;
|
||||
FileContext xfcViewWithAuthority; // same as fsView but with authority
|
||||
URI schemeWithAuthority;
|
||||
final FileContextTestHelper fileContextTestHelper = new FileContextTestHelper();
|
||||
final FileContextTestHelper fileContextTestHelper = createFileContextHelper();
|
||||
|
||||
protected FileContextTestHelper createFileContextHelper() {
|
||||
return new FileContextTestHelper();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -38,6 +38,12 @@ public class TestFcHdfsCreateMkdir extends
|
|||
private static MiniDFSCluster cluster;
|
||||
private static Path defaultWorkingDirectory;
|
||||
|
||||
@Override
|
||||
protected FileContextTestHelper createFileContextHelper() {
|
||||
return new FileContextTestHelper("/tmp/TestFcHdfsCreateMkdir");
|
||||
}
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void clusterSetupAtBegining()
|
||||
throws IOException, LoginException, URISyntaxException {
|
||||
|
|
|
@ -35,7 +35,8 @@ import org.junit.BeforeClass;
|
|||
|
||||
public class TestFcHdfsPermission extends FileContextPermissionBase {
|
||||
|
||||
private static final FileContextTestHelper fileContextTestHelper = new FileContextTestHelper();
|
||||
private static final FileContextTestHelper fileContextTestHelper =
|
||||
new FileContextTestHelper("/tmp/TestFcHdfsPermission");
|
||||
private static FileContext fc;
|
||||
|
||||
private static MiniDFSCluster cluster;
|
||||
|
|
|
@ -42,7 +42,8 @@ import org.junit.Test;
|
|||
|
||||
public class TestFcHdfsSetUMask {
|
||||
|
||||
private static FileContextTestHelper fileContextTestHelper = new FileContextTestHelper();
|
||||
private static FileContextTestHelper fileContextTestHelper =
|
||||
new FileContextTestHelper("/tmp/TestFcHdfsSetUMask");
|
||||
private static MiniDFSCluster cluster;
|
||||
private static Path defaultWorkingDirectory;
|
||||
private static FileContext fc;
|
||||
|
|
|
@ -50,7 +50,8 @@ public class TestFcHdfsSymlink extends FileContextSymlinkBaseTest {
|
|||
((Log4JLogger)NameNode.stateChangeLog).getLogger().setLevel(Level.ALL);
|
||||
}
|
||||
|
||||
private static FileContextTestHelper fileContextTestHelper = new FileContextTestHelper();
|
||||
private static FileContextTestHelper fileContextTestHelper =
|
||||
new FileContextTestHelper("/tmp/TestFcHdfsSymlink");
|
||||
private static MiniDFSCluster cluster;
|
||||
private static WebHdfsFileSystem webhdfs;
|
||||
private static DistributedFileSystem dfs;
|
||||
|
|
|
@ -41,11 +41,15 @@ import org.junit.Test;
|
|||
|
||||
public class TestHDFSFileContextMainOperations extends
|
||||
FileContextMainOperationsBaseTest {
|
||||
private static FileContextTestHelper fileContextTestHelper = new FileContextTestHelper();
|
||||
private static MiniDFSCluster cluster;
|
||||
private static Path defaultWorkingDirectory;
|
||||
private static HdfsConfiguration CONF = new HdfsConfiguration();
|
||||
|
||||
@Override
|
||||
protected FileContextTestHelper createFileContextHelper() {
|
||||
return new FileContextTestHelper("/tmp/TestHDFSFileContextMainOperations");
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void clusterSetupAtBegining() throws IOException,
|
||||
LoginException, URISyntaxException {
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.net.URISyntaxException;
|
|||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import org.apache.hadoop.fs.FileContext;
|
||||
import org.apache.hadoop.fs.FileContextTestHelper;
|
||||
import org.apache.hadoop.fs.FileStatus;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.fs.RemoteIterator;
|
||||
|
@ -43,6 +44,11 @@ public class TestViewFsAtHdfsRoot extends ViewFsBaseTest {
|
|||
private static HdfsConfiguration CONF = new HdfsConfiguration();
|
||||
private static FileContext fc;
|
||||
|
||||
@Override
|
||||
protected FileContextTestHelper createFileContextHelper() {
|
||||
return new FileContextTestHelper("/tmp/TestViewFsAtHdfsRoot");
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void clusterSetupAtBegining() throws IOException,
|
||||
LoginException, URISyntaxException {
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.net.URISyntaxException;
|
|||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import org.apache.hadoop.fs.FileContext;
|
||||
import org.apache.hadoop.fs.FileContextTestHelper;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
||||
import org.apache.hadoop.hdfs.HdfsConfiguration;
|
||||
|
@ -39,6 +40,12 @@ public class TestViewFsHdfs extends ViewFsBaseTest {
|
|||
private static HdfsConfiguration CONF = new HdfsConfiguration();
|
||||
private static FileContext fc;
|
||||
|
||||
@Override
|
||||
protected FileContextTestHelper createFileContextHelper() {
|
||||
return new FileContextTestHelper("/tmp/TestViewFsHdfs");
|
||||
}
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void clusterSetupAtBegining() throws IOException,
|
||||
LoginException, URISyntaxException {
|
||||
|
|
|
@ -51,6 +51,10 @@ public class TestFSMainOperationsWebHdfs extends FSMainOperationsBaseTest {
|
|||
private static Path defaultWorkingDirectory;
|
||||
private static FileSystem fileSystem;
|
||||
|
||||
public TestFSMainOperationsWebHdfs() {
|
||||
super("/tmp/TestFSMainOperationsWebHdfs");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FileSystem createFileSystem() throws Exception {
|
||||
return fileSystem;
|
||||
|
|
Loading…
Reference in New Issue