harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r491094 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/Authenticator.java test/java/tests/api/java/net/AuthenticatorTest.java
Date Fri, 29 Dec 2006 20:35:42 GMT
Author: tellison
Date: Fri Dec 29 12:35:41 2006
New Revision: 491094

URL: http://svn.apache.org/viewvc?view=rev&rev=491094
Log:
Apply patch HARMONY-2413 ([luni] java.net.Authenticator.getRequestorType returns null while
RI returns valid result)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/Authenticator.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/AuthenticatorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/Authenticator.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/Authenticator.java?view=diff&rev=491094&r1=491093&r2=491094
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/Authenticator.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/Authenticator.java
Fri Dec 29 12:35:41 2006
@@ -161,6 +161,7 @@
 		thisAuthenticator.protocol = rProtocol;
 		thisAuthenticator.prompt = rPrompt;
 		thisAuthenticator.scheme = rScheme;
+		thisAuthenticator.rt = RequestorType.SERVER;
 
 		// returns the authentication info obtained by the registered
 		// Authenticator
@@ -232,6 +233,7 @@
 		thisAuthenticator.protocol = rProtocol;
 		thisAuthenticator.prompt = rPrompt;
 		thisAuthenticator.scheme = rScheme;
+		thisAuthenticator.rt = RequestorType.SERVER;
 
 		// returns the authentication info obtained by the registered
 		// Authenticator

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/AuthenticatorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/AuthenticatorTest.java?view=diff&rev=491094&r1=491093&r2=491094
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/AuthenticatorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/AuthenticatorTest.java
Fri Dec 29 12:35:41 2006
@@ -61,7 +61,31 @@
         assertEquals(RequestorType.PROXY, rt[0]);
         assertEquals(RequestorType.SERVER, rt[1]);
     }
-    
+
+    /**
+     * @tests java.net.Authenticator#requestPasswordAuthentication(java.net.InetAddress,
int, String, String, String)
+     */
+    public void test_requestPasswordAuthentication_InetAddress_int_String_String_String()
throws Exception {
+        // Regression test for Harmony-2413
+        MockAuthenticator mock = new MockAuthenticator();
+        InetAddress addr = InetAddress.getLocalHost();
+        Authenticator.setDefault(mock);
+        Authenticator.requestPasswordAuthentication(addr, -1, "http", "promt", "HTTP");
+        assertEquals(mock.getRequestorType(), RequestorType.SERVER);
+    }
+
+    /**
+     * @tests java.net.Authenticator#requestPasswordAuthentication(String, java.net.InetAddress,
int, String, String, String)
+     */
+    public void test_requestPasswordAuthentication_String_InetAddress_int_String_String_String()
throws Exception {
+        // Regression test for Harmony-2413
+        MockAuthenticator mock = new MockAuthenticator();
+        InetAddress addr = InetAddress.getLocalHost();
+        Authenticator.setDefault(mock);
+        Authenticator.requestPasswordAuthentication("test_host", addr, -1, "http", "promt",
"HTTP");
+        assertEquals(mock.getRequestorType(), RequestorType.SERVER);
+    }
+
     /**
      * 
      * @tests java.net.Authenticator#



Mime
View raw message