hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [30/40] hadoop git commit: HADOOP-14192. Aliyun OSS FileSystem contract test should implement getTestBaseDir(). Contributed by Mingliang Liu
Date Mon, 20 Mar 2017 23:18:41 GMT
HADOOP-14192. Aliyun OSS FileSystem contract test should implement getTestBaseDir(). Contributed
by Mingliang Liu


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/86035c16
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/86035c16
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/86035c16

Branch: refs/heads/HADOOP-13345
Commit: 86035c16447eb0ad7989975639f83bc4b4b26a27
Parents: 7536815
Author: Mingliang Liu <liuml07@apache.org>
Authored: Thu Mar 16 15:24:46 2017 -0700
Committer: Mingliang Liu <liuml07@apache.org>
Committed: Fri Mar 17 11:01:00 2017 -0700

----------------------------------------------------------------------
 .../oss/TestAliyunOSSFileSystemContract.java    | 35 +++-----------------
 1 file changed, 4 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/86035c16/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
b/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
index 3ebf507..69ce694 100644
--- a/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
+++ b/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
@@ -38,8 +38,8 @@ import java.io.IOException;
 public class TestAliyunOSSFileSystemContract
     extends FileSystemContractBaseTest {
   public static final String TEST_FS_OSS_NAME = "test.fs.oss.name";
-  private static String testRootPath =
-      AliyunOSSTestUtils.generateUniqueTestPath();
+  private static Path testRootPath =
+      new Path(AliyunOSSTestUtils.generateUniqueTestPath());
 
   @Override
   public void setUp() throws Exception {
@@ -49,20 +49,8 @@ public class TestAliyunOSSFileSystemContract
   }
 
   @Override
-  public void tearDown() throws Exception {
-    if (fs != null) {
-      fs.delete(super.path(testRootPath), true);
-    }
-    super.tearDown();
-  }
-
-  @Override
-  protected Path path(String path) {
-    if (path.startsWith("/")) {
-      return super.path(testRootPath + path);
-    } else {
-      return super.path(testRootPath + "/" + path);
-    }
+  public Path getTestBaseDir() {
+    return testRootPath;
   }
 
   @Override
@@ -228,19 +216,4 @@ public class TestAliyunOSSFileSystemContract
     }
   }
 
-  public void testWorkingDirectory() throws Exception {
-    Path workDir = super.path(this.getDefaultWorkingDirectory());
-    assertEquals(workDir, this.fs.getWorkingDirectory());
-    this.fs.setWorkingDirectory(super.path("."));
-    assertEquals(workDir, this.fs.getWorkingDirectory());
-    this.fs.setWorkingDirectory(super.path(".."));
-    assertEquals(workDir.getParent(), this.fs.getWorkingDirectory());
-    Path relativeDir = super.path("hadoop");
-    this.fs.setWorkingDirectory(relativeDir);
-    assertEquals(relativeDir, this.fs.getWorkingDirectory());
-    Path absoluteDir = super.path("/test/hadoop");
-    this.fs.setWorkingDirectory(absoluteDir);
-    assertEquals(absoluteDir, this.fs.getWorkingDirectory());
-  }
-
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message