Starts the container and configure it for testing {@link org.apache.click.Page} instances.
During configuration a full mock servlet stack is created consisting of:
- {@link org.apache.click.ClickServlet}
- {@link org.apache.click.servlet.MockRequest}
- {@link org.apache.click.servlet.MockResponse}
- {@link org.apache.click.servlet.MockServletContext}
- {@link org.apache.click.servlet.MockServletConfig}
- {@link org.apache.click.servlet.MockSession}
- {@link org.apache.click.MockContext}
You can provide your own Mock implementations and set them on the container using the appropriate
setter method for example: {@link #setRequest(org.apache.click.servlet.MockRequest)}.
Please note that you must set the mock objects on the container
before calling
start().
You also have full access to the mock objects after starting the container by using the appropriate
getter method for example: {@link #getRequest()}.
Below is an example of how to start the container:
public class TestPages extends junit.framework.TestCase { public void testAll() { String webApplicationDir = "c:/dev/app/web"; MockContainer container = new MockContainer(webApplicationDir); container.start(); ... container.stop(); } }
@see #stop()