You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2016/05/09 17:36:43 UTC
[34/50] [abbrv] hadoop git commit: HADOOP-13051. Test for special
characters in path being respected during globPaths. Contributed by Harsh J.
HADOOP-13051. Test for special characters in path being respected during globPaths. Contributed by Harsh J.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d8faf47f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d8faf47f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d8faf47f
Branch: refs/heads/HDFS-1312
Commit: d8faf47f32c7ace6ceeb55bbb584c2dbab38902f
Parents: bb62e05
Author: Ravi Prakash <ra...@altiscale.com>
Authored: Thu May 5 14:17:38 2016 -0700
Committer: Ravi Prakash <ra...@altiscale.com>
Committed: Thu May 5 14:18:39 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/hadoop/fs/TestGlobPaths.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d8faf47f/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestGlobPaths.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestGlobPaths.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestGlobPaths.java
index 2803037..30778e6 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestGlobPaths.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestGlobPaths.java
@@ -88,6 +88,25 @@ public class TestGlobPaths {
}
}
+ /**
+ * Test case to ensure that globs work on files with special characters.
+ * Tests with a file pair where one has a \r at end and other does not.
+ */
+ @Test
+ public void testCRInPathGlob() throws IOException {
+ FileStatus[] statuses;
+ Path d1 = new Path(USER_DIR, "dir1");
+ Path fNormal = new Path(d1, "f1");
+ Path fWithCR = new Path(d1, "f1\r");
+ fs.mkdirs(d1);
+ fs.createNewFile(fNormal);
+ fs.createNewFile(fWithCR);
+ statuses = fs.globStatus(new Path(d1, "f1*"));
+ assertEquals("Expected both normal and CR-carrying files in result: ",
+ 2, statuses.length);
+ cleanupDFS();
+ }
+
@Test
public void testMultiGlob() throws IOException {
FileStatus[] status;
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org