jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Raible <m...@raibledesigns.com>
Subject Re: Login once using (FormAuthentication) for all tests in a class
Date Thu, 08 Jan 2004 14:11:45 GMT

On Jan 8, 2004, at 7:05 AM, Vincent Massol wrote:
>> So the question is - is it possible to combine the following 2 
>> methods?
>>
>>      public void begin(WebRequest request) {
>>          request.setRedirectorName("ServletRedirectorSecure");
>>          request.setAuthentication(new FormAuthentication(
>>                  login.getString("username"),
>>                  login.getString("encryptedPassword")));
>>      }
>>
>>      public void setUp() throws Exception {
>>          super.setUp();
>>
>>          conn = ServiceLocator.getConnection();
>>          // populate the userForm and place into session
>>          String username = login.getString("username");
>>          UserManager userMgr = new UserManagerImpl(conn);
>>          userForm = (UserForm) userMgr.getUser(username);
>>          session.setAttribute(Constants.USER_KEY, userForm);
>>      }
>>
>
> I don't think so. The begin method is used to connect to the server
> side, whereas the setup is used to set up server side objects. They are
> executed in different JVM (client and server side).
>
> Thanks
> -Vincent
>

Cool - just wanted to clarify I'm doing it right.  After using the 
begin() and setUp() - I seem to like that better, then I can override 
begin() as needed in subclass - for instance, to cancel form 
authentication with an empty method.

Thanks,

Matt


Mime
View raw message