Search in sources :

Example 1 with LibraryImpl

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

the class BulkLibraryAliquotIT method testRemoveLibraryVolumeForPropogateMany.

@Test
public void testRemoveLibraryVolumeForPropogateMany() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForPropagate(getDriver(), getBaseUrl(), Sets.newHashSet(802L, 803L));
    HandsOnTable table = page.getTable();
    Map<String, String> row0 = Maps.newLinkedHashMap();
    row0.put(LibraryAliquotColumns.VOLUME_USED, "12.34");
    row0.put(LibraryAliquotColumns.QC_STATUS, "Not Ready");
    Map<String, String> row1 = Maps.newLinkedHashMap();
    row1.put(LibraryAliquotColumns.VOLUME_USED, "110.2");
    row1.put(LibraryAliquotColumns.QC_STATUS, "Not Ready");
    fillRow(table, 0, row0);
    fillRow(table, 1, row1);
    assertColumnValues(table, 0, row0, "pre-save row 0");
    assertColumnValues(table, 1, row1, "pre-save row 1");
    assertTrue(page.save(true));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, row0, "post-save row 0");
    assertColumnValues(savedTable, 1, row1, "post-save row 1");
    Long newId0 = getSavedId(savedTable, 0);
    LibraryAliquot saved0 = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId0);
    assertLibraryAliquotAttributes(row0, saved0);
    Long newId1 = getSavedId(savedTable, 1);
    LibraryAliquot saved1 = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId1);
    assertLibraryAliquotAttributes(row1, saved1);
    LibraryImpl savedLib0 = (LibraryImpl) getSession().get(LibraryImpl.class, saved0.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", 87.66, savedLib0.getVolume()), compareDoubles(savedLib0.getVolume(), "87.66"));
    LibraryImpl savedLib1 = (LibraryImpl) getSession().get(LibraryImpl.class, saved1.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", -10.2, savedLib1.getVolume()), compareDoubles(savedLib1.getVolume(), "-10.2"));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 2 with LibraryImpl

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

the class BulkLibraryAliquotIT method testRemoveLibraryVolumeForEdit.

@Test
public void testRemoveLibraryVolumeForEdit() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(1001L));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibraryAliquotColumns.VOLUME_USED, "50.2");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, attrs, "post-save");
    Long newId = getSavedId(savedTable, 0);
    LibraryAliquot saved = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId);
    assertLibraryAliquotAttributes(attrs, saved);
    LibraryImpl savedLib = (LibraryImpl) getSession().get(LibraryImpl.class, saved.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", 49.8, savedLib.getVolume()), compareDoubles(savedLib.getVolume(), "49.8"));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 3 with LibraryImpl

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

the class BulkLibraryAliquotIT method testRemoveLibraryVolumeForEditFromNullVolUsed.

@Test
public void testRemoveLibraryVolumeForEditFromNullVolUsed() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(1002L));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibraryAliquotColumns.VOLUME_USED, "32.4");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, attrs, "post-save");
    Long newId = getSavedId(savedTable, 0);
    LibraryAliquot saved = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId);
    assertLibraryAliquotAttributes(attrs, saved);
    LibraryImpl savedLib = (LibraryImpl) getSession().get(LibraryImpl.class, saved.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", 67.6, savedLib.getVolume()), compareDoubles(savedLib.getVolume(), "67.6"));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 4 with LibraryImpl

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

the class BulkLibraryAliquotIT method testVolumeUsedNoWarning.

@Test
public void testVolumeUsedNoWarning() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForPropagate(getDriver(), getBaseUrl(), Sets.newHashSet(701L));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibraryAliquotColumns.VOLUME_USED, "99.99");
    attrs.put(LibraryAliquotColumns.QC_STATUS, "Not Ready");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, attrs, "post-save");
    Long newId = getSavedId(savedTable, 0);
    LibraryAliquot saved = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId);
    assertLibraryAliquotAttributes(attrs, saved);
    LibraryImpl savedLib = (LibraryImpl) getSession().get(LibraryImpl.class, saved.getLibrary().getId());
    assertTrue("Expected library volume to be positive, received negative value", savedLib.getVolume().compareTo(BigDecimal.ZERO) > 0);
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 5 with LibraryImpl

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

the class DefaultExperimentServiceTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    Mockito.when(namingSchemeHolder.getPrimary()).thenReturn(namingScheme);
    Mockito.when(namingScheme.validateName(Matchers.anyString())).thenReturn(ValidationResult.success());
    experiment.setInstrumentModel(new InstrumentModel());
    experiment.getInstrumentModel().setId(2L);
    experiment.setLibrary(new LibraryImpl());
    experiment.getLibrary().setId(3L);
    experiment.setStudy(new StudyImpl());
    experiment.getStudy().setId(5L);
}
Also used : LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) StudyImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.StudyImpl) InstrumentModel(uk.ac.bbsrc.tgac.miso.core.data.InstrumentModel) Before(org.junit.Before)

Aggregations

LibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl)18 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)14 Test (org.junit.Test)12 BulkLibraryAliquotPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage)8 HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)8 Library (uk.ac.bbsrc.tgac.miso.core.data.Library)7 DetailedLibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl)5 SampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl)5 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)4 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)4 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)4 DetailedSampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)4 WorksetLibrary (uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibrary)4 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)4 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)4 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)4 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)4 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)4 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)4 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)4