Search in sources :

Example 1 with BulkQCPage

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

the class BulkLibraryQCIT method testAutoUpdateConcentration.

@Test
public void testAutoUpdateConcentration() throws Exception {
    // Goal: ensure that volume and volume units are updated by the QC
    BulkQCPage page = getAddPage(Arrays.asList(2201L), 1);
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(QcColumns.DATE, "2018-07-10");
    attrs.put(QcColumns.TYPE, "update concentration qc");
    attrs.put(QcColumns.RESULT, "24.78");
    fillRow(table, 0, attrs);
    assertFalse(table.isWritable(QcColumns.LIBRARY_ALIAS, 0));
    assertFalse(table.isWritable(QcColumns.UNITS, 0));
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    LibraryQC saved = getLatestQc();
    assertQCAttributes(attrs, saved);
    assertEquals(String.format("Expected concentration to be updated to %s, instead got %f", "24.78", saved.getLibrary().getConcentration()), 0, saved.getLibrary().getConcentration().compareTo(new BigDecimal("24.78")));
    assertEquals(String.format("Expected concentration units to be updated to %s, instead got %s", ConcentrationUnit.NANOMOLAR.getUnits(), saved.getLibrary().getConcentrationUnits().getUnits()), ConcentrationUnit.NANOMOLAR, saved.getLibrary().getConcentrationUnits());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryQC(uk.ac.bbsrc.tgac.miso.core.data.qc.LibraryQC) BulkQCPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 2 with BulkQCPage

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

the class BulkLibraryQCIT method testEditQcSetup.

@Test
public void testEditQcSetup() throws Exception {
    // Goal: ensure all expected fields are present and no extra
    Set<String> expectedHeadings = Sets.newHashSet();
    expectedHeadings.addAll(qcColumns);
    BulkQCPage page = getEditPage(Arrays.asList(2201L));
    HandsOnTable table = page.getTable();
    List<String> headings = table.getColumnHeadings();
    assertEquals(expectedHeadings.size(), headings.size());
    for (String col : expectedHeadings) {
        assertTrue("Check for column: '" + col + "'", headings.contains(col));
    }
    assertEquals(1, table.getRowCount());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) BulkQCPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage) Test(org.junit.Test)

Example 3 with BulkQCPage

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

the class BulkPoolQCIT method testEditQcSetup.

@Test
public void testEditQcSetup() throws Exception {
    // Goal: ensure all expected fields are present and no extra
    Set<String> expectedHeadings = Sets.newHashSet();
    expectedHeadings.addAll(qcColumns);
    BulkQCPage page = getEditPage(Arrays.asList(2201L));
    HandsOnTable table = page.getTable();
    List<String> headings = table.getColumnHeadings();
    assertEquals(expectedHeadings.size(), headings.size());
    for (String col : expectedHeadings) {
        assertTrue("Check for column: '" + col + "'", headings.contains(col));
    }
    assertEquals(1, table.getRowCount());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) BulkQCPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage) Test(org.junit.Test)

Example 4 with BulkQCPage

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

the class BulkPoolQCIT method testAutoUpdateVolume.

@Test
public void testAutoUpdateVolume() throws Exception {
    // Goal: ensure that volume and volume units are updated by the QC
    BulkQCPage page = getAddPage(Arrays.asList(2201L), 1);
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(QcColumns.DATE, "2018-07-10");
    attrs.put(QcColumns.TYPE, "update volume qc");
    attrs.put(QcColumns.RESULT, "10.43");
    fillRow(table, 0, attrs);
    assertFalse(table.isWritable(QcColumns.POOL_ALIAS, 0));
    assertFalse(table.isWritable(QcColumns.UNITS, 0));
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    PoolQC saved = getLatestQc();
    assertQCAttributes(attrs, saved);
    assertEquals(String.format("Expected volume to be updated to %s, instead got %f", "10.43", saved.getPool().getVolume()), 0, saved.getPool().getVolume().compareTo(new BigDecimal("10.43")));
    assertEquals(String.format("Expected volume units to be updated to %s, instead got %s", VolumeUnit.MICROLITRES.getUnits(), saved.getPool().getVolumeUnits().getUnits()), VolumeUnit.MICROLITRES, saved.getPool().getVolumeUnits());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) BulkQCPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage) PoolQC(uk.ac.bbsrc.tgac.miso.core.data.qc.PoolQC) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 5 with BulkQCPage

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

the class BulkSampleQCIT method testAddQc.

@Test
public void testAddQc() throws Exception {
    // Goal: ensure a sample QC can be added
    BulkQCPage page = getAddPage(Arrays.asList(2201L), 1);
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(QcColumns.DATE, "2018-07-10");
    attrs.put(QcColumns.TYPE, "test edit qc");
    attrs.put(QcColumns.RESULT, "32.6");
    fillRow(table, 0, attrs);
    assertFalse(table.isWritable(QcColumns.SAMPLE_ALIAS, 0));
    assertFalse(table.isWritable(QcColumns.UNITS, 0));
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    SampleQC saved = getLatestQc();
    assertQCAttributes(attrs, saved);
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) SampleQC(uk.ac.bbsrc.tgac.miso.core.data.qc.SampleQC) BulkQCPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)18 BulkQCPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage)18 HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)18 BigDecimal (java.math.BigDecimal)6 LibraryQC (uk.ac.bbsrc.tgac.miso.core.data.qc.LibraryQC)4 PoolQC (uk.ac.bbsrc.tgac.miso.core.data.qc.PoolQC)4 SampleQC (uk.ac.bbsrc.tgac.miso.core.data.qc.SampleQC)4