use of uk.ac.bbsrc.tgac.miso.core.data.RunLibraryQcStatus in project miso-lims by miso-lims.
the class HibernateRunPartitionAliquotDaoIT method testCreate.
@Test
public void testCreate() throws Exception {
Run run = (Run) currentSession().get(Run.class, 1L);
Partition partition = (Partition) currentSession().get(PartitionImpl.class, 2L);
LibraryAliquot aliquot = (LibraryAliquot) currentSession().get(LibraryAliquot.class, 3L);
RunPartitionAliquotId id = new RunPartitionAliquotId(run, partition, aliquot);
assertNull(currentSession().get(RunPartitionAliquot.class, id));
RunPartitionAliquot rpa = new RunPartitionAliquot(run, partition, aliquot);
User user = (User) currentSession().get(UserImpl.class, 1L);
rpa.setLastModifier(user);
RunLibraryQcStatus qc = (RunLibraryQcStatus) currentSession().get(RunLibraryQcStatus.class, 1L);
rpa.setQcStatus(qc);
rpa.setQcUser(user);
rpa.setQcDate(new Date());
sut.create(rpa);
clearSession();
RunPartitionAliquot saved = (RunPartitionAliquot) currentSession().get(RunPartitionAliquot.class, id);
assertNotNull(saved);
assertEquals(1L, saved.getRun().getId());
assertEquals(2L, saved.getPartition().getId());
assertEquals(3L, saved.getAliquot().getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.RunLibraryQcStatus in project miso-lims by miso-lims.
the class Dtos method to.
public static RunPartitionAliquot to(@Nonnull RunPartitionAliquotDto from) {
RunPartitionAliquot to = new RunPartitionAliquot();
PlatformType platform = PlatformType.valueOf(from.getPlatformType());
setObject(to::setRun, platform::createRun, from.getRunId());
setObject(to::setPartition, PartitionImpl::new, from.getPartitionId());
setObject(to::setAliquot, LibraryAliquot::new, from.getAliquotId());
setObject(to::setPurpose, RunPurpose::new, from.getRunPurposeId());
setObject(to::setQcStatus, RunLibraryQcStatus::new, from.getQcStatusId());
setString(to::setQcNote, from.getQcNote());
setBoolean(to::setDataReview, from.getDataReview(), true);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.RunLibraryQcStatus in project miso-lims by miso-lims.
the class Dtos method to.
public static RunLibraryQcStatus to(RunLibraryQcStatusDto from) {
RunLibraryQcStatus to = new RunLibraryQcStatus();
setLong(to::setId, from.getId(), false);
setString(to::setDescription, from.getDescription());
setBoolean(to::setQcPassed, from.getQcPassed(), true);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.RunLibraryQcStatus in project miso-lims by miso-lims.
the class HibernateRunPartitionAliquotDaoIT method testSaveCreate.
@Test
public void testSaveCreate() throws Exception {
Run run = (Run) currentSession().get(Run.class, 1L);
Partition partition = (Partition) currentSession().get(PartitionImpl.class, 2L);
LibraryAliquot aliquot = (LibraryAliquot) currentSession().get(LibraryAliquot.class, 3L);
RunPartitionAliquotId id = new RunPartitionAliquotId(run, partition, aliquot);
assertNull(currentSession().get(RunPartitionAliquot.class, id));
RunPartitionAliquot rpa = new RunPartitionAliquot(run, partition, aliquot);
User user = (User) currentSession().get(UserImpl.class, 1L);
rpa.setLastModifier(user);
RunLibraryQcStatus qc = (RunLibraryQcStatus) currentSession().get(RunLibraryQcStatus.class, 1L);
rpa.setQcStatus(qc);
rpa.setQcUser(user);
rpa.setQcDate(new Date());
sut.save(rpa);
clearSession();
RunPartitionAliquot saved = (RunPartitionAliquot) currentSession().get(RunPartitionAliquot.class, id);
assertNotNull(saved);
assertEquals(1L, saved.getRun().getId());
assertEquals(2L, saved.getPartition().getId());
assertEquals(3L, saved.getAliquot().getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.RunLibraryQcStatus in project miso-lims by miso-lims.
the class HibernateRunLibraryQcStatusDaoIT method getCreateItem.
@Override
public RunLibraryQcStatus getCreateItem() {
RunLibraryQcStatus status = new RunLibraryQcStatus();
status.setDescription("New Status");
status.setQcPassed(true);
return status;
}
Aggregations