Search in sources :

Example 11 with RunPurpose

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());
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Example 12 with RunPurpose

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));
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Example 13 with RunPurpose

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));
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Example 14 with RunPurpose

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());
}
Also used : Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) RunPartitionAliquotId(uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot.RunPartitionAliquotId) RunPartitionAliquot(uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot) PartitionImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 15 with RunPurpose

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());
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) PoolImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl) Test(org.junit.Test) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)

Aggregations

RunPurpose (uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose)16 Test (org.junit.Test)8 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)6 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)5 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)5 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)5 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)5 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)5 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)5 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)5 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)5 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)5 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)5 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)5 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)5 AbstractHibernateSaveDaoTest (uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)4 RunPartitionAliquot (uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot)4 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)4 SequencingContainerModel (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel)4 User (com.eaglegenomics.simlims.core.User)3