Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set userProfile info in WebApp

 
Ray Lim
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For testing purposes, I want to create a servlet or JSP to simulate that my session is of a logged-in user.
In a sense by running the servlet/jsp, it would log my session in and setup the
session.getId()
request.getRemoteUser()
request.getUserPrincipal()
roles for the request.isUserInRole(role) check
Sort of like an auto-login.... Is this possible?
ps. I am already using form-based authentication against an LDAP in Tomcat 4.
[ February 04, 2002: Message edited by: Ray Lim ]
[ February 04, 2002: Message edited by: Ray Lim ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that for testing purposes you would be much safer writing an automated client that makes a URL connection and simulates a browser. Thats the only way to get a real request object.
Bill
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, write a wget script.

there is also testing software out there (one example is by www.mercuryinteractive.com ) that allows you to record web-site interactions, and then run them back as a test.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe Cactus from the Jakarta Project (http://jakarta.apache.org) is supposed to extend the JTest platform to server testing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic