/** * Prepares an <code>ActionMapping</code>. If your actions rely * on a custom subclass of <code>ActionMapping</code>, use this * method to prepare it. Since {@link com.mockrunner.struts.ActionTestModule} * relies on the behaviour of {@link com.mockrunner.mock.web.MockActionMapping}, * this method creates a subclass CGLib proxy of the specified mapping class. * You can cast the returned <code>ActionMapping</code> to your custom * mapping class and the subclass proxy will redirect the necessary * methods to the {@link com.mockrunner.mock.web.MockActionMapping}. * Redirected are methods for retrieving forwards. If an <code>ActionMapping</code> * is prepared, {@link #getActionMapping} returns the prepared mapping while * {@link #getMockActionMapping} returns the the underlying {@link com.mockrunner.mock.web.MockActionMapping}. * This method relies on CGLib. CGLib is not required by the Struts test framework * if this method is not used. * @param mappingClass the class of the custom action mapping * @return an instance of the custom action mapping class */ public ActionMapping prepareActionMapping(Class mappingClass) { ActionMappingProxyGenerator generator = new ActionMappingProxyGenerator(mockMapping); mapping = generator.createActionMappingProxy(mappingClass); refresh(); return mapping; }
/** * Prepares an <code>ActionMapping</code>. If your actions rely * on a custom subclass of <code>ActionMapping</code>, use this * method to prepare it. Since {@link com.mockrunner.struts.ActionTestModule} * relies on the behaviour of {@link com.mockrunner.mock.web.MockActionMapping}, * this method creates a subclass CGLib proxy of the specified mapping class. * You can cast the returned <code>ActionMapping</code> to your custom * mapping class and the subclass proxy will redirect the necessary * methods to the {@link com.mockrunner.mock.web.MockActionMapping}. * Redirected are methods for retrieving forwards. If an <code>ActionMapping</code> * is prepared, {@link #getActionMapping} returns the prepared mapping while * {@link #getMockActionMapping} returns the the underlying {@link com.mockrunner.mock.web.MockActionMapping}. * This method relies on CGLib. CGLib is not required by the Struts test framework * if this method is not used. * @param mappingClass the class of the custom action mapping * @return an instance of the custom action mapping class */ public ActionMapping prepareActionMapping(Class mappingClass) { ActionMappingProxyGenerator generator = new ActionMappingProxyGenerator(mockMapping); mapping = generator.createActionMappingProxy(mappingClass); refresh(); return mapping; }
/** * Prepares an <code>ActionMapping</code>. If your actions rely * on a custom subclass of <code>ActionMapping</code>, use this * method to prepare it. Since {@link com.mockrunner.struts.ActionTestModule} * relies on the behaviour of {@link com.mockrunner.mock.web.MockActionMapping}, * this method creates a subclass CGLib proxy of the specified mapping class. * You can cast the returned <code>ActionMapping</code> to your custom * mapping class and the subclass proxy will redirect the necessary * methods to the {@link com.mockrunner.mock.web.MockActionMapping}. * Redirected are methods for retrieving forwards. If an <code>ActionMapping</code> * is prepared, {@link #getActionMapping} returns the prepared mapping while * {@link #getMockActionMapping} returns the the underlying {@link com.mockrunner.mock.web.MockActionMapping}. * This method relies on CGLib. CGLib is not required by the Struts test framework * if this method is not used. * @param mappingClass the class of the custom action mapping * @return an instance of the custom action mapping class */ public ActionMapping prepareActionMapping(Class mappingClass) { ActionMappingProxyGenerator generator = new ActionMappingProxyGenerator(mockMapping); mapping = generator.createActionMappingProxy(mappingClass); refresh(); return mapping; }
private void createMockObjects() { mockMapping = createMockActionMapping(); mapping = mockMapping; mockModuleConfig = createMockModuleConfig(); mockActionServlet = createMockActionServlet(); mockActionServlet.setServletConfig(getMockServletConfig()); mockActionServlet.setServletContext(getMockServletContext()); refresh(); }
private void createMockObjects() { mockMapping = createMockActionMapping(); mapping = mockMapping; mockModuleConfig = createMockModuleConfig(); mockActionServlet = createMockActionServlet(); mockActionServlet.setServletConfig(getMockServletConfig()); mockActionServlet.setServletContext(getMockServletContext()); refresh(); }
private void createMockObjects() { mockMapping = createMockActionMapping(); mapping = mockMapping; mockModuleConfig = createMockModuleConfig(); mockActionServlet = createMockActionServlet(); mockActionServlet.setServletConfig(getMockServletConfig()); mockActionServlet.setServletContext(getMockServletContext()); refresh(); }