Search in sources :

Example 1 with KitDescriptor

use of uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor in project miso-lims by miso-lims.

the class ExperimentTest method setUpKit.

private final void setUpKit(Kit kit, KitType type, String identifier) {
    final KitDescriptor kitDescriptor = new KitDescriptor();
    kitDescriptor.setKitType(type);
    when(kit.getKitDescriptor()).thenReturn(kitDescriptor);
    when(kit.getName()).thenReturn(identifier);
    ae.addKit(kit);
}
Also used : KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor)

Example 2 with KitDescriptor

use of uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor in project miso-lims by miso-lims.

the class KitDescriptorPageIT method testCreate.

@Test
public void testCreate() throws Exception {
    KitDescriptorPage page1 = KitDescriptorPage.getForCreate(getDriver(), getBaseUrl());
    // default values
    Map<KitDescriptorPage.Field, String> fields = Maps.newLinkedHashMap();
    fields.put(Field.ID, "Unsaved");
    fields.put(Field.NAME, null);
    fields.put(Field.VERSION, null);
    fields.put(Field.MANUFACTURER, null);
    fields.put(Field.PART_NUMBER, null);
    fields.put(Field.STOCK_LEVEL, "0");
    fields.put(Field.DESCRIPTION, null);
    fields.put(Field.KIT_TYPE, "Library");
    fields.put(Field.PLATFORM, "Illumina");
    assertFieldValues("default values", fields, page1);
    // enter kit info
    Map<KitDescriptorPage.Field, String> changes = Maps.newLinkedHashMap();
    changes.put(Field.NAME, "Test Clustering Kit");
    changes.put(Field.VERSION, "1");
    changes.put(Field.MANUFACTURER, "ACME");
    changes.put(Field.PART_NUMBER, "123");
    changes.put(Field.STOCK_LEVEL, "11");
    changes.put(Field.DESCRIPTION, "Test Description");
    changes.put(Field.KIT_TYPE, "Clustering");
    page1.setFields(changes);
    fields.putAll(changes);
    assertFieldValues("pre-save", fields, page1);
    KitDescriptorPage page2 = page1.save();
    fields.remove(Field.ID);
    assertFieldValues("post-save", fields, page2);
    long savedId = Long.parseLong(page2.getField(Field.ID));
    KitDescriptor saved = (KitDescriptor) getSession().get(KitDescriptor.class, savedId);
    assertKitDescriptorAttributes(fields, saved);
}
Also used : Field(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.KitDescriptorPage.Field) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) KitDescriptorPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.KitDescriptorPage) Test(org.junit.Test)

Example 3 with KitDescriptor

use of uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor in project miso-lims by miso-lims.

the class KitDescriptorPageIT method testChangeValues.

@Test
public void testChangeValues() throws Exception {
    KitDescriptorPage page1 = KitDescriptorPage.getForEdit(getDriver(), getBaseUrl(), 1L);
    // initial values
    Map<KitDescriptorPage.Field, String> fields = Maps.newLinkedHashMap();
    fields.put(Field.ID, "1");
    fields.put(Field.NAME, "Test Kit");
    fields.put(Field.VERSION, "1");
    fields.put(Field.MANUFACTURER, "TestCo");
    fields.put(Field.PART_NUMBER, "123");
    fields.put(Field.STOCK_LEVEL, "0");
    fields.put(Field.KIT_TYPE, "Library");
    fields.put(Field.PLATFORM, "Illumina");
    assertFieldValues("initial values", fields, page1);
    Map<KitDescriptorPage.Field, String> changes = Maps.newLinkedHashMap();
    changes.put(Field.VERSION, "2");
    changes.put(Field.MANUFACTURER, "CoTest");
    changes.put(Field.PART_NUMBER, "321");
    changes.put(Field.STOCK_LEVEL, "1");
    page1.setFields(changes);
    fields.putAll(changes);
    assertFieldValues("changes pre-save", fields, page1);
    KitDescriptorPage page2 = page1.save();
    assertFieldValues("post-save", fields, page2);
    KitDescriptor saved = (KitDescriptor) getSession().get(KitDescriptor.class, 1L);
    assertKitDescriptorAttributes(fields, saved);
}
Also used : Field(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.KitDescriptorPage.Field) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) KitDescriptorPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.KitDescriptorPage) Test(org.junit.Test)

Example 4 with KitDescriptor

use of uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor in project miso-lims by miso-lims.

the class DefaultLibraryAliquotServiceTest method setUp.

@Before
public void setUp() {
    service = new DefaultLibraryAliquotService();
    aliquot = new DetailedLibraryAliquot();
    KitDescriptor libraryKd = new KitDescriptor();
    aliquot.setKitDescriptor(libraryKd);
}
Also used : KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) DetailedLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot) Before(org.junit.Before)

Example 5 with KitDescriptor

use of uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor in project miso-lims by miso-lims.

the class Dtos method to.

public static SequencerPartitionContainer to(@Nonnull ContainerDto from) {
    SequencerPartitionContainer to = null;
    if (from instanceof OxfordNanoporeContainerDto) {
        OxfordNanoporeContainerDto ontFrom = (OxfordNanoporeContainerDto) from;
        OxfordNanoporeContainer ontTo = new OxfordNanoporeContainer();
        setObject(ontTo::setPoreVersion, PoreVersion::new, ontFrom.getPoreVersionId());
        setDate(ontTo::setReceivedDate, ontFrom.getReceivedDate());
        setDate(ontTo::setReturnedDate, ontFrom.getReturnedDate());
        to = ontTo;
    } else {
        to = new SequencerPartitionContainerImpl();
    }
    setLong(to::setId, from.getId(), false);
    setString(to::setIdentificationBarcode, from.getIdentificationBarcode());
    setObject(to::setModel, SequencingContainerModel::new, maybeGetProperty(from.getModel(), SequencingContainerModelDto::getId));
    setString(to::setDescription, from.getDescription());
    setObject(to::setClusteringKit, KitDescriptor::new, from.getClusteringKitId());
    setString(to::setClusteringKitLot, from.getClusteringKitLot());
    setObject(to::setMultiplexingKit, KitDescriptor::new, from.getMultiplexingKitId());
    setString(to::setMultiplexingKitLot, from.getMultiplexingKitLot());
    return to;
}
Also used : SequencerPartitionContainer(uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) OxfordNanoporeContainer(uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer) SequencerPartitionContainerImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl) PoreVersion(uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)

Aggregations

KitDescriptor (uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor)41 Test (org.junit.Test)15 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)13 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)8 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)8 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)8 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)8 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)8 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)8 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)8 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)8 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)8 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)8 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)8 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)8 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)8 TargetedSequencing (uk.ac.bbsrc.tgac.miso.core.data.impl.TargetedSequencing)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2