@Test public final void testProcessCancel() { try { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); DefaultSiteCommand comm = new DefaultSiteCommand(); comm.setEditMode(true); comm.setSiteOid(null); Tab currTab = testInstance.getTabConfig().getTabs().get(0); assertTrue(currTab != null); BindException aError = new BindException(new DefaultSiteCommand(), null); ModelAndView mav = testInstance.processCancel(currTab, request, response, comm, aError); assertTrue(mav != null); assertTrue(mav.getViewName().equals("redirect:/curator/site/search.html")); } catch (Exception e) { String message = e.getClass().toString() + " - " + e.getMessage(); log.debug(message); fail(message); } }
@Override protected ModelAndView processCancel(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("------------------------processCancel-------------------------------"); unbindEditorContext(req); return new ModelAndView("redirect:/curator/site/search.html"); }
SiteController extends TabbedController { @Override protected ModelAndView processCancel(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("------------------------processCancel-------------------------------"); unbindEditorContext(req); return new ModelAndView("redirect:/curator/site/search.html"); } }
SiteController extends TabbedController { @Override protected ModelAndView processCancel(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("------------------------processCancel-------------------------------"); unbindEditorContext(req); return new ModelAndView("redirect:/curator/site/search.html"); } SiteController(); }
SiteController extends TabbedController { @Override protected ModelAndView processCancel(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("------------------------processCancel-------------------------------"); unbindEditorContext(req); return new ModelAndView("redirect:/curator/site/search.html"); } SiteController(); void bindEditorContext(HttpServletRequest req, SiteEditorContext context); void unbindEditorContext(HttpServletRequest req); SiteEditorContext getEditorContext(HttpServletRequest req); void checkSave(HttpServletRequest req, BindException errors); ModelAndView getErrorsView(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors); void setSiteManager(SiteManager siteManager); void setAuthorityManager(AuthorityManager authorityManager); void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory); void setMessageSource(MessageSource messageSource); void setSiteSearchController(SiteSearchController siteSearchController); }
SiteController extends TabbedController { @Override protected ModelAndView processCancel(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { log.debug("------------------------processCancel-------------------------------"); unbindEditorContext(req); return new ModelAndView("redirect:/curator/site/search.html"); } SiteController(); void bindEditorContext(HttpServletRequest req, SiteEditorContext context); void unbindEditorContext(HttpServletRequest req); SiteEditorContext getEditorContext(HttpServletRequest req); void checkSave(HttpServletRequest req, BindException errors); ModelAndView getErrorsView(Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors); void setSiteManager(SiteManager siteManager); void setAuthorityManager(AuthorityManager authorityManager); void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory); void setMessageSource(MessageSource messageSource); void setSiteSearchController(SiteSearchController siteSearchController); static final String EDITOR_CONTEXT; }