Search in sources :

Example 6 with BoxSize

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

the class HibernateBoxDaoIT method testSave.

@Test
public void testSave() throws Exception {
    Box box = new BoxImpl();
    UserImpl user = new UserImpl();
    user.setId(1l);
    Date now = new Date();
    box.setCreator(user);
    box.setCreationTime(now);
    box.setLastModifier(user);
    box.setLastModified(now);
    box.setDescription("newboxdescription");
    box.setAlias("newboxalias");
    box.setName("newbox");
    box.setLocationBarcode("newlocationbarcode");
    BoxSize boxSize = new BoxSize();
    boxSize.setColumns(2);
    boxSize.setRows(3);
    boxSize.setId(1l);
    box.setSize(boxSize);
    BoxUse boxuse = (BoxUse) sessionFactory.getCurrentSession().get(BoxUse.class, 1L);
    box.setUse(boxuse);
    long boxId = dao.save(box);
    Box retrieved = dao.get(boxId);
    assertEquals(box.getDescription(), retrieved.getDescription());
    assertEquals(box.getAlias(), retrieved.getAlias());
    assertEquals(box.getSize().getId(), retrieved.getSize().getId());
    assertEquals(box.getName(), retrieved.getName());
}
Also used : BoxImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) Box(uk.ac.bbsrc.tgac.miso.core.data.Box) BoxSize(uk.ac.bbsrc.tgac.miso.core.data.BoxSize) Date(java.util.Date) BoxUse(uk.ac.bbsrc.tgac.miso.core.data.BoxUse) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 7 with BoxSize

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

the class HibernateBoxSizeDaoIT method testGetUsage.

@Test
public void testGetUsage() throws IOException {
    BoxSize boxSize = (BoxSize) getSessionFactory().getCurrentSession().get(BoxSize.class, 1L);
    assertNotNull(boxSize);
    assertEquals(2L, sut.getUsage(boxSize));
}
Also used : BoxSize(uk.ac.bbsrc.tgac.miso.core.data.BoxSize) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 8 with BoxSize

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

the class HibernateBoxSizeDaoIT method testUpdate.

@Test
public void testUpdate() throws IOException {
    long id = 1L;
    int rows = 7;
    int cols = 5;
    BoxSize boxSize = (BoxSize) getSessionFactory().getCurrentSession().get(BoxSize.class, id);
    assertNotEquals(rows, boxSize.getRows().intValue());
    assertNotEquals(cols, boxSize.getColumns().intValue());
    boxSize.setRows(rows);
    boxSize.setColumns(cols);
    sut.update(boxSize);
    clearSession();
    BoxSize saved = (BoxSize) getSessionFactory().getCurrentSession().get(BoxSize.class, id);
    assertEquals(rows, saved.getRows().intValue());
    assertEquals(cols, saved.getColumns().intValue());
}
Also used : BoxSize(uk.ac.bbsrc.tgac.miso.core.data.BoxSize) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 9 with BoxSize

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

the class HibernateBoxSizeDaoIT method testCreate.

@Test
public void testCreate() throws IOException {
    int rows = 3;
    int cols = 2;
    BoxSize boxSize = new BoxSize();
    boxSize.setRows(rows);
    boxSize.setColumns(cols);
    boxSize.setBoxType(BoxType.STORAGE);
    long savedId = sut.create(boxSize);
    clearSession();
    BoxSize saved = (BoxSize) getSessionFactory().getCurrentSession().get(BoxSize.class, savedId);
    assertEquals(rows, saved.getRows().intValue());
    assertEquals(cols, saved.getColumns().intValue());
}
Also used : BoxSize(uk.ac.bbsrc.tgac.miso.core.data.BoxSize) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 10 with BoxSize

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

the class BoxRestControllerTest method makeEmptyBox.

private Box makeEmptyBox() {
    Box box = new BoxImpl();
    box.setId(1L);
    box.setAlias("box");
    BoxSize size = new BoxSize();
    size.setRows(8);
    size.setColumns(12);
    box.setSize(size);
    BoxUse use = new BoxUse();
    use.setAlias("use");
    box.setUse(use);
    box.setLocationBarcode("freezer");
    User user = new UserImpl();
    user.setId(1L);
    box.setLastModifier(user);
    return box;
}
Also used : User(com.eaglegenomics.simlims.core.User) BoxImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) Box(uk.ac.bbsrc.tgac.miso.core.data.Box) BoxSize(uk.ac.bbsrc.tgac.miso.core.data.BoxSize) BoxUse(uk.ac.bbsrc.tgac.miso.core.data.BoxUse)

Aggregations

BoxSize (uk.ac.bbsrc.tgac.miso.core.data.BoxSize)10 Test (org.junit.Test)5 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)5 Box (uk.ac.bbsrc.tgac.miso.core.data.Box)3 BoxUse (uk.ac.bbsrc.tgac.miso.core.data.BoxUse)3 BoxImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl)3 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)2 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)2 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)2 UserImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl)2 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)2 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)2 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)2 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)2 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)2 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)2 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)2 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)2 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)2 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)2