jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ger, Steven M." <s...@Z-TEL.com>
Subject Problems running tests from a browser using the host name.
Date Tue, 23 Mar 2004 13:56:39 GMT
Hi All,

I'm experiencing some odd behavior running the cactus tests from a web
browser.  

I have a web app that authenticates a user using standard J2EE web security.
A servlet Filter then intercepts the request and adds a user object to the
session.   My test case sets the authentication in the beginHasUser()
method, i.e.:

theRequest.setAuthentication(new FormAuthentication(testUser,
testPassword));

in the testHasUser() method all I look for is the actual user object.

assertNotNull("User object not found.",
request.getSession().getAttribute("user"));

This test works fine when "localhost" is used in the url.  For example:
http://localhost:7001/mywebapp/ServletTestRunner?suite=mytestcase

but when I use the hostname
http://mymachine:7001/mywebapp/ServletTestRunner?suite=mytestcase
the test fails because the user object is not found in the session.

Could someone tell me if there is a work around.  The test cases I need to
run are on a remote server so I'm hoping I'll still be able to use this
solution.

Thanks in advance,
  --Steven


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message