ate         2004/10/19 14:12:58

  Modified:    components/security/src/test/org/apache/jetspeed/security/spi
                        TestCredentialHandler.java
  Log:
  Fixed testcase which was trying to add an additional PasswordCredential (by 
specifying a non-existing 'old' password).
  This 'feature' I removed a few days ago from DefaultCredentialHandler because I 
don't think it logical to allow more than one (valid) PasswordCredential.
  Multiply credentials of different type are still allowed of course (although we 
don't support anything other than PasswordCredentials right now).
  
  Revision  Changes    Path
  1.2       +6 -4      
jakarta-jetspeed-2/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java
  
  Index: TestCredentialHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestCredentialHandler.java        18 Sep 2004 19:35:08 -0000      1.1
  +++ TestCredentialHandler.java        19 Oct 2004 21:12:58 -0000      1.2
  @@ -49,7 +49,9 @@
        */
       protected void setUp() throws Exception
       {
  -        super.setUp();
  +        super.setUp(); 
  +        // cleanup for previously failed test
  +        destroyUser();
       }
   
       /**
  @@ -124,12 +126,12 @@
           assertEquals("newpassword", new String(pwdCreds[0].getPassword()));
           // Add password credential.
           oldPwdCred = null;
  -        newPwdCred = new PasswordCredential("testcred", 
("anotherpassword").toCharArray());
  -        ch.setPrivatePasswordCredential(oldPwdCred, newPwdCred);
  +        PasswordCredential anotherPwdCred = new PasswordCredential("testcred", 
("anotherpassword").toCharArray());
  +        ch.setPrivatePasswordCredential(newPwdCred, anotherPwdCred);
           // Test that the credential was properly set.
           privateCredentials = ch.getPrivateCredentials("testcred");
           assertNotNull(privateCredentials);
  -        assertEquals(2, privateCredentials.size());
  +        assertEquals(1, privateCredentials.size());
           destroyUser();
       }
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to