hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r663841 - in /hadoop/core/trunk: CHANGES.txt src/test/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
Date Fri, 06 Jun 2008 06:59:31 GMT
Author: ddas
Date: Thu Jun  5 23:59:31 2008
New Revision: 663841

URL: http://svn.apache.org/viewvc?rev=663841&view=rev
Log:
HADOOP-3240. Fix a testcase to not create files in the current directory. Instead the file
is created in the test directory. Contributed by Mahadev Konar.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=663841&r1=663840&r2=663841&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Jun  5 23:59:31 2008
@@ -483,6 +483,9 @@
     HADOOP-3455. Fix NPE in ipc.Client in case of connection failure and
     improve its synchronization. (hairong)
 
+    HADOOP-3240. Fix a testcase to not create files in the current directory.
+    Instead the file is created in the test directory (Mahadev Konar via ddas)
+
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java?rev=663841&r1=663840&r2=663841&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
(original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
Thu Jun  5 23:59:31 2008
@@ -38,6 +38,7 @@
   // params 
   static final Path input = new Path("/test/input/");
   static final Path output = new Path("/test/output");
+  File buildDir = new File(System.getProperty("test.build.data", "/tmp"));
   public void testJobShell() throws Exception {
     MiniDFSCluster dfs = null;
     MiniMRCluster mr = null;
@@ -52,13 +53,15 @@
       stream.write("teststring".getBytes());
       stream.close();
       mr = new MiniMRCluster(2, fs.getUri().toString(), 1);
-      File f = new File("files_tmp");
+      File thisbuildDir = new File(buildDir, "jobCommand");
+      assertTrue("create build dir", thisbuildDir.mkdirs()); 
+      File f = new File(thisbuildDir, "files_tmp");
       FileOutputStream fstream = new FileOutputStream(f);
       fstream.write("somestrings".getBytes());
       fstream.close();
       String[] args = new String[6];
       args[0] = "-files";
-      args[1] = "files_tmp";
+      args[1] = f.toString();
       args[2] = "-libjars";
       // the testjob.jar as a temporary jar file 
       // rather than creating its own
@@ -68,6 +71,8 @@
       int ret = ToolRunner.run(mr.createJobConf(),
                                new testshell.ExternalMapReduce(), args);
       assertTrue("not failed ", ret != -1);
+      f.delete();
+      thisbuildDir.delete();
     } finally {
       if (dfs != null) {dfs.shutdown();};
       if (mr != null) {mr.shutdown();};



Mime
View raw message