use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.
the class HibernateRunPurposeDaoIT method testGetByAlias.
@Test
public void testGetByAlias() throws Exception {
String alias = "Research";
RunPurpose purpose = getTestSubject().getByAlias(alias);
assertNotNull(purpose);
assertEquals(alias, purpose.getAlias());
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.
the class HibernateRunPurposeDaoIT method testGetUsageByPoolOrders.
@Test
public void testGetUsageByPoolOrders() throws Exception {
RunPurpose purpose1 = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
assertEquals(2, getTestSubject().getUsageByPoolOrders(purpose1));
RunPurpose purpose2 = (RunPurpose) currentSession().get(RunPurpose.class, 2L);
assertEquals(0, getTestSubject().getUsageByPoolOrders(purpose2));
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.
the class HibernateRunPurposeDaoIT method testGetUsageBySequencingOrders.
@Test
public void testGetUsageBySequencingOrders() throws Exception {
RunPurpose purpose1 = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
assertEquals(2, getTestSubject().getUsageBySequencingOrders(purpose1));
RunPurpose purpose2 = (RunPurpose) currentSession().get(RunPurpose.class, 2L);
assertEquals(0, getTestSubject().getUsageBySequencingOrders(purpose2));
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose 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.impl.RunPurpose in project miso-lims by miso-lims.
the class HibernateSequencingOrderDaoIT method testListByAttributes.
@Test
public void testListByAttributes() throws Exception {
Pool pool = (Pool) currentSession().get(PoolImpl.class, 1L);
RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
SequencingContainerModel containerModel = (SequencingContainerModel) currentSession().get(SequencingContainerModel.class, 1L);
SequencingParameters parameters = (SequencingParameters) currentSession().get(SequencingParameters.class, 1L);
assertEquals(1, getTestSubject().listByAttributes(pool, purpose, null, parameters, 1).size());
assertEquals(1, getTestSubject().listByAttributes(pool, purpose, containerModel, parameters, 2).size());
assertEquals(0, getTestSubject().listByAttributes(pool, purpose, null, parameters, 10).size());
}
Aggregations