hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077258 - /hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestFileStatus.java
Date Fri, 04 Mar 2011 03:57:09 GMT
Author: omalley
Date: Fri Mar  4 03:57:09 2011
New Revision: 1077258

URL: http://svn.apache.org/viewvc?rev=1077258&view=rev
Log:
commit ef621a7765324c40c04d996a8779064c4395278c
Author: Hairong Kuang <hairong@ucdev21.inktomisearch.com>
Date:   Mon Mar 1 19:18:36 2010 +0000

    HDFS:985 from http://issues.apache.org/jira/secure/attachment/12437499/testFileStatus.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestFileStatus.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestFileStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestFileStatus.java?rev=1077258&r1=1077257&r2=1077258&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestFileStatus.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestFileStatus.java
Fri Mar  4 03:57:09 2011
@@ -18,6 +18,8 @@
 package org.apache.hadoop.hdfs;
 
 import junit.framework.TestCase;
+
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Random;
 
@@ -126,8 +128,12 @@ public class TestFileStatus extends Test
       // test listStatus on a non-existent file/directory
       stats = fs.listStatus(dir);
       assertEquals(null, stats);
-      status = fs.getFileStatus(dir);
-      assertEquals(null, status);
+      try {
+        status = fs.getFileStatus(dir);
+        fail("getFileStatus of non-existent path should fail");
+      } catch (FileNotFoundException fe) {
+        assertTrue(fe.getMessage().startsWith("File does not exist"));
+      }
       
       // create the directory
       assertTrue(fs.mkdirs(dir));



Mime
View raw message