use of uk.ac.bbsrc.tgac.miso.core.data.Partition in project miso-lims by miso-lims.
the class HibernateRunPartitionAliquotDaoIT method testUpdate.
@Test
public void testUpdate() throws Exception {
Run run = (Run) currentSession().get(Run.class, 1L);
Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
LibraryAliquot aliquot = (LibraryAliquot) currentSession().get(LibraryAliquot.class, 1L);
RunPartitionAliquotId id = new RunPartitionAliquotId(run, partition, aliquot);
RunPartitionAliquot rpa = (RunPartitionAliquot) currentSession().get(RunPartitionAliquot.class, id);
RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
assertNull(rpa.getPurpose());
rpa.setPurpose(purpose);
sut.update(rpa);
clearSession();
RunPartitionAliquot saved = (RunPartitionAliquot) currentSession().get(RunPartitionAliquot.class, id);
assertNotNull(saved.getPurpose());
assertEquals(purpose.getId(), saved.getPurpose().getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Partition in project miso-lims by miso-lims.
the class HibernateRunPartitionAliquotDaoIT method testGet.
@Test
public void testGet() throws Exception {
Run run = (Run) currentSession().get(Run.class, 1L);
Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
LibraryAliquot aliquot = (LibraryAliquot) currentSession().get(LibraryAliquot.class, 2L);
RunPartitionAliquot rpa = sut.get(run, partition, aliquot);
assertNotNull(rpa);
assertEquals(1L, rpa.getRun().getId());
assertEquals(1L, rpa.getPartition().getId());
assertEquals(2L, rpa.getAliquot().getId());
}
Aggregations