Hi Karthik,
           What about problem i have posted.Well Actually i have just start
learning on Cactus>now i am trying to do some practical work.test Which
Cactus Provide is working fine With browser.

but When For Struts We write a simple testCase..Why i amn getting Error.i am
sp desperate to know that where i am wrong??

Can any one Suggest..Where i am wrong Because i am not thinking That It is
such a big testCase..

Thanks
Sachin

-----Original Message-----
From: karthik Guru [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 6:41 PM
To: Cactus Users List
Subject: Regarding BUG: 17933 (FormAuthentication assumes "localhost"
when adding cookies )



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 <[EMAIL PROTECTED]> 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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to