Browse Source

HADOOP-3904. Fix unit tests using the old dfs package name. (TszWo (Nicholas), SZE via johan)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@683642 13f79535-47bb-0310-9956-ffa450edef68
Johan Oskarsson 17 years ago
parent
commit
63be39f6c1

+ 3 - 0
CHANGES.txt

@@ -234,6 +234,9 @@ Trunk (unreleased changes)
 
     HADOOP-3846. Fix unit test CreateEditsLog to generate paths correctly. 
     (Lohit Vjayarenu via cdouglas)
+    
+    HADOOP-3904. Fix unit tests using the old dfs package name.
+    (TszWo (Nicholas), SZE via johan)
 
 Release 0.18.0 - Unreleased
 

+ 4 - 4
src/test/org/apache/hadoop/hdfs/ClusterTestDFS.java

@@ -75,8 +75,7 @@ import java.lang.reflect.InvocationTargetException;
  * (HadoopFS level) test {@link org.apache.hadoop.fs.TestFileSystem}.
  */
 public class ClusterTestDFS extends TestCase implements FSConstants {
-  private static final Log LOG =
-    LogFactory.getLog("org.apache.hadoop.hdfs.ClusterTestDFS");
+  private static final Log LOG = LogFactory.getLog(ClusterTestDFS.class);
 
   private static Configuration conf = new Configuration();
   private static int BUFFER_SIZE =
@@ -520,12 +519,13 @@ public class ClusterTestDFS extends TestCase implements FSConstants {
   }
 
   public static void main(String[] args) throws Exception {
-    String usage = "Usage: ClusterTestDFS (no args)";
+    String classname = ClusterTestDFS.class.getClass().getName();
+    String usage = "Usage: " + classname + " (no args)";
     if (args.length != 0) {
       System.err.println(usage);
       System.exit(-1);
     }
-    String[] testargs = {"org.apache.hadoop.dfs.ClusterTestDFS"};
+    String[] testargs = {classname};
     junit.textui.TestRunner.main(testargs);
   }
 

+ 4 - 4
src/test/org/apache/hadoop/hdfs/ClusterTestDFSNamespaceLogging.java

@@ -45,8 +45,7 @@ import java.util.ArrayList;
  * make sure that any namespace mutations are logged.
  */
 public class ClusterTestDFSNamespaceLogging extends TestCase implements FSConstants {
-  private static final Log LOG =
-    LogFactory.getLog("org.apache.hadoop.hdfs.ClusterTestDFS");
+  private static final Log LOG = LogFactory.getLog(ClusterTestDFS.class);
 
   private static Configuration conf = new Configuration();
 
@@ -455,12 +454,13 @@ public class ClusterTestDFSNamespaceLogging extends TestCase implements FSConsta
   }
 
   public static void main(String[] args) throws Exception {
-    String usage = "Usage: ClusterTestDFSNameSpaceChangeLogging (no args)";
+    String classname = ClusterTestDFSNamespaceLogging.class.getClass().getName();
+    String usage = "Usage: " + classname + " (no args)";
     if (args.length != 0) {
       System.err.println(usage);
       System.exit(-1);
     }
-    String[] testargs = {"org.apache.hadoop.dfs.ClusterTestDFSNameSpaceChangeLogging"};
+    String[] testargs = {classname};
     junit.textui.TestRunner.main(testargs);
   }
 

+ 1 - 2
src/test/org/apache/hadoop/hdfs/server/common/TestDistributedUpgrade.java

@@ -36,8 +36,7 @@ import org.apache.hadoop.hdfs.tools.DFSAdmin;
 /**
  */
 public class TestDistributedUpgrade extends TestCase {
-  private static final Log LOG = LogFactory.getLog(
-                             "org.apache.hadoop.dfs.TestDistributedUpgrade");
+  private static final Log LOG = LogFactory.getLog(TestDistributedUpgrade.class);
   private Configuration conf;
   private int testCounter = 0;
   private MiniDFSCluster cluster = null;