commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsde...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestAuthenticator.java
Date Tue, 16 Jul 2002 12:41:16 GMT
jsdever     2002/07/16 05:41:16

  Modified:    httpclient/src/test/org/apache/commons/httpclient
                        TestAuthenticator.java
  Log:
  Fix the broken Authenticator test.
  
  Revision  Changes    Path
  1.8       +11 -11    jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestAuthenticator.java
  
  Index: TestAuthenticator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestAuthenticator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestAuthenticator.java	12 Jul 2002 06:03:25 -0000	1.7
  +++ TestAuthenticator.java	16 Jul 2002 12:41:16 -0000	1.8
  @@ -68,8 +68,8 @@
    * Unit tests for {@link Authenticator}.
    *
    * @author Rodney Waldhoff
  - * @version $Id$
    * @author <a href="mailto:jsdever@sympatico.ca">Jeff Dever</a>
  + * @version $Id$
    */
   public class TestAuthenticator extends TestCase {
   
  @@ -168,14 +168,14 @@
   
       public void testDigestAuthenticationScheme() throws Exception {
           HttpState state = new HttpState();
  -        state.setCredentials(null,new UsernamePasswordCredentials("username","password"));
  -        HttpMethod method = new SimpleHttpMethod(new Header("WWW-Authenticate","Digest
realm=\"realm1\""));
  -        try{
  -            assertTrue(Authenticator.authenticate(method, state));
  -            fail("Should have thrown UnsupportedOperationException");
  -        }catch (UnsupportedOperationException uoe){
  -            // expected
  +        state.setCredentials("realm1",new UsernamePasswordCredentials("username","password"));
  +        {
  +            HttpMethod method = new SimpleHttpMethod(new Header("WWW-Authenticate","Basic
realm=\"realm1\""));
  +            assertTrue(Authenticator.authenticate(method,state));
  +            assertTrue(null != method.getRequestHeader("Authorization"));
  +	    //TODO: test for correctness
           }
  + 
       }
   
       public void testInvalidAuthenticationScheme() throws Exception {
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message