// login with a user that has the RegularUser role.
this.login("UserA", "PassA".toCharArray());
// get a reference to the remote protected stateless session bean.
Object obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
SimpleSession session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);
Principal principal = null;
try
{
principal = session.invokeRegularMethod();
if (!(principal instanceof EJB3CustomPrincipalImpl))
fail("Custom principal is not the caller principal");
}
catch (EJBAccessException eae)
{