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