portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/security/src/test/org/apache/jetspeed/security/spi TestUserSecurityHandler.java
Date Tue, 12 Oct 2004 20:20:36 GMT
weaver      2004/10/12 13:20:36

  Modified:    components/security/src/test/org/apache/jetspeed/security/spi
                        TestUserSecurityHandler.java
  Log:
  We cannot expect the principals in any specific order.  Doing so causes failures in non-HSQL
environments such as MySQL.
  
  Revision  Changes    Path
  1.4       +12 -10    jakarta-jetspeed-2/components/security/src/test/org/apache/jetspeed/security/spi/TestUserSecurityHandler.java
  
  Index: TestUserSecurityHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/test/org/apache/jetspeed/security/spi/TestUserSecurityHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestUserSecurityHandler.java	11 Oct 2004 23:25:29 -0000	1.3
  +++ TestUserSecurityHandler.java	12 Oct 2004 20:20:36 -0000	1.4
  @@ -95,22 +95,24 @@
       public void testGetUserPrincipals() throws Exception
       {
           Iterator principals = ush.getUserPrincipals("").iterator();
  -        int count = 0;
  +        boolean foundUser1 =false;
  +        boolean foundUser2 =false;
  +        
           while (principals.hasNext())
           {
               Principal principal = (Principal) principals.next();
  -            if (0 == count)
  -            {
  -                assertNotNull(principal);
  -                assertEquals("testuser1", principal.getName());
  +            assertNotNull(principal);
  +            
  +            if (principal.getName().equals("testuser1"))
  +            {                
  +                foundUser1 = true;
               }
  -            else if (1 == count)
  +            else if (principal.getName().equals("testuser2"))
               {
  -                assertNotNull(principal);
  -                assertEquals("testuser2", principal.getName());
  -            }
  -            count ++;
  +               foundUser2 = true;
  +            }            
           }
  +        assertTrue(foundUser1 && foundUser2);
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message