Hello.

Like Steve Erwin, I am grabbing the snake by the tail.  I checked out
fulcrum from cvs, installed maven, built a new fulcrum JAR with Henning's
proposal, got fulcrum running, and wrote a test for the SecurityService.
Everything works well until I try to use my custom User instead of DBUser, I
get a ClassCastException when I try to cast to my custom MpiDbUser.  For the
life of me, I can't figure out what in my custom class would cause it to not
be castable.  I have included the source for my custom user object, the
test, and my f.props.  I appreciate any suggestions you have.

I imagine that more info will be needed, so kindly let me know if you have
any questions.

Thanks!

Chris -- "Ahhh  CRIKEY!"


************ MpiDbUser.java ************
package com.mycompany.security;

import org.apache.fulcrum.security.impl.db.DBUser;
import com.mycompany.om.MpiUser;

public class MpiDbUser extends DBUser
{
  public int getActive()
  {
    return ((MpiUser) getPersistentObj()).getActive();
  }

  public void setActive(int arg)
  {
    ((MpiUser) getPersistentObj()).setActive(arg);
  }
}
************ /MpiDbUser.java ************

************ TurbineSecurityTest.java ************
public void testGetUser() throws Exception
{
  DBUser user = (DBUser)TurbineSecurity.getUser("testuser");
  assertNotNull("user-not-null",user);                 //PASSES
  assertEquals("Uname","testuser",user.getUserName()); //PASSES
  MpiDbUser user2 = (MpiDbUser)user;                   //ClassCastException
}
************ /TurbineSecurityTest.java ************

************ Fulcrum.properties ************
services.SecurityService.classname=org.apache.fulcrum.security.impl.db.DBSec
urityService
services.SecurityService.db.userPeer.class=com.getcountertops.om.MpiUserPeer
services.SecurityService.user.manager=org.apache.fulcrum.security.impl.db.DB
UserManager
services.SecurityService.secure.passwords=false
services.SecurityService.secure.passwords.algorithm=SHA
************ /Fulcrum.properties ************


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

Reply via email to