IUSServiceImpl implements IUSService { @Override public IUS findByID(Integer id) { IUS ius = null; if (id != null) { try { ius = dao.findByID(id); } catch (Exception exception) { log.error("Cannot find IUS by id " + id); log.error(exception.getMessage()); } } return ius; } IUSServiceImpl(); @Override void setIUSDAO(IUSDAO dao); void setFileDAO(FileDAO fileDAO); @Override Integer insert(IUS obj); @Override void delete(IUS ius, boolean deleteRealFiles); @Override void update(IUS obj); @Override List<File> getFiles(Integer iusId); @Override List<File> getFiles(Integer iusId, String metaType); @Override boolean isHasFile(Integer iusId, String metaType); @Override boolean isHasFile(Integer iusId); @Override SortedSet<IUS> setWithHasFile(SortedSet<IUS> list); @Override SortedSet<IUS> listWithHasFile(SortedSet<IUS> list, String metaType); @Override IUS findByID(Integer id); @Override IUS findBySWAccession(Integer swAccession); @Override List<IUS> findByOwnerID(Integer registrationId); @Override List<IUS> findByCriteria(String criteria, boolean isCaseSens); @Override IUS updateDetached(IUS ius); @Override List<IUS> findBelongsToStudy(Study study); @Override List<IUS> list(); @Override void update(Registration registration, IUS ius); @Override Integer insert(Registration registration, IUS ius); @Override IUS updateDetached(Registration registration, IUS ius); @Override List<IUS> find(String sequencerRunName, Integer lane, String sampleName);  }
@Test public void testAssociatedWorkflowRuns() { InSessionExecutions.bindSessionToThread(); IUSService iusService = BeanFactory.getIUSServiceBean(); IUS ius = iusService.findByID(4); Set<WorkflowRun> iuses = ius.getWorkflowRuns(); Log.info("Count " + iuses.size()); InSessionExecutions.unBindSessionFromTheThread(); }