Search in sources :

Example 11 with RunPartition

use of uk.ac.bbsrc.tgac.miso.core.data.RunPartition in project miso-lims by miso-lims.

the class HibernateRunPartitionDaoIT method testUpdate.

@Test
public void testUpdate() throws Exception {
    Run run = (Run) sessionFactory.getCurrentSession().get(Run.class, 1L);
    Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
    RunPartition qc = dao.get(run.getId(), partition.getId());
    assertNotNull(qc);
    qc.setNotes("change is inevitable");
    dao.update(qc);
    RunPartition fetchedQc = dao.get(run.getId(), partition.getId());
    assertNotNull(fetchedQc);
    assertEquals(qc.getQcType().getId(), fetchedQc.getQcType().getId());
    assertEquals(qc.getNotes(), fetchedQc.getNotes());
}
Also used : RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) PartitionImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 12 with RunPartition

use of uk.ac.bbsrc.tgac.miso.core.data.RunPartition in project miso-lims by miso-lims.

the class HibernateRunPartitionDaoIT method testGet.

@Test
public void testGet() throws Exception {
    Run run = (Run) sessionFactory.getCurrentSession().get(Run.class, 1L);
    assertNotNull(run);
    Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
    assertNotNull(partition);
    RunPartition qc = dao.get(run.getId(), partition.getId());
    assertNotNull(qc);
    assertEquals(1L, qc.getQcType().getId());
    assertEquals("it is written", qc.getNotes());
}
Also used : RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) PartitionImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 13 with RunPartition

use of uk.ac.bbsrc.tgac.miso.core.data.RunPartition in project miso-lims by miso-lims.

the class HibernateRunPartitionDaoIT method testCreate.

@Test
public void testCreate() throws Exception {
    long runId = 2L;
    long partitionId = 2L;
    PartitionQCType type = (PartitionQCType) currentSession().get(PartitionQCType.class, 1L);
    RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
    RunPartition qc = new RunPartition();
    User user = (User) currentSession().get(UserImpl.class, 1L);
    qc.setRunId(runId);
    qc.setPartitionId(partitionId);
    qc.setQcType(type);
    qc.setPurpose(purpose);
    qc.setLastModifier(user);
    dao.create(qc);
    RunPartition fetchedQc = dao.get(runId, partitionId);
    assertNotNull(fetchedQc);
    assertEquals(qc.getQcType().getId(), fetchedQc.getQcType().getId());
    assertEquals(qc.getNotes(), fetchedQc.getNotes());
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) User(com.eaglegenomics.simlims.core.User) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Aggregations

RunPartition (uk.ac.bbsrc.tgac.miso.core.data.RunPartition)13 Run (uk.ac.bbsrc.tgac.miso.core.data.Run)9 Partition (uk.ac.bbsrc.tgac.miso.core.data.Partition)8 User (com.eaglegenomics.simlims.core.User)6 Test (org.junit.Test)5 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)5 SequencerPartitionContainer (uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer)5 IOException (java.io.IOException)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 PartitionQCType (uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType)4 ArrayList (java.util.ArrayList)3 Collection (java.util.Collection)3 List (java.util.List)3 Objects (java.util.Objects)3 Collectors (java.util.stream.Collectors)3 Stream (java.util.stream.Stream)3 Controller (org.springframework.stereotype.Controller)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3 PathVariable (org.springframework.web.bind.annotation.PathVariable)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3