@Test public void testDoFileExistenceCheck() throws Exception { Map<AnalysisJobVO, String> sampleToFilePathMap = new HashMap<AnalysisJobVO, String>(); List<AnalysisJobVO> activeSamples = null; List<AnalysisJobVO> deactiveSamples = null; try { controller.doFileExistenceCheck(sampleToFilePathMap, activeSamples, deactiveSamples); assertTrue("Method should throw an exception.", false); } catch (IllegalStateException e) { } sampleToFilePathMap = new HashMap<AnalysisJobVO, String>(); activeSamples = new ArrayList<AnalysisJobVO>(); deactiveSamples = new ArrayList<AnalysisJobVO>(); controller.doFileExistenceCheck(sampleToFilePathMap, activeSamples, deactiveSamples); sampleToFilePathMap = new HashMap<AnalysisJobVO, String>(); activeSamples = new ArrayList<AnalysisJobVO>(); deactiveSamples = new ArrayList<AnalysisJobVO>(); AnalysisJobVO analysisJobVO = new AnalysisJobVO(); sampleToFilePathMap.put(analysisJobVO, "/uk/ac/ebi/test.txt"); sampleToFilePathMap.put(analysisJobVO, "/uk/ac/ebi/test_2.txt"); controller.doFileExistenceCheck(sampleToFilePathMap, activeSamples, deactiveSamples); }
protected void doFileExistenceCheck(final Map<AnalysisJobVO, String> analysisToFilePathMap, final List<AnalysisJobVO> activatedAnalysisJob, final List<AnalysisJobVO> deactivatedAnalysisJob) { if (analysisToFilePathMap == null || activatedAnalysisJob == null || deactivatedAnalysisJob == null) { throw new IllegalStateException("Input arguments of this method cannot be NULL!"); } for (AnalysisJobVO analysisJob : analysisToFilePathMap.keySet()) { String filePath = analysisToFilePathMap.get(analysisJob); if (!new File(filePath).exists()) { deactivatedAnalysisJob.add(analysisJob); } else { activatedAnalysisJob.add(analysisJob); } } }
CompareController extends AbstractController implements IController { protected void doFileExistenceCheck(final Map<AnalysisJobVO, String> analysisToFilePathMap, final List<AnalysisJobVO> activatedAnalysisJob, final List<AnalysisJobVO> deactivatedAnalysisJob) { if (analysisToFilePathMap == null || activatedAnalysisJob == null || deactivatedAnalysisJob == null) { throw new IllegalStateException("Input arguments of this method cannot be NULL!"); } for (AnalysisJobVO analysisJob : analysisToFilePathMap.keySet()) { String filePath = analysisToFilePathMap.get(analysisJob); if (!new File(filePath).exists()) { deactivatedAnalysisJob.add(analysisJob); } else { activatedAnalysisJob.add(analysisJob); } } } }
CompareController extends AbstractController implements IController { protected void doFileExistenceCheck(final Map<AnalysisJobVO, String> analysisToFilePathMap, final List<AnalysisJobVO> activatedAnalysisJob, final List<AnalysisJobVO> deactivatedAnalysisJob) { if (analysisToFilePathMap == null || activatedAnalysisJob == null || deactivatedAnalysisJob == null) { throw new IllegalStateException("Input arguments of this method cannot be NULL!"); } for (AnalysisJobVO analysisJob : analysisToFilePathMap.keySet()) { String filePath = analysisToFilePathMap.get(analysisJob); if (!new File(filePath).exists()) { deactivatedAnalysisJob.add(analysisJob); } else { activatedAnalysisJob.add(analysisJob); } } }  }
CompareController extends AbstractController implements IController { protected void doFileExistenceCheck(final Map<AnalysisJobVO, String> analysisToFilePathMap, final List<AnalysisJobVO> activatedAnalysisJob, final List<AnalysisJobVO> deactivatedAnalysisJob) { if (analysisToFilePathMap == null || activatedAnalysisJob == null || deactivatedAnalysisJob == null) { throw new IllegalStateException("Input arguments of this method cannot be NULL!"); } for (AnalysisJobVO analysisJob : analysisToFilePathMap.keySet()) { String filePath = analysisToFilePathMap.get(analysisJob); if (!new File(filePath).exists()) { deactivatedAnalysisJob.add(analysisJob); } else { activatedAnalysisJob.add(analysisJob); } } }  @Override ModelAndView doGet(ModelMap model); @RequestMapping(method = RequestMethod.POST) ModelAndView doPostComparisonToolForm(@Valid @ModelAttribute("comparisonForm") final ComparisonForm comparisonForm,
                                                 BindingResult result,
                                                 ModelMap model); @RequestMapping(value = "/samples") ModelAndView getRunsByStudyId(@RequestParam(value = "studyId", required = true)
                                         final long studyId,
                                         @ModelAttribute(value = "comparisonForm")
                                         final ComparisonForm comparisonForm); @RequestMapping(value = "/studies") ModelAndView getStudyDescription(
            @RequestParam(value = "studyId", required = true) final String studyId
    ); }
CompareController extends AbstractController implements IController { protected void doFileExistenceCheck(final Map<AnalysisJobVO, String> analysisToFilePathMap, final List<AnalysisJobVO> activatedAnalysisJob, final List<AnalysisJobVO> deactivatedAnalysisJob) { if (analysisToFilePathMap == null || activatedAnalysisJob == null || deactivatedAnalysisJob == null) { throw new IllegalStateException("Input arguments of this method cannot be NULL!"); } for (AnalysisJobVO analysisJob : analysisToFilePathMap.keySet()) { String filePath = analysisToFilePathMap.get(analysisJob); if (!new File(filePath).exists()) { deactivatedAnalysisJob.add(analysisJob); } else { activatedAnalysisJob.add(analysisJob); } } }  @Override ModelAndView doGet(ModelMap model); @RequestMapping(method = RequestMethod.POST) ModelAndView doPostComparisonToolForm(@Valid @ModelAttribute("comparisonForm") final ComparisonForm comparisonForm,
                                                 BindingResult result,
                                                 ModelMap model); @RequestMapping(value = "/samples") ModelAndView getRunsByStudyId(@RequestParam(value = "studyId", required = true)
                                         final long studyId,
                                         @ModelAttribute(value = "comparisonForm")
                                         final ComparisonForm comparisonForm); @RequestMapping(value = "/studies") ModelAndView getStudyDescription(
            @RequestParam(value = "studyId", required = true) final String studyId
    ); static final String VIEW_NAME; }