Search in sources :

Example 6 with Study

use of uk.ac.bbsrc.tgac.miso.core.data.Study in project miso-lims by miso-lims.

the class DefaultStudyServiceTest method testSaveStudy.

@Test
public void testSaveStudy() throws IOException {
    StudyType st = new StudyType();
    st.setId(2L);
    st.setName("Test");
    when(studyTypeDao.get(2L)).thenReturn(st);
    Study s = new StudyImpl();
    s.setId(1L);
    s.setName("a");
    s.setDescription("desc");
    s.setStudyType(st);
    Study db = new StudyImpl();
    db.setId(1L);
    db.setName("b");
    db.setDescription("mt");
    s.setStudyType(st);
    when(studyStore.get(1L)).thenReturn(db);
    when(studyStore.save(db)).thenReturn(1L);
    assertEquals(1L, sut.update(s));
    assertEquals(s.getDescription(), db.getDescription());
    assertNotEquals(s.getName(), db.getName());
}
Also used : Study(uk.ac.bbsrc.tgac.miso.core.data.Study) StudyType(uk.ac.bbsrc.tgac.miso.core.data.StudyType) StudyImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.StudyImpl) Test(org.junit.Test)

Example 7 with Study

use of uk.ac.bbsrc.tgac.miso.core.data.Study in project miso-lims by miso-lims.

the class DefaultStudyServiceTest method testGetStudyByIdThrows.

@Test
public void testGetStudyByIdThrows() throws IOException {
    Study db = new StudyImpl();
    db.setId(1L);
    db.setName("b");
    db.setDescription("mt");
    when(studyStore.get(1L)).thenReturn(db);
    assertEquals(db, sut.get(1L));
}
Also used : Study(uk.ac.bbsrc.tgac.miso.core.data.Study) StudyImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.StudyImpl) Test(org.junit.Test)

Example 8 with Study

use of uk.ac.bbsrc.tgac.miso.core.data.Study in project miso-lims by miso-lims.

the class HibernateStudyDaoIT method testGetUsage.

@Test
public void testGetUsage() throws Exception {
    Study study = (Study) currentSession().get(StudyImpl.class, 1L);
    assertEquals(25L, dao.getUsage(study));
}
Also used : Study(uk.ac.bbsrc.tgac.miso.core.data.Study) StudyImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.StudyImpl) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 9 with Study

use of uk.ac.bbsrc.tgac.miso.core.data.Study in project miso-lims by miso-lims.

the class HibernateStudyDaoIT method makeStudy.

private Study makeStudy() {
    User user = new UserImpl();
    user.setId(1L);
    Project project = new ProjectImpl();
    project.setId(1L);
    StudyType studyType = new StudyType();
    studyType.setId(1L);
    Study s = new StudyImpl();
    s.setName("STU999");
    s.setStudyType(studyType);
    s.setDescription("foo");
    s.setProject(project);
    s.setChangeDetails(user);
    return s;
}
Also used : Project(uk.ac.bbsrc.tgac.miso.core.data.Project) Study(uk.ac.bbsrc.tgac.miso.core.data.Study) User(com.eaglegenomics.simlims.core.User) StudyType(uk.ac.bbsrc.tgac.miso.core.data.StudyType) ProjectImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ProjectImpl) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) StudyImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.StudyImpl)

Aggregations

Study (uk.ac.bbsrc.tgac.miso.core.data.Study)9 StudyImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.StudyImpl)6 Test (org.junit.Test)4 StudyType (uk.ac.bbsrc.tgac.miso.core.data.StudyType)3 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)2 Project (uk.ac.bbsrc.tgac.miso.core.data.Project)2 ProjectImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.ProjectImpl)2 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)1 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)1 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)1 User (com.eaglegenomics.simlims.core.User)1 Criteria (org.hibernate.Criteria)1 NotFoundException (org.springframework.security.acls.model.NotFoundException)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 SampleNumberPerProjectImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleNumberPerProjectImpl)1 UserImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl)1 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)1 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)1 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)1 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)1