@Test public final void testHandelAction() { try { setUpAndTestFirstRequest(); setUpHandelParameters(); aCmd.setActionCmd(TreeToolCommand.ACTION_TREE_ACTION); aCmd.setToggleId((long) 2); WCTNodeTree tree = (WCTNodeTree) aReq.getSession().getAttribute( "tree"); Node<HarvestResource> node = tree.getNodeCache().get((long) 2); Boolean isopen = node.isOpen(); ModelAndView mav = testInstance.handle(aReq, aResp, aCmd, aErrors); assertTrue(mav != null); assertTrue(mav.getViewName().equals(viewName)); tree = (WCTNodeTree) aReq.getSession().getAttribute("tree"); assertTrue(tree != null); node = tree.getNodeCache().get((long) 2); assertTrue(node.isOpen() != isopen); setUpHandelParameters(); aCmd.setActionCmd(TreeToolCommand.ACTION_TREE_ACTION); aCmd.setMarkForDelete((long) 21); aCmd.setPropagateDelete(false); mav = testInstance.handle(aReq, aResp, aCmd, aErrors); assertTrue(mav != null); assertTrue(mav.getViewName().equals(viewName)); tree = (WCTNodeTree) aReq.getSession().getAttribute("tree"); assertTrue(tree != null); WCTNode wctnode = (WCTNode) tree.getNodeCache().get((long) 21); assertTrue(wctnode.isMarkedForDelete()); assertTrue(tree.getPrunedNodes().contains(wctnode)); setUpHandelParameters(); aCmd.setActionCmd(TreeToolCommand.ACTION_TREE_ACTION); aCmd.setMarkForDelete((long) 3); aCmd.setPropagateDelete(true); mav = testInstance.handle(aReq, aResp, aCmd, aErrors); assertTrue(mav != null); assertTrue(mav.getViewName().equals(viewName)); tree = (WCTNodeTree) aReq.getSession().getAttribute("tree"); assertTrue(tree != null); wctnode = (WCTNode) tree.getNodeCache().get((long) 3); assertTrue(wctnode.isMarkedForDelete()); assertTrue(tree.getPrunedNodes().contains(wctnode)); for (Node<HarvestResource> inode1 : wctnode.getChildren()) { WCTNode wctnode1 = (WCTNode) tree.getNodeCache().get( (inode1.getId())); assertTrue(wctnode1.isMarkedForDelete()); assertTrue(tree.getPrunedNodes().contains(wctnode1)); } } catch (Exception e) { fail(e.getClass().getName() + " - " + e.getMessage()); } }
@Override protected ModelAndView handle(HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) throws Exception { super.setSuccessView(getSuccessView()); return super.handle(req, res, comm, errors); }
TreeToolControllerAJAX extends TreeToolController { @Override protected ModelAndView handle(HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) throws Exception { super.setSuccessView(getSuccessView()); return super.handle(req, res, comm, errors); } }
TreeToolControllerAJAX extends TreeToolController { @Override protected ModelAndView handle(HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) throws Exception { super.setSuccessView(getSuccessView()); return super.handle(req, res, comm, errors); } TreeToolControllerAJAX(); }
TreeToolControllerAJAX extends TreeToolController { @Override protected ModelAndView handle(HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) throws Exception { super.setSuccessView(getSuccessView()); return super.handle(req, res, comm, errors); } TreeToolControllerAJAX();  }
TreeToolControllerAJAX extends TreeToolController { @Override protected ModelAndView handle(HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) throws Exception { super.setSuccessView(getSuccessView()); return super.handle(req, res, comm, errors); } TreeToolControllerAJAX();   }