Search in sources :

Example 1 with LibraryAliquot

use of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot 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 LibraryAliquot

use of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot 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 LibraryAliquot

use of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot 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 LibraryAliquot

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

the class BoxPageIT method testDiscardTube.

@Test
public void testDiscardTube() {
    final String position = "C01";
    // confirm values pre-save
    BoxPage page = getBoxPage(500L);
    BoxVisualization visualization = page.getVisualization();
    assertFalse("check that position C01 is full", visualization.isEmptyPosition(position));
    assertTrue("check that title matches LDI name", visualization.getPositionTitle(position).contains("TIB_0001_nn_n_PE_404_WG"));
    Box initial = (Box) getSession().get(BoxImpl.class, 500L);
    assertNotNull(initial.getBoxPositions().get(position));
    LibraryAliquot initialLD = (LibraryAliquot) getSession().get(LibraryAliquot.class, 504L);
    assertFalse("check that boxable is not discarded", initialLD.isDiscarded());
    assertFalse("check that boxable location is not EMPTY", "EMPTY".equals(BoxUtils.makeLocationLabel(initialLD)));
    // discard the tube
    visualization.selectPosition(position);
    visualization.discardTube();
    // confirm values post-discard
    BoxPage newPage = getBoxPage(500L);
    BoxVisualization newVisualization = newPage.getVisualization();
    assertTrue("check that position C01 is now empty", newVisualization.isEmptyPosition(position));
    Box box = (Box) getSession().get(BoxImpl.class, 500L);
    assertNull(box.getBoxPositions().get(position));
    LibraryAliquot boxable = (LibraryAliquot) getSession().get(LibraryAliquot.class, 504L);
    assertTrue("check that boxable is discarded", boxable.isDiscarded());
    assertEquals("check that boxable volume is null", 0, boxable.getVolume().compareTo(BigDecimal.ZERO));
    assertEquals("check that boxable location is empty", "EMPTY", BoxUtils.makeLocationLabel(boxable));
}
Also used : BoxVisualization(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BoxVisualization) BoxImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl) Box(uk.ac.bbsrc.tgac.miso.core.data.Box) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) BoxPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BoxPage) Test(org.junit.Test)

Example 5 with LibraryAliquot

use of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot 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)

Aggregations

LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)51 Test (org.junit.Test)24 LibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl)14 BulkLibraryAliquotPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage)12 HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)12 DetailedLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot)11 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)10 Library (uk.ac.bbsrc.tgac.miso.core.data.Library)8 ArrayList (java.util.ArrayList)6 RunPartitionAliquot (uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot)6 TransferLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot)6 Criteria (org.hibernate.Criteria)5 DetachedCriteria (org.hibernate.criterion.DetachedCriteria)5 Partition (uk.ac.bbsrc.tgac.miso.core.data.Partition)5 Run (uk.ac.bbsrc.tgac.miso.core.data.Run)5 WorksetLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibraryAliquot)5 PostMapping (org.springframework.web.bind.annotation.PostMapping)4 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)4 DetailedLibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl)4 OrderLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.OrderLibraryAliquot)4