we're trying to test Struts actions with the StrutsTestCase package integrated into Cactus. All actions depend on a login, or more specific, parameters loaded after a successful login. our idea was to use a base class which stores a FormAuthentication object for all the test cases. We are using Websphere 5.0, struts 1.1, J2EE spec 1.3
Our problems seem to be similar to the one described in a previous mail of this list (no 04940):
when trying the tests depicted further below, we get the following error messages:
org.apache.cactus.util.ChainedRuntimeException: Failed to authenticate the principal
at org.apache.cactus.client.authentication.FormAuthentication.authenticate_aroundBody6(FormAuthentication.java:314)
at org.apache.cactus.client.authentication.FormAuthentication.authenticate_aroundBody7$advice(FormAuthentication.java:151)
at org.apache.cactus.client.authentication.FormAuthentication.authenticate(FormAuthentication.java)
at org.apache.cactus.client.authentication.FormAuthentication.configure_aroundBody0(FormAuthentication.java:155)
at org.apache.cactus.client.authentication.FormAuthentication.configure_aroundBody1$advice(FormAuthentication.java:151)
at org.apache.cactus.client.authentication.FormAuthentication.configure(FormAuthentication.java)
--- snip ---
java.lang.NullPointerException: missing cookie name
at org.apache.cactus.Cookie.<init>(Cookie.java:132)
at org.apache.cactus.BaseWebRequest.addCookie_aroundBody20(BaseWebRequest.java:421)
at org.apache.cactus.BaseWebRequest.addCookie_aroundBody21$advice(BaseWebRequest.java:151)
at org.apache.cactus.BaseWebRequest.addCookie(BaseWebRequest.java)
at org.apache.cactus.BaseWebRequest.addCookie_aroundBody18(BaseWebRequest.java:403)
at org.apache.cactus.BaseWebRequest.addCookie_aroundBody19$advice(BaseWebRequest.java:151)
at org.apache.cactus.BaseWebRequest.addCookie(BaseWebRequest.java)
at org.apache.cactus.client.authentication.FormAuthentication.authenticate_aroundBody6(FormAuthentication.java:292)
---
we are using a base test case, which is a subclass of servletunit.struts.CactusStrutsTestCase, which doesn't do much:
public class BaseStrutsTestCase extends CactusStrutsTestCase {
private FormAuthentication formAuthentication;
public void begin(WebRequest request) {
if(formAuthentication == null) {
formAuthentication = new FormAuthentication("ue05515", "nwm");
}
request.setRedirectorName("ServletRedirectorSecure");
request.setAuthentication(formAuthentication);
}
}The actual test case looks like this:
public class RevisionenVerwaltenInitTest extends BaseStrutsTestCase {
public void testSomeAction() {
setRequestPathInfo("/test/testAction");
actionPerform();
verifyForward("success");
....
}
}All entries in the web.xml file are identical to the ones described in the cactus documentation.
Thanks in advance for any help...
kind regards,
thorsten frank
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
