portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/security TestUserManagement.java
Date Tue, 04 Jun 2002 06:34:53 GMT
taylor      2002/06/03 23:34:53

  Modified:    src/java/org/apache/jetspeed/om/security Tag: security_14
                        BaseJetspeedUser.java JetspeedUser.java
               src/java/org/apache/jetspeed/om/security/turbine Tag:
                        security_14 TurbineUserPeer.java
               src/java/org/apache/jetspeed/services/security Tag:
                        security_14 TestUserManagement.java
  Log:
  - TurbineUserManagement.getUser() implemented, interface unit test w
  - TurbineAuthentication.login() implemented, interface unit test
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +4 -7      jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/BaseJetspeedUser.java
  
  Index: BaseJetspeedUser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/BaseJetspeedUser.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- BaseJetspeedUser.java	30 May 2002 07:04:10 -0000	1.3.2.1
  +++ BaseJetspeedUser.java	4 Jun 2002 06:34:53 -0000	1.3.2.2
  @@ -79,7 +79,7 @@
    * for custom attributes). 
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: BaseJetspeedUser.java,v 1.3.2.1 2002/05/30 07:04:10 taylor Exp $
  + * @version $Id: BaseJetspeedUser.java,v 1.3.2.2 2002/06/04 06:34:53 taylor Exp $
    */
   public class BaseJetspeedUser extends SecurityObject implements JetspeedUser
   {
  @@ -94,9 +94,6 @@
       /** This is data that will not survive a servlet engine restart. */
       private Hashtable tempStorage = null;
   
  -    public static final String DISABLED = "DISABLED";
  -    public static final String USER_ID = "USER_ID";
  -
       /**
        * Constructor.
        * Create a new User and set the createDate.
  @@ -121,7 +118,7 @@
           String tmp = null;
           try
           {
  -            tmp = (String) getPerm (USER_ID);
  +            tmp = (String) getPerm (JetspeedUser.USER_ID);
               if ( tmp.length() == 0 )
               {
                   tmp = null;
  @@ -721,7 +718,7 @@
           boolean disabled = false;
           try
           {
  -            String tmp = (String) getPerm (DISABLED);
  +            String tmp = (String) getPerm (JetspeedUser.DISABLED);
               if ( tmp != null && tmp.length() > 0 )
               {
                   if (tmp.equalsIgnoreCase("T"))
  @@ -736,7 +733,7 @@
   
       public void setDisabled(boolean disabled)
       {
  -        setPerm(DISABLED, (disabled) ? "T" : "F");
  +        setPerm(JetspeedUser.DISABLED, (disabled) ? "T" : "F");
       }
   
   }
  
  
  
  1.1.2.2   +4 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/JetspeedUser.java
  
  Index: JetspeedUser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/JetspeedUser.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- JetspeedUser.java	30 May 2002 07:04:10 -0000	1.1.2.1
  +++ JetspeedUser.java	4 Jun 2002 06:34:53 -0000	1.1.2.2
  @@ -60,10 +60,13 @@
    * A Jetspeed extension of the Turbine User interface.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: JetspeedUser.java,v 1.1.2.1 2002/05/30 07:04:10 taylor Exp $
  + * @version $Id: JetspeedUser.java,v 1.1.2.2 2002/06/04 06:34:53 taylor Exp $
    */
   public interface JetspeedUser extends User
   {
  +    public static final String DISABLED = "DISABLED";
  +    public static final String USER_ID = "USER_ID";
  +
       /**
        * Returns the disabled status for the user
        *
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +5 -8      jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/turbine/Attic/TurbineUserPeer.java
  
  Index: TurbineUserPeer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/turbine/Attic/TurbineUserPeer.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- TurbineUserPeer.java	4 Jun 2002 06:05:37 -0000	1.1.2.1
  +++ TurbineUserPeer.java	4 Jun 2002 06:34:53 -0000	1.1.2.2
  @@ -171,7 +171,6 @@
       protected static void populateUserObject(Record row, int offset, JetspeedUser user)
           throws Exception
       {
  -        System.out.println("$$$ populating user now");
           // Set values are where columns are expected.  They are not
           // required to be in these positions, as we set the positions
           // immediately following.
  @@ -183,9 +182,6 @@
                   objectDataPosition = i+1;
           }
   
  -        //user.setPrimaryKey( 
  -        //    new NumberKey(row.getValue(idPosition).asBigDecimal()) );
  -
           // Restore the Permanent Storage Hashtable.  First the
           // Hashtable is restored, then any explicit table columns
           // which should be included in the Hashtable are added.
  @@ -198,10 +194,7 @@
   
           for( int j=0; j<columnNames.length; j++ )
           {
  -            System.out.println("$$$ j = " + columnNames[j]);
  -
               if (! columnNames[j].equalsIgnoreCase( TURBINE_OBJECTDATA ) )
  -
               {
                   Object obj2 = null;
                   Value value = row.getValue(j+1);
  @@ -236,7 +229,11 @@
   
                   if ( obj2 != null )
                   {
  -                    System.out.println("$$$ putting obj2 = " + obj2);
  +                    if (columnNames[j].equalsIgnoreCase( JetspeedUser.USER_ID ))
  +                    {
  +                        obj2 = value.toString();
  +                    }
  +
                       tempHash.put( columnNames[j], obj2 );
                   }
               }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +10 -4     jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/Attic/TestUserManagement.java
  
  Index: TestUserManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/Attic/TestUserManagement.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- TestUserManagement.java	4 Jun 2002 04:52:29 -0000	1.1.2.1
  +++ TestUserManagement.java	4 Jun 2002 06:34:53 -0000	1.1.2.2
  @@ -78,7 +78,7 @@
    * Unit test for UserManagement interface
    * 
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: TestUserManagement.java,v 1.1.2.1 2002/06/04 04:52:29 taylor Exp $
  + * @version $Id: TestUserManagement.java,v 1.1.2.2 2002/06/04 06:34:53 taylor Exp $
    */
   
   public class TestUserManagement extends TestCase {    
  @@ -151,10 +151,16 @@
           }
           catch (Exception e)
           {
  -            System.out.println("exception = " + e.toString());
  -            e.printStackTrace();
  -            assertTrue(e instanceof FailedLoginException);
  +            fail(StringUtils.stackTrace(e));
           }
  +
  +        assertTrue(user.getUserId().equals("0"));
  +        assertTrue(user.getUserName().equals("turbine"));
  +        assertTrue(user.getFirstName().equals("Tommy"));
  +        assertTrue(user.getLastName().equals("Turbine"));
  +        assertTrue(user.getEmail().equals("david@bluesunrise.com"));
  +        assertTrue(user.getConfirmed().equals("CONFIRMED"));
  +        assertTrue(user.getDisabled() == false);
   
           System.out.println("Completed getUser Test OK for Turbine");
   
  
  
  

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


Mime
View raw message