hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1066973 - in /hadoop/mapreduce/trunk: CHANGES.txt src/test/mapred/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java
Date Thu, 03 Feb 2011 21:11:59 GMT
Author: todd
Date: Thu Feb  3 21:11:58 2011
New Revision: 1066973

URL: http://svn.apache.org/viewvc?rev=1066973&view=rev
Log:
MAPREDUCE-2300. Fix TestUmbilicalProtocolWithJobToken on trunk after HADOOP-6904. Contributed
by Todd Lipcon

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1066973&r1=1066972&r2=1066973&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Thu Feb  3 21:11:58 2011
@@ -59,6 +59,9 @@ Trunk (unreleased changes)
 
     MAPREDUCE-2294. Fix compilation error in mumak. (todd)
 
+    MAPREDUCE-2300. Fix TestUmbilicalProtocolWithJobToken on trunk after
+    HADOOP-6904. (todd)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java?rev=1066973&r1=1066972&r2=1066973&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java
Thu Feb  3 21:11:58 2011
@@ -19,10 +19,12 @@
 package org.apache.hadoop.mapreduce.security;
 
 import static org.apache.hadoop.fs.CommonConfigurationKeys.HADOOP_SECURITY_AUTHENTICATION;
+import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyLong;
+import static org.mockito.Matchers.anyObject;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.doReturn;
 
 import java.net.InetSocketAddress;
 import java.security.PrivilegedExceptionAction;
@@ -36,6 +38,7 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.ipc.Client;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ipc.Server;
+import org.apache.hadoop.ipc.ProtocolSignature;
 import org.apache.hadoop.mapred.TaskUmbilicalProtocol;
 import org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier;
 import org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager;
@@ -74,8 +77,12 @@ public class TestUmbilicalProtocolWithJo
   @Test
   public void testJobTokenRpc() throws Exception {
     TaskUmbilicalProtocol mockTT = mock(TaskUmbilicalProtocol.class);
-    when(mockTT.getProtocolVersion(anyString(), anyLong())).thenReturn(
-        TaskUmbilicalProtocol.versionID);
+    doReturn(TaskUmbilicalProtocol.versionID)
+      .when(mockTT).getProtocolVersion(anyString(), anyLong());
+    doReturn(ProtocolSignature.getProtocolSignature(
+        mockTT, TaskUmbilicalProtocol.class.getName(),
+        TaskUmbilicalProtocol.versionID, 0))
+      .when(mockTT).getProtocolSignature(anyString(), anyLong(), anyInt());
 
     JobTokenSecretManager sm = new JobTokenSecretManager();
     final Server server = RPC.getServer(TaskUmbilicalProtocol.class, mockTT,



Mime
View raw message