Преглед на файлове

HDFS-913. Rename fault injection test TestRename.java to TestFiRename.java to include it in tests run by ant target run-test-hdfs-fault-inject. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@915080 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas преди 15 години
родител
ревизия
0daeb8e54a
променени са 2 файла, в които са добавени 10 реда и са изтрити 10 реда
  1. 7 7
      src/test/aop/org/apache/hadoop/fs/TestFiRename.java
  2. 3 3
      src/test/aop/org/apache/hadoop/hdfs/server/namenode/RenameAspects.aj

+ 7 - 7
src/test/aop/org/apache/hadoop/fs/TestFiRename.java

@@ -47,8 +47,8 @@ import org.junit.Test;
  * 
  * This test uses AspectJ to simulate failures.
  */
-public class TestRename {
-  private static final Log LOG = LogFactory.getLog(TestRename.class);
+public class TestFiRename {
+  private static final Log LOG = LogFactory.getLog(TestFiRename.class);
   private static String removeChild = "";
   private static String addChild = "";
   private static byte[] data = { 0 };
@@ -149,11 +149,11 @@ public class TestRename {
     createFile(src);
 
     // During rename, while removing src, an exception is thrown
-    TestRename.exceptionOnRemove(src.toString());
+    TestFiRename.exceptionOnRemove(src.toString());
     rename(src, dst, true, true, false, Rename.NONE);
 
     // During rename, while adding dst an exception is thrown
-    TestRename.exceptionOnAdd(dst.toString());
+    TestFiRename.exceptionOnAdd(dst.toString());
     rename(src, dst, true, true, false, Rename.NONE);
   }
 
@@ -166,15 +166,15 @@ public class TestRename {
     createFile(dst);
 
     // During rename, while removing src, an exception is thrown
-    TestRename.exceptionOnRemove(src.toString());
+    TestFiRename.exceptionOnRemove(src.toString());
     rename(src, dst, true, true, true, Rename.OVERWRITE);
 
     // During rename, while removing dst, an exception is thrown
-    TestRename.exceptionOnRemove(dst.toString());
+    TestFiRename.exceptionOnRemove(dst.toString());
     rename(src, dst, true, true, true, Rename.OVERWRITE);
 
     // During rename, while adding dst an exception is thrown
-    TestRename.exceptionOnAdd(dst.toString());
+    TestFiRename.exceptionOnAdd(dst.toString());
     rename(src, dst, true, true, true, Rename.OVERWRITE);
   }
 

+ 3 - 3
src/test/aop/org/apache/hadoop/hdfs/server/namenode/RenameAspects.aj

@@ -20,7 +20,7 @@ package org.apache.hadoop.hdfs.server.namenode;
 import org.apache.commons.logging.*;
 import org.apache.hadoop.hdfs.server.namenode.INode;
 import org.apache.hadoop.fs.Options.Rename;
-import org.apache.hadoop.fs.TestRename;
+import org.apache.hadoop.fs.TestFiRename;
 import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
 
 /**
@@ -41,7 +41,7 @@ public privileged aspect RenameAspects {
   before(INode[] inodes, int pos) throws RuntimeException :
     callRemove(inodes, pos) {
     LOG.info("FI: callRenameRemove");
-    if (TestRename.throwExceptionOnRemove(inodes[pos].getLocalName())) {
+    if (TestFiRename.throwExceptionOnRemove(inodes[pos].getLocalName())) {
       throw new RuntimeException("RenameAspects - on remove " + 
           inodes[pos].getLocalName());
     }
@@ -58,7 +58,7 @@ public privileged aspect RenameAspects {
       throws RuntimeException : 
       callAddChildNoQuotaCheck(inodes, pos, node, diskspace, flag) {
     LOG.info("FI: callAddChildNoQuotaCheck");
-    if (TestRename.throwExceptionOnAdd(inodes[pos].getLocalName())) {
+    if (TestFiRename.throwExceptionOnAdd(inodes[pos].getLocalName())) {
       throw new RuntimeException("RenameAspects on add " + 
           inodes[pos].getLocalName());
     }