| Author |
getRemoteAddr
|
Rowan Chattaway
Ranch Hand
Joined: Jan 18, 2002
Posts: 75
|
|
Hello, I'm implementing the StrutsTestCase into my current project to provide a suite of JUnit tests for the core Struts actions. However, the ProcessLoginAction implements ipaddress checking for screening of dubious users. This uses HttpServletrequest.getRemoteAddr(). For my JUnit test - because it's run within my IDE and therefore outside the servlet container, this isn't set and returns null. Because of this the struts action forwards to failure. Obvioulsy I don't want to change to project code to suit the test. Can I set remoteAddr someway? or get around this? Any help would be much appreciated. Thanks.
|
The early bird may get the worm, but the second mouse gets the cheese.........<br /> <br />Sun Certified Programmer for Java 2 Platform<br />Sun Certified Web-Component Developer for J2EE Platform
|
 |
Nathaniel Stoddard
Ranch Hand
Joined: May 29, 2003
Posts: 1258
|
|
|
You can always decorate it yourself .. or use some mock object framework. Fun stuff.
|
Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
|
 |
 |
|
|
subject: getRemoteAddr
|
|
|