Search in sources :

Example 26 with Partition

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());
}
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 27 with Partition

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());
}
Also used : Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) 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)

Aggregations

Partition (uk.ac.bbsrc.tgac.miso.core.data.Partition)27 Run (uk.ac.bbsrc.tgac.miso.core.data.Run)21 RunPartitionAliquot (uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot)14 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)13 RunPartition (uk.ac.bbsrc.tgac.miso.core.data.RunPartition)12 Test (org.junit.Test)10 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)10 IOException (java.io.IOException)9 List (java.util.List)9 PartitionImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl)9 User (com.eaglegenomics.simlims.core.User)8 Collectors (java.util.stream.Collectors)8 Autowired (org.springframework.beans.factory.annotation.Autowired)8 PoolElement (uk.ac.bbsrc.tgac.miso.core.data.impl.view.PoolElement)8 RunService (uk.ac.bbsrc.tgac.miso.core.service.RunService)8 Collection (java.util.Collection)7 Map (java.util.Map)7 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)7 AuthorizationManager (uk.ac.bbsrc.tgac.miso.core.security.AuthorizationManager)7 RunPartitionAliquotService (uk.ac.bbsrc.tgac.miso.core.service.RunPartitionAliquotService)7