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