use of uk.ac.bbsrc.tgac.miso.core.data.RunPartition in project miso-lims by miso-lims.
the class HibernateRunPartitionDaoIT method testUpdate.
@Test
public void testUpdate() throws Exception {
Run run = (Run) sessionFactory.getCurrentSession().get(Run.class, 1L);
Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
RunPartition qc = dao.get(run.getId(), partition.getId());
assertNotNull(qc);
qc.setNotes("change is inevitable");
dao.update(qc);
RunPartition fetchedQc = dao.get(run.getId(), partition.getId());
assertNotNull(fetchedQc);
assertEquals(qc.getQcType().getId(), fetchedQc.getQcType().getId());
assertEquals(qc.getNotes(), fetchedQc.getNotes());
}
use of uk.ac.bbsrc.tgac.miso.core.data.RunPartition in project miso-lims by miso-lims.
the class HibernateRunPartitionDaoIT method testGet.
@Test
public void testGet() throws Exception {
Run run = (Run) sessionFactory.getCurrentSession().get(Run.class, 1L);
assertNotNull(run);
Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
assertNotNull(partition);
RunPartition qc = dao.get(run.getId(), partition.getId());
assertNotNull(qc);
assertEquals(1L, qc.getQcType().getId());
assertEquals("it is written", qc.getNotes());
}
use of uk.ac.bbsrc.tgac.miso.core.data.RunPartition in project miso-lims by miso-lims.
the class HibernateRunPartitionDaoIT method testCreate.
@Test
public void testCreate() throws Exception {
long runId = 2L;
long partitionId = 2L;
PartitionQCType type = (PartitionQCType) currentSession().get(PartitionQCType.class, 1L);
RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
RunPartition qc = new RunPartition();
User user = (User) currentSession().get(UserImpl.class, 1L);
qc.setRunId(runId);
qc.setPartitionId(partitionId);
qc.setQcType(type);
qc.setPurpose(purpose);
qc.setLastModifier(user);
dao.create(qc);
RunPartition fetchedQc = dao.get(runId, partitionId);
assertNotNull(fetchedQc);
assertEquals(qc.getQcType().getId(), fetchedQc.getQcType().getId());
assertEquals(qc.getNotes(), fetchedQc.getNotes());
}
Aggregations