@Test public final void testProcessTab() throws Exception { HttpServletRequest aReq = new MockHttpServletRequest(); TargetManager targetManager = new MockTargetManager(testFile); testInstance.setTargetManager(targetManager); TargetGroup targetGroup = targetManager.loadGroup(15000L); List<Annotation> list = createAnnotationList(); assertFalse(checkSortedList(list)); targetGroup.setAnnotations(list); GroupsEditorContext ctx = new GroupsEditorContext(targetGroup, true); aReq.getSession().setAttribute(TabbedGroupController.EDITOR_CONTEXT, ctx); HttpServletResponse aResp = new MockHttpServletResponse(); GroupAnnotationCommand aCmd = new GroupAnnotationCommand(); TabbedController tc = new TabbedGroupController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("groups"); List<Tab> tabs = getTabList(targetManager); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); Tab currentTab = tabs.get(1); aCmd.setActionCmd(GroupAnnotationCommand.ACTION_ADD_NOTE); aCmd.setNote("A note"); BindException aErrors = new BindException(aCmd, aCmd.getActionCmd()); List<Annotation> resultAnnotations = targetGroup.getAnnotations(); int numAnnotations = resultAnnotations.size(); testInstance.processTab(tc, currentTab, aReq, aResp, aCmd, aErrors); assertEquals(resultAnnotations.size(), numAnnotations+1); Annotation resultAnnotation = resultAnnotations.get(resultAnnotations.size()-1); assertEquals("A note", resultAnnotation.getNote()); }
public void processTab(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { GroupAnnotationCommand cmd = (GroupAnnotationCommand) comm; if (cmd.isAction(GroupAnnotationCommand.ACTION_ADD_NOTE)) { GroupsEditorContext ctx = getEditorContext(req); addAnnotation(cmd, ctx); } }
GroupAnnotationHandler extends AbstractGroupTabHandler { public void processTab(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { GroupAnnotationCommand cmd = (GroupAnnotationCommand) comm; if (cmd.isAction(GroupAnnotationCommand.ACTION_ADD_NOTE)) { GroupsEditorContext ctx = getEditorContext(req); addAnnotation(cmd, ctx); } } }
GroupAnnotationHandler extends AbstractGroupTabHandler { public void processTab(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { GroupAnnotationCommand cmd = (GroupAnnotationCommand) comm; if (cmd.isAction(GroupAnnotationCommand.ACTION_ADD_NOTE)) { GroupsEditorContext ctx = getEditorContext(req); addAnnotation(cmd, ctx); } }  }
GroupAnnotationHandler extends AbstractGroupTabHandler { public void processTab(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { GroupAnnotationCommand cmd = (GroupAnnotationCommand) comm; if (cmd.isAction(GroupAnnotationCommand.ACTION_ADD_NOTE)) { GroupsEditorContext ctx = getEditorContext(req); addAnnotation(cmd, ctx); } }  void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void processTab(TabbedController tc, Tab currentTab,
            HttpServletRequest req, HttpServletResponse res, Object comm,
            BindException errors); @SuppressWarnings("unchecked") TabbedModelAndView preProcessNextTab(TabbedController tc,
            Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
            Object comm, BindException errors); ModelAndView processOther(TabbedController tc, Tab currentTab,
            HttpServletRequest req, HttpServletResponse res, Object comm,
            BindException errors); void setTargetManager(TargetManager targetManager); }
GroupAnnotationHandler extends AbstractGroupTabHandler { public void processTab(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { GroupAnnotationCommand cmd = (GroupAnnotationCommand) comm; if (cmd.isAction(GroupAnnotationCommand.ACTION_ADD_NOTE)) { GroupsEditorContext ctx = getEditorContext(req); addAnnotation(cmd, ctx); } }  void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void processTab(TabbedController tc, Tab currentTab,
            HttpServletRequest req, HttpServletResponse res, Object comm,
            BindException errors); @SuppressWarnings("unchecked") TabbedModelAndView preProcessNextTab(TabbedController tc,
            Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
            Object comm, BindException errors); ModelAndView processOther(TabbedController tc, Tab currentTab,
            HttpServletRequest req, HttpServletResponse res, Object comm,
            BindException errors); void setTargetManager(TargetManager targetManager);  }