Index: src/main/java/java/net/Authenticator.java =================================================================== --- src/main/java/java/net/Authenticator.java (revision 490975) +++ src/main/java/java/net/Authenticator.java (working copy) @@ -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 Index: src/test/java/tests/api/java/net/AuthenticatorTest.java =================================================================== --- src/test/java/tests/api/java/net/AuthenticatorTest.java (revision 490975) +++ src/test/java/tests/api/java/net/AuthenticatorTest.java (working copy) @@ -61,8 +61,32 @@ 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# * requestPasswordAuthentication_String_InetAddress_int_String_String_String_URL_Authenticator_RequestorType()