use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testGetNextCousin.
@Test
public void testGetNextCousin() throws Exception {
Library library = (Library) currentSession().get(LibraryImpl.class, 2L);
long nextId = 3L;
EntityReference next = dao.getAdjacentLibrary(library, false);
assertNotNull(next);
assertEquals(nextId, next.getId());
Library nextLibrary = (Library) currentSession().get(LibraryImpl.class, nextId);
assertNotEquals(library.getSample().getId(), nextLibrary.getSample().getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testListByProjectId.
@Test
public void testListByProjectId() throws Exception {
List<Library> libraries = dao.listByProjectId(1);
List<Long> libraryIds = Arrays.asList(1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l, 9l, 10l, 11l, 12l, 13l, 14l, 15l);
assertEquals(15, libraries.size());
for (Library library : libraries) {
assertTrue("bad library found", libraryIds.contains(library.getId()));
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testGetPreviousSibling.
@Test
public void testGetPreviousSibling() throws Exception {
Library library = (Library) currentSession().get(LibraryImpl.class, 2L);
long previousId = 1L;
EntityReference previous = dao.getAdjacentLibrary(library, true);
assertNotNull(previous);
assertEquals(previousId, previous.getId());
Library previousLibrary = (Library) currentSession().get(LibraryImpl.class, previousId);
assertEquals(library.getSample().getId(), previousLibrary.getSample().getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testGetPreviousCousin.
@Test
public void testGetPreviousCousin() throws Exception {
Library library = (Library) currentSession().get(LibraryImpl.class, 3L);
long previousId = 2L;
EntityReference previous = dao.getAdjacentLibrary(library, true);
assertNotNull(previous);
assertEquals(previousId, previous.getId());
Library previousLibrary = (Library) currentSession().get(LibraryImpl.class, previousId);
assertNotEquals(library.getSample().getId(), previousLibrary.getSample().getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testGet.
@Test
public void testGet() throws Exception {
Library library = dao.get(3);
assertNotNull(library);
assertEquals("library name is incorrect", "LIB3", library.getName());
assertEquals("library description is incorrect", "Inherited from TEST_0002", library.getDescription());
}
Aggregations