Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 96152 invoked from network); 1 Aug 2003 13:10:50 -0000 Received: from web20301.mail.yahoo.com (216.136.226.82) by daedalus.apache.org with SMTP; 1 Aug 2003 13:10:50 -0000 Message-ID: <20030801131048.54116.qmail@web20301.mail.yahoo.com> Received: from [203.145.157.94] by web20301.mail.yahoo.com via HTTP; Fri, 01 Aug 2003 06:10:48 PDT Date: Fri, 1 Aug 2003 06:10:48 -0700 (PDT) From: karthik Guru Subject: Regarding BUG: 17933 (FormAuthentication assumes "localhost" when adding cookies ) To: Cactus Users List In-Reply-To: <1ED3B4E590425444A316A6404D1FEDCB176B39@EXSERVER.pisoftek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, This is regarding the bug listed here. http://issues.apache.org/bugzilla/show_bug.cgi?id=17933 I was trying to fix it . File: FormAuthentication.java Method: public void configure(WebRequest theRequest, Configuration theConfiguration); I guess i can get the context URL set in the cactus.properties file this way String contextURL = theConfiguration.getContextURL(); Now can i do a substring operation to extract the domain name from the context URL and call theRequest.addCookie(domainName,this.sessionIdCookieName, this.sessionId); I mean does cactus have some utility methods / something that knows how to extract the domain name properly from the contextURL? I just want to make sure that i'm doing the right thing in a right way. I guess we can also do webRequest.setURL() when using FormAuthentication; if that is the case, i guess , I can extract the domain/host name using ServletURL.getHost() So what s'd i be doing in the implementation FormAuthentication::configure()? 1. Do substring on contextURL OR 2. ServletURL.getHost() OR try doing 1) and if it fails do 2) Hope am not bugging the cactus commiters too much here. thanks, karthik --- Sachin wrote: > Hi All, > I am trying to write TestCase of example > Specified in StrutsTestCase > which says that we can use both CactusStrutsTestCase > or MockStrutsTestCase.. > > But when i am trying to run it it is giving error > like this.. > > > [main] INFO util.PropertyMessageResources - > Initializing, > config='org.apache.struts.util.LocalStrings', > returnNull=true > [main] INFO util.PropertyMessageResources - > Initializing, > config='org.apache.struts.action.ActionResources', > returnNull=true > > Time: 0.625 > There was 1 failure: > 1) > testAction(logic.struts.actions.TestFirstAction)junit.framework.AssertionFai > ledError: Error running action.perform(): class > java.lang.NullPointerException - null > at > servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java: > 339) > at > logic.struts.actions.TestFirstAction.testAction(TestFirstAction.java:47) > at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 > ) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl > .java:25) > at > com.intellij.rt.execution.junit.TextTestRunner.main(TextTestRunner.java:12) > > FAILURES!!! > Tests run: 1, Failures: 1, Errors: 0 > > Process terminated with exit code -1 > > > > > My Code is > > > package logic.struts.actions; > > import servletunit.struts.MockStrutsTestCase; > import servletunit.struts.CactusStrutsTestCase; > > import javax.servlet.ServletException; > > public class TestFirstAction extends > MockStrutsTestCase{ > > public TestFirstAction(String testName) { > super(testName); } > > public void testAction() { > setRequestPathInfo("/firstAction"); > actionPerform(); > verifyForward("second"); > } > > public void setUp() throws Exception { > super.setUp(); > } > > protected void tearDown() throws Exception { > super.tearDown(); > } > > } > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > cactus-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > cactus-user-help@jakarta.apache.org > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com