hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1225472 - in /hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src: main/java/org/apache/hadoop/streaming/StreamJob.java test/java/org/apache/hadoop/streaming/TestStreamJob.java
Date Thu, 29 Dec 2011 08:24:42 GMT
Author: acmurthy
Date: Thu Dec 29 08:24:41 2011
New Revision: 1225472

URL: http://svn.apache.org/viewvc?rev=1225472&view=rev
Log:
Merge -c 1225471 from trunk to branch-0.23 to fix MAPREDUCE-3521.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java
    hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamJob.java

Modified: hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java?rev=1225472&r1=1225471&r2=1225472&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java
Thu Dec 29 08:24:41 2011
@@ -255,6 +255,13 @@ public class StreamJob implements Tool {
     }
 
     if (cmdLine != null) {
+      @SuppressWarnings("unchecked")
+      List<String> args = cmdLine.getArgList();
+      if(args != null && args.size() > 0) {
+        fail("Found " + args.size() + " unexpected arguments on the " +
+            "command line " + args);
+      }
+      
       detailedUsage_ = cmdLine.hasOption("info");
       if (cmdLine.hasOption("help") || detailedUsage_) {
         printUsage = true;

Modified: hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamJob.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamJob.java?rev=1225472&r1=1225471&r2=1225472&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamJob.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamJob.java
Thu Dec 29 08:24:41 2011
@@ -32,7 +32,18 @@ import static org.junit.Assert.*;
  * This class tests hadoop Streaming's StreamJob class.
  */
 public class TestStreamJob {
-
+  
+  @Test(expected = IllegalArgumentException.class)
+  public void testCreateJobWithExtraArgs() throws IOException {
+    ArrayList<String> dummyArgs = new ArrayList<String>();
+    dummyArgs.add("-input"); dummyArgs.add("dummy");
+    dummyArgs.add("-output"); dummyArgs.add("dummy");
+    dummyArgs.add("-mapper"); dummyArgs.add("dummy");
+    dummyArgs.add("dummy");
+    dummyArgs.add("-reducer"); dummyArgs.add("dummy");
+    StreamJob.createJob(dummyArgs.toArray(new String[] {}));
+  }
+  
   @Test
   public void testCreateJob() throws IOException {
     JobConf job;



Mime
View raw message