Author: tucu
Date: Wed Aug 8 15:43:26 2012
New Revision: 1370815
URL: http://svn.apache.org/viewvc?rev=1370815&view=rev
Log:
Merge -r 1370811:1370812 from trunk to branch. FIXES: HADOOP-8660
Modified:
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
Modified:
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java?rev=1370815&r1=1370814&r2=1370815&view=diff
==============================================================================
---
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java
(original)
+++
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java
Wed Aug 8 15:43:26 2012
@@ -13,6 +13,7 @@
*/
package org.apache.hadoop.security.authentication.client;
+import junit.framework.Assert;
import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
import junit.framework.TestCase;
import org.mockito.Mockito;
@@ -114,6 +115,18 @@ public abstract class AuthenticatorTestC
return "http://" + host + ":" + port + "/foo/bar";
}
+ private static class TestConnectionConfigurator
+ implements ConnectionConfigurator {
+ boolean invoked;
+
+ @Override
+ public HttpURLConnection configure(HttpURLConnection conn)
+ throws IOException {
+ invoked = true;
+ return conn;
+ }
+ }
+
private String POST = "test";
protected void _testAuthentication(Authenticator authenticator, boolean
doPost) throws Exception {
@@ -121,11 +134,10 @@ public abstract class AuthenticatorTestC
try {
URL url = new URL(getBaseURL());
AuthenticatedURL.Token token = new AuthenticatedURL.Token();
- ConnectionConfigurator connConf =
- Mockito.mock(ConnectionConfigurator.class);
+ TestConnectionConfigurator connConf = new TestConnectionConfigurator();
AuthenticatedURL aUrl = new AuthenticatedURL(authenticator, connConf);
HttpURLConnection conn = aUrl.openConnection(url, token);
- Mockito.verify(connConf).configure(Mockito.<HttpURLConnection>any());
+ Assert.assertTrue(connConf.invoked);
String tokenStr = token.toString();
if (doPost) {
conn.setRequestMethod("POST");
Modified:
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1370815&r1=1370814&r2=1370815&view=diff
==============================================================================
---
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
(original)
+++
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
Wed Aug 8 15:43:26 2012
@@ -208,6 +208,8 @@ Release 2.0.1-alpha - UNRELEASED
HADOOP-8405. ZKFC tests leak ZK instances. (todd)
+ HADOOP-8660. TestPseudoAuthenticator failing with NPE. (tucu)
+
Release 2.0.0-alpha - 05-23-2012
INCOMPATIBLE CHANGES