It is apparently throwing a global exception being caught by the
struts-config global exception.
Here is the output of my junit test:
log4j:WARN No appenders could be found for logger
(org.apache.cactus.internal.server.ServerTestCaseCaller).
log4j:WARN Please initialize the log4j system properly.
org.apache.cactus.internal.client.AssertionFailedErrorWrapper: Method
names in Form Bean is null
junit.framework.AssertionFailedError: Method names in Form Bean is
null
at
gov.wapa.snr.pbs.actionTests.TestTypeTablesAction.testNoTypeTable(TestTypeTablesAction.java:49)
Process finished with exit code -1
org.apache.cactus.internal.client.AssertionFailedErrorWrapper: Method
names in Form Bean is null
junit.framework.AssertionFailedError: Method names in Form Bean is
null
at
gov.wapa.snr.pbs.actionTests.TestTypeTablesAction.testWithTypeTable(TestTypeTablesAction.java:75)
etc...
My Test Class:
package gov.wapa.snr.pbs.actionTests;
import servletunit.struts.CactusStrutsTestCase;
import gov.wapa.snr.pbs.actionForms.TypeTablesForm;
import java.util.ArrayList;
import org.apache.cactus.client.authentication.FormAuthentication;
import org.apache.cactus.WebRequest;
/**
* User: Holmes
* Date: Aug 13, 2004
* Time: 12:26:48 PM
* All software and source code property of WAPA/DOE
*/
public class TestTypeTablesAction extends CactusStrutsTestCase {
public void beginFormAuthentication(WebRequest theRequest) throws
Exception {
theRequest.setAuthentication(new FormAuthentication("weblogic",
"weblogic"));
}
public void testFormAuthentication() {
assertEquals("weblogic", request.getUserPrincipal().getName());
assertEquals("weblogic", request.getRemoteUser());
assertTrue("User not in 'PBSadmin' role",
request.isUserInRole("PBSadmin"));
}
public void beginNoTypeTable(WebRequest theRequest) {
theRequest.setAuthentication(new FormAuthentication("weblogic",
"weblogic"));
theRequest.addParameter("Menu2Load", "TabbedHome");
theRequest.addParameter("menuSelected2", "-1");
theRequest.addParameter("menuSelected", "3");
}
public void testNoTypeTable() {
/*setRequestPathInfo("/welcome.do");
actionPerform();*/
setConfigFile("/WEB-INF/struts-config.xml");
setRequestPathInfo("/ui/systemTables_other.do");
actionPerform();
System.out.println("Actual forward in NoTypeTable: "
+getActualForward());
TypeTablesForm form = (TypeTablesForm) getActionForm();
assertNotNull("typeTablesForm is null", form);
ArrayList methodNames = form.getSystemDelegateMethodNames();
assertNotNull("Method names in Form Bean is null", methodNames);
verifyTilesForward("failure", "systemTables_other");
verifyNoActionErrors();
}
public void beginWithTypeTable(WebRequest theRequest) {
theRequest.setAuthentication(new FormAuthentication("weblogic",
"weblogic"));
theRequest.addParameter("Menu2Load", "TabbedHome");
theRequest.addParameter("menuSelected2", "-1");
theRequest.addParameter("menuSelected", "3");
}
public void testWithTypeTable() {
setConfigFile("/WEB-INF/struts-config.xml");
setRequestPathInfo("/ui/systemTables_other.do");
addRequestParameter("typeTable", "AddressTypes");
actionPerform();
System.out.println("Actual forward in WithTypeTable: "
+getActualForward());
TypeTablesForm form = (TypeTablesForm) getActionForm();;
assertNotNull("typeTablesForm is null", form);
ArrayList methodNames = form.getSystemDelegateMethodNames();
assertNotNull("Method names in Form Bean is null", methodNames);
assertNotNull("typeTable is Null", form.getTypeTable());
assertNotNull("getAlign is Null", form.getAlign());
assertNotNull("ColumnNameOne is null", form.getColumnNameOne());
assertNotNull("columnNameTwo is null", form.getColumnNameTwo());
assertNotNull("columnOne is null", form.getColumnOne());
assertNotNull("columnTwo is null", form.getColumnTwo());
assertNotNull("tableType is null", form.getTypeTable());
verifyTilesForward("success", "systemTables_other");
verifyNoActionErrors();
}
}
Please let me know if you have any thoughts at all
-Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]