Search in sources :

Example 1 with BulkSequencingOrderPage

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

the class BulkSequencingOrderIT method testCreateSetup.

@Test
public void testCreateSetup() {
    BulkSequencingOrderPage page = BulkSequencingOrderPage.getForCreate(getDriver(), getBaseUrl(), Sets.newHashSet(120001L, 120002L, 120003L));
    HandsOnTable table = page.getTable();
    List<String> headings = table.getColumnHeadings();
    List<String> expectedColumns = BulkSequencingOrderPage.Columns.all();
    assertEquals(expectedColumns.size(), headings.size());
    for (String col : expectedColumns) {
        assertTrue("Check for column: '" + col + "'", headings.contains(col));
    }
    assertEquals(3, table.getRowCount());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) BulkSequencingOrderPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkSequencingOrderPage) Test(org.junit.Test)

Example 2 with BulkSequencingOrderPage

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

the class BulkSequencingOrderIT method testCreate.

@Test
public void testCreate() {
    BulkSequencingOrderPage page = BulkSequencingOrderPage.getForCreate(getDriver(), getBaseUrl(), Sets.newHashSet(120001L));
    HandsOnTable table = page.getTable();
    // test initial values
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(Columns.NAME, "IPO120001");
    attrs.put(Columns.ALIAS, "1IPO_POOL_1");
    assertColumnValues(table, 0, attrs, "initial");
    // make changes
    Map<String, String> changes = Maps.newLinkedHashMap();
    changes.put(Columns.PURPOSE, "Production");
    changes.put(Columns.INSTRUMENT_MODEL, "Illumina HiSeq 2500");
    changes.put(Columns.CONTAINER_MODEL, "Generic 8-Lane Illumina Flow Cell");
    changes.put(Columns.PARAMETERS, "1x151");
    changes.put(Columns.PARTITIONS, "3");
    changes.put(Columns.DESCRIPTION, "test");
    fillRow(table, 0, changes);
    changes.putAll(attrs);
    assertColumnValues(table, 0, changes, "changes pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    // not shown after save as it's not actually saved
    changes.remove(Columns.INSTRUMENT_MODEL);
    assertColumnValues(savedTable, 0, changes, "post-save");
    Pool pool = (Pool) getSession().get(PoolImpl.class, 120001L);
    @SuppressWarnings("unchecked") List<SequencingOrder> orders = getSession().createCriteria(SequencingOrderImpl.class).add(Restrictions.eq("pool", pool)).list();
    assertEquals(1, orders.size());
    assertEquals(changes.get(Columns.PARAMETERS), orders.get(0).getSequencingParameter().getName());
    assertEquals(Integer.valueOf(3), orders.get(0).getPartitions());
    assertEquals("test", orders.get(0).getDescription());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) BulkSequencingOrderPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkSequencingOrderPage) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) PoolImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 BulkSequencingOrderPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkSequencingOrderPage)2 HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)2 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)1 SequencingOrder (uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder)1 PoolImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl)1