Search in sources :

Example 1 with BulkLibraryAliquotPage

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage 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 BulkLibraryAliquotPage

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage 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 3 with BulkLibraryAliquotPage

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage in project miso-lims by miso-lims.

the class BulkLibraryAliquotIT method testRepropagateSetup.

@Test
public void testRepropagateSetup() throws Exception {
    // Goal: ensure all expected fields are present and no extra
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForRepropagate(getDriver(), getBaseUrl(), Sets.newHashSet(304L));
    Set<String> expectedColumns = Sets.newHashSet();
    expectedColumns.addAll(commonColumns);
    expectedColumns.addAll(propagateColumns);
    HandsontableUtils.testTableSetup(page, expectedColumns, 1);
    HandsOnTable table = page.getTable();
    assertEquals("DILT_0001_nn_n_PE_304_WG", table.getText(LibraryAliquotColumns.PARENT_ALIAS, 0));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) Test(org.junit.Test)

Example 4 with BulkLibraryAliquotPage

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage 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 5 with BulkLibraryAliquotPage

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage 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)

Aggregations

Test (org.junit.Test)18 BulkLibraryAliquotPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage)18 HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)17 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)12 LibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl)8 LinkedHashMap (java.util.LinkedHashMap)1