JUnit doubt when action extends BaseDispatchAction and BaseLookupDispatchAction.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nivan_Anar
Posted On:   Thursday, December 16, 2004 06:26 PM

Hi , I am running into one peculiar error and I guess this should be soemthing some of you could spot right away. I have three test methods namely 1. testSetup, 2. testSubmit and 3. testApply. When I run my Test class, the control correctly flows from one method to the next for all methods that start with the word 'test' but they all seem to enter the method named "unspecified" in my Action file which always point to the setup() method. I have correctly used the "addRequestParameter(PARAM_DISPATCH_METHOD, METHOD_SETUP);" function in all my test methods too!! The problem I just defined occurs only because my Act   More>>


Hi ,
I am running into one peculiar error and I guess this
should be soemthing some of you could spot right away.
I have three test methods namely
1. testSetup,
2. testSubmit and
3. testApply.

When I run my Test class, the control correctly flows
from one method to the next for all methods that start with
the word 'test' but they all seem to enter the method named
"unspecified" in my Action file which always point to the setup() method.


I have correctly used the
"addRequestParameter(PARAM_DISPATCH_METHOD, METHOD_SETUP);"
function in all my test methods too!!

The problem I just defined occurs only because my Action extends BaseLookupDispatchAction.

If I make my Action extends BaseDispatchAction, then my test runs through fine and it enters all the methods in order!!!

Is there some variation for these two cases?


Any clues??



Thanks ,
Nivan.    <<Less

Re: JUnit doubt when action extends BaseDispatchAction and BaseLookupDispatchAction.

Posted By:   Anonymous  
Posted On:   Saturday, January 8, 2005 05:14 PM

Yes. There is some difference b/n LookupDispatchAction and DispatchAction.

With "DispatchAction" you would pass the name of the dispath method as a request parameter; where as with the "LookupDispathAction" you would have to pass in the value which comes from the properties file for the corresponding button's key

For more info look at http://struts.apache.org/api/org/apache/struts/actions/LookupDispatchAction.html
About | Sitemap | Contact