| com.jcorporate.expresso.services.test.ControllerTestCase
All known Subclasses: com.jcorporate.expresso.services.controller.tests.DBSecurityMatrixTests, com.jcorporate.expresso.services.controller.tests.DBMaintTests, com.jcorporate.expresso.services.controller.tests.LoginControllerTest, com.jcorporate.expresso.services.controller.tests.RegistrationControllerTests,
ControllerTestCase | public class ControllerTestCase extends ServletTestCase (Code) | | Base class for testing controllers. Provides an integration with Expresso,
JUnit and Cactus
author: Michael Rimov version: $Revision: 1.17 $ $Date: 2004/11/17 20:48:22 $ |
Constructor Summary | |
public | ControllerTestCase(String testName, String controllerName) Instantiates the ControllerTestCase.
Parameters: testName - the name of the test. | public | ControllerTestCase(String testName, Class controllerClass) Instantiates a Controller Test Case
Parameters: testName - the name of the test. |
isInitialized | boolean isInitialized(Code) | | |
ControllerTestCase | public ControllerTestCase(String testName, String controllerName) throws Exception(Code) | | Instantiates the ControllerTestCase.
Parameters: testName - the name of the test. Usually handed down by the framework Parameters: controllerName - The classname of the controller that we're testing. throws: Exception - if something happens in the system initialization or potentiallyif the controller name passed doesn't map to a real class |
ControllerTestCase | public ControllerTestCase(String testName, Class controllerClass) throws Exception(Code) | | Instantiates a Controller Test Case
Parameters: testName - the name of the test. Usually handed down by the framework Parameters: controllerClass - The class of the controller to test |
buildControllerResponse | public ControllerResponse buildControllerResponse(Document d)(Code) | | Build a ControllerResponse given an XML DOM document
Parameters: d - The DOM document to parse. Root node must be controller-response |
buildControllerResponse | public ControllerResponse buildControllerResponse(WebResponse theConnection) throws Exception(Code) | | Takes the connection handed out by the framework in the endXXXX() methods
and builds a full Controller Response document out of it.
|
controllerProcess | public ControllerResponse controllerProcess() throws ServletException, IOException, Exception(Code) | | Run the target controller. Requires querying the struts framework to find
out the controller, runs the controller, and then forwards the results
to the XML servlet for formatting.
since: Expresso 3.1 |
getLog | protected Category getLog()(Code) | | returns a controller test case Log4j Category for your own easy logging
without having to do special initialization etc.
a log4j category that you can log to. |
getNodes | public NodeList getNodes(Document d, String xpath)(Code) | | Returns a DOM NodeList given the xpath expression and the document given.
Simply wrapper
|
logIn | public void logIn(WebRequest theRequest) throws Exception(Code) | | Uses the default setup that a blank database has the security of
Admin User = Admin
Admin Password = Blank
|
logIn | public void logIn(WebRequest theRequest, String userName, String password) throws Exception(Code) | | Allows special capabilities of logging in using a specially defined username
and password.
|
parseResponse | public Document parseResponse(WebResponse response) throws Exception(Code) | | parses the xml into an appropriate DOM document
|
setupParameters | public void setupParameters(String state, WebRequest request)(Code) | | Called to set the appropriate states for the controller Also makes sure
that parameters are set up so that the controller responds in unprocessed
XML, and not standard HTML
|
|
|