Steve P Holmes

Greenhorn
+ Follow
since Aug 19, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Steve P Holmes

I figured out the problem. Turns out there was NOTHING wrong with my configuration and the tests were running fine. They were failing where they should have been there were some actual errors in the code.

But you could help me with something else. I can't seem to get the server side logging working. The client seems to be working fine but I'm getting:

log4j:WARN No appenders could be found for logger (org.apache.cactus.internal.server.ServerTestCaseCaller).
log4j:WARN Please initialize the log4j system properly.

I've got the logging_server.properties in the classes directory of WEB-INF on the server. Any thoughts?
20 years ago
Hopefully there are some experts there. I've been working on this for days and am so frustrated I'm about to quit. Currently it is failing within the action class and throwing an exception. Please let me know what additional info I can give to make this more clear. Here is my test case:

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("/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("/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();
}
}
20 years ago