hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1388722 - in /hadoop/common/branches/branch-1: CHANGES.txt src/test/org/apache/hadoop/hdfs/TestFileCreation.java
Date Fri, 21 Sep 2012 23:14:38 GMT
Author: suresh
Date: Fri Sep 21 23:14:38 2012
New Revision: 1388722

URL: http://svn.apache.org/viewvc?rev=1388722&view=rev
Log:
HDFS-3966. TestFileCreation should use JUnit4 to make assumeTrue work. Contributed by Jing
Zhao.

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/TestFileCreation.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1388722&r1=1388721&r2=1388722&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Fri Sep 21 23:14:38 2012
@@ -574,6 +574,9 @@ Release 1.1.0 - unreleased
     HDFS-3466. Get HTTP kerberos principal from the web authentication keytab.
     (omalley)
 
+    HDFS-3966. TestFileCreation should use JUnit4 to make assumeTrue work.
+    (Jing Zhao via suresh)
+
 Release 1.0.4 - Unreleased
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/TestFileCreation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/TestFileCreation.java?rev=1388722&r1=1388721&r2=1388722&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/TestFileCreation.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/TestFileCreation.java
Fri Sep 21 23:14:38 2012
@@ -47,14 +47,16 @@ import org.apache.hadoop.hdfs.server.nam
 import org.apache.hadoop.hdfs.server.namenode.LeaseManager;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.log4j.Level;
+import org.junit.Test;
 
 import static org.junit.Assume.assumeTrue;
+import static org.junit.Assert.*;
 
 /**
  * This class tests that a file need not be closed before its
  * data can be read by another client.
  */
-public class TestFileCreation extends junit.framework.TestCase {
+public class TestFileCreation {
   static final String DIR = "/" + TestFileCreation.class.getSimpleName() + "/";
 
   {
@@ -172,11 +174,13 @@ public class TestFileCreation extends ju
     stm.close();
   }
 
+  @Test
   public void testFileCreation() throws IOException {
     checkFileCreation(null, null);
   }
 
   /** Same test but the client should use DN hostname instead of IPs */
+  @Test
   public void testFileCreationByHostname() throws IOException {
     assumeTrue(System.getProperty("os.name").startsWith("Linux"));
 
@@ -188,6 +192,7 @@ public class TestFileCreation extends ju
   }
 
   /** Same test but the client should bind to a local interface */
+  @Test
   public void testFileCreationSetLocalInterface() throws IOException {
     assumeTrue(System.getProperty("os.name").startsWith("Linux"));
 
@@ -295,6 +300,7 @@ public class TestFileCreation extends ju
   /**
    * Test deleteOnExit
    */
+  @Test
   public void testDeleteOnExit() throws IOException {
     Configuration conf = new Configuration();
     if (simulatedStorage) {
@@ -357,6 +363,7 @@ public class TestFileCreation extends ju
   /**
    * Test file creation using createNonRecursive().
    */
+  @Test
   public void testFileCreationNonRecursive() throws IOException {
     Configuration conf = new Configuration();
     if (simulatedStorage) {
@@ -449,6 +456,7 @@ public class TestFileCreation extends ju
   /**
    * Test that file data does not become corrupted even in the face of errors.
    */
+  @Test
   public void testFileCreationError1() throws IOException {
     Configuration conf = new Configuration();
     conf.setInt("heartbeat.recheck.interval", 1000);
@@ -521,6 +529,7 @@ public class TestFileCreation extends ju
    * Test that the filesystem removes the last block from a file if its
    * lease expires.
    */
+  @Test
   public void testFileCreationError2() throws IOException {
     long leasePeriod = 1000;
     System.out.println("testFileCreationError2 start");
@@ -590,6 +599,7 @@ public class TestFileCreation extends ju
    * This test is currently not triggered because more HDFS work is 
    * is needed to handle persistent leases.
    */
+  //@Test
   public void xxxtestFileCreationNamenodeRestart() throws IOException {
     Configuration conf = new Configuration();
     final int MAX_IDLE_TIME = 2000; // 2s
@@ -731,6 +741,7 @@ public class TestFileCreation extends ju
   /**
    * Test that all open files are closed when client dies abnormally.
    */
+  @Test
   public void testDFSClientDeath() throws IOException, InterruptedException {
     Configuration conf = new Configuration();
     System.out.println("Testing adbornal client death.");
@@ -767,6 +778,7 @@ public class TestFileCreation extends ju
 /**
  * Test that file data becomes available before file is closed.
  */
+  @Test
   public void testFileCreationSimulated() throws IOException {
     simulatedStorage = true;
     testFileCreation();
@@ -776,6 +788,7 @@ public class TestFileCreation extends ju
   /**
    * Test creating two files at the same time. 
    */
+  @Test
   public void testConcurrentFileCreation() throws IOException {
     Configuration conf = new Configuration();
     MiniDFSCluster cluster = new MiniDFSCluster(conf, 1, true, null);
@@ -810,6 +823,7 @@ public class TestFileCreation extends ju
    * Then change lease period and wait for lease recovery.
    * Finally, read the block directly from each Datanode and verify the content.
    */
+  @Test
   public void testLeaseExpireHardLimit() throws Exception {
     System.out.println("testLeaseExpireHardLimit start");
     final long leasePeriod = 1000;
@@ -872,6 +886,7 @@ public class TestFileCreation extends ju
   }
 
   // test closing file system before all file handles are closed.
+  @Test
   public void testFsClose() throws Exception {
     System.out.println("test file system close start");
     final int DATANODE_NUM = 3;



Mime
View raw message