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);
}
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);
}
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);
}
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);
}
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;
}
Aggregations