Search in sources :

Example 26 with DetailedLibrary

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

the class BulkLibraryIT method testPropagateToEditToPropagate.

@Test
public void testPropagateToEditToPropagate() {
    // propagate sample to library
    BulkLibraryPage page = BulkLibraryPage.getForPropagate(getDriver(), getBaseUrl(), Arrays.asList(100004L), Arrays.asList(1));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibColumns.SOP, "Library SOP 1 v.2.0");
    attrs.put(LibColumns.CODE, "WG (Whole Genome)");
    attrs.put(LibColumns.PLATFORM, "Illumina");
    attrs.put(LibColumns.LIBRARY_TYPE, "Paired End");
    attrs.put(LibColumns.SELECTION, "CAGE");
    attrs.put(LibColumns.STRATEGY, "AMPLICON");
    attrs.put(LibColumns.INDEX_FAMILY, NO_INDEX_FAMILY);
    attrs.put(LibColumns.KIT_DESCRIPTOR, "Test Kit");
    attrs.put(LibColumns.KIT_LOT, "20200728");
    attrs.put(LibColumns.SIZE, "207");
    attrs.put(LibColumns.QC_STATUS, "Not Ready");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    long newId = getSavedId(savedTable, 0);
    DetailedLibrary saved = (DetailedLibrary) getSession().get(LibraryImpl.class, newId);
    assertDetailedLibraryAttributes(attrs, saved);
    // chain edit library
    BulkLibraryPage page2 = page.chainEdit();
    HandsOnTable table2 = page2.getTable();
    assertColumnValues(table2, 0, attrs, "reload for edit");
    table2.enterText(LibColumns.SELECTION, 0, "cDNA");
    attrs.put(LibColumns.SELECTION, "cDNA");
    assertTrue(page2.save(false));
    HandsOnTable savedTable2 = page2.getTable();
    assertColumnValues(savedTable2, 0, attrs, "edit post-save");
    DetailedLibrary saved2 = (DetailedLibrary) getSession().get(LibraryImpl.class, newId);
    assertDetailedLibraryAttributes(attrs, saved2);
    // chain propagate library to library aliquot
    assertNotNull(page2.chainPropagateLibraryAliquots());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) BulkLibraryPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryPage) Test(org.junit.Test)

Example 27 with DetailedLibrary

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

the class BulkLibraryIT method testPropagateTwoMinimal.

@Test
public void testPropagateTwoMinimal() {
    BulkLibraryPage page = BulkLibraryPage.getForPropagate(getDriver(), getBaseUrl(), Arrays.asList(100004L), Arrays.asList(2));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibColumns.SOP, "Library SOP 1 v.2.0");
    attrs.put(LibColumns.CODE, "WG (Whole Genome)");
    attrs.put(LibColumns.PLATFORM, "Illumina");
    attrs.put(LibColumns.LIBRARY_TYPE, "Paired End");
    attrs.put(LibColumns.SELECTION, "CAGE");
    attrs.put(LibColumns.STRATEGY, "AMPLICON");
    attrs.put(LibColumns.INDEX_FAMILY, NO_INDEX_FAMILY);
    attrs.put(LibColumns.KIT_DESCRIPTOR, "Test Kit");
    attrs.put(LibColumns.KIT_LOT, "20200728");
    attrs.put(LibColumns.SIZE, "205");
    attrs.put(LibColumns.QC_STATUS, "Not Ready");
    fillRow(table, 0, attrs);
    fillRow(table, 1, attrs);
    table.enterText(LibColumns.SIZE, 1, "206");
    assertColumnValues(table, 0, attrs, "pre-save");
    attrs.put(LibColumns.SIZE, "206");
    assertColumnValues(table, 1, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    attrs.put(LibColumns.SIZE, "205");
    Long newId1 = getSavedId(savedTable, 0);
    Long newId2 = getSavedId(savedTable, 1);
    DetailedLibrary saved1 = (DetailedLibrary) getSession().get(LibraryImpl.class, newId1);
    DetailedLibrary saved2 = (DetailedLibrary) getSession().get(LibraryImpl.class, newId2);
    assertDetailedLibraryAttributes(attrs, saved1);
    attrs.put(LibColumns.SIZE, "205");
    assertDetailedLibraryAttributes(attrs, saved2);
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) BulkLibraryPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryPage) Test(org.junit.Test)

Example 28 with DetailedLibrary

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

the class BulkLibraryIT method testEditTwice.

@Test
public void testEditTwice() {
    // edit once
    BulkLibraryPage page = BulkLibraryPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(100004L));
    HandsOnTable table = page.getTable();
    assertEquals("libdesc100004", table.getText(LibColumns.DESCRIPTION, 0));
    String descEdit1 = "changed once";
    table.enterText(LibColumns.DESCRIPTION, 0, descEdit1);
    assertEquals(descEdit1, table.getText(LibColumns.DESCRIPTION, 0));
    assertTrue(page.save(false));
    DetailedLibrary saved = (DetailedLibrary) getSession().get(LibraryImpl.class, 100004L);
    assertEquals(descEdit1, saved.getDescription());
    // edit twice
    BulkLibraryPage page2 = page.chainEdit();
    HandsOnTable table2 = page2.getTable();
    assertEquals(descEdit1, table2.getText(LibColumns.DESCRIPTION, 0));
    String descEdit2 = "changed twice";
    table2.enterText(LibColumns.DESCRIPTION, 0, descEdit2);
    assertEquals(descEdit2, table2.getText(LibColumns.DESCRIPTION, 0));
    assertTrue(page2.save(false));
    DetailedLibrary saved2 = (DetailedLibrary) getSession().get(LibraryImpl.class, 100004L);
    assertEquals(descEdit2, saved2.getDescription());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) BulkLibraryPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryPage) Test(org.junit.Test)

Example 29 with DetailedLibrary

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

the class BulkLibraryIT method testDiscardFromBox.

@Test
public void testDiscardFromBox() {
    Long libId = 100007L;
    DetailedLibrary before = (DetailedLibrary) getSession().get(LibraryImpl.class, libId);
    assertNotNull(before.getBox());
    assertEquals("BOX100001", before.getBox().getName());
    assertEquals("A03", before.getBoxPosition());
    assertFalse(before.isDiscarded());
    BulkLibraryPage page = BulkLibraryPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(libId));
    HandsOnTable table = page.getTable();
    table.enterText(LibColumns.DISCARDED, 0, "True");
    table.clearField(LibColumns.BOX_ALIAS, 0);
    assertTrue(page.save(false));
    DetailedLibrary after = (DetailedLibrary) getSession().get(LibraryImpl.class, libId);
    assertNull(after.getBox());
    assertNull(after.getBoxPosition());
    assertTrue(after.isDiscarded());
}
Also used : HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) BulkLibraryPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryPage) Test(org.junit.Test)

Example 30 with DetailedLibrary

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

the class LibraryPageIT method testChangeValues.

@Test
public void testChangeValues() throws Exception {
    LibraryPage page = LibraryPage.get(getDriver(), getBaseUrl(), 110001L);
    // check initial values
    Map<Field, String> fields = Maps.newLinkedHashMap();
    fields.put(Field.ID, "110001");
    fields.put(Field.NAME, "LIB110001");
    fields.put(Field.ALIAS, "1LIB_0001_Ly_P_PE_251_WG");
    fields.put(Field.BARCODE, "libbar110001");
    fields.put(Field.DESCRIPTION, "libdesc110001");
    fields.put(Field.CREATION_DATE, "2017-07-24");
    fields.put(Field.PLATFORM, "Illumina");
    fields.put(Field.LIBRARY_TYPE, "Paired End");
    fields.put(Field.DESIGN, "None");
    fields.put(Field.DESIGN_CODE, "WG (Whole Genome)");
    fields.put(Field.SELECTION, "PCR");
    fields.put(Field.STRATEGY, "WGS");
    fields.put(Field.INDEX_FAMILY, "Dual Index 6bp");
    fields.put(Field.INDEX_1, "A01 (AAACCC)");
    fields.put(Field.INDEX_2, "B01 (AAATTT)");
    fields.put(Field.DETAILED_QC_STATUS, "Failed: QC");
    fields.put(Field.LOW_QUALITY, "false");
    fields.put(Field.SIZE, "251");
    fields.put(Field.VOLUME, "2.5");
    fields.put(Field.DISCARDED, "false");
    fields.put(Field.LOCATION, null);
    fields.put(Field.BOX_LOCATION, "n/a");
    fields.put(Field.KIT, "Test Kit");
    fields.put(Field.CONCENTRATION, "10.0");
    fields.put(Field.ARCHIVED, "false");
    assertFieldValues("loaded", fields, page);
    // make changes
    Map<Field, String> changes = Maps.newLinkedHashMap();
    changes.put(Field.ALIAS, "1LIB_0001_Ly_P_PE_151_WG");
    changes.put(Field.BARCODE, "newbarcode");
    changes.put(Field.DESCRIPTION, "libdesc_changed_110001");
    changes.put(Field.LIBRARY_TYPE, "Total RNA");
    changes.put(Field.DESIGN_CODE, "MR (mRNA)");
    changes.put(Field.SELECTION, "cDNA");
    changes.put(Field.STRATEGY, "RNA-Seq");
    changes.put(Field.INDEX_FAMILY, "Single Index 6bp");
    changes.put(Field.INDEX_1, "Index 01 (AAAAAA)");
    changes.put(Field.DETAILED_QC_STATUS, "Ready");
    changes.put(Field.LOW_QUALITY, "true");
    changes.put(Field.SIZE, "151");
    changes.put(Field.VOLUME, "0.5");
    changes.put(Field.LOCATION, "on the floor");
    changes.put(Field.KIT, "Test Kit Two");
    changes.put(Field.CONCENTRATION, "8.33");
    changes.put(Field.ARCHIVED, "true");
    page.setFields(changes);
    // copy unchanged
    fields.forEach((key, val) -> {
        if (!changes.containsKey(key))
            changes.put(key, val);
    });
    changes.remove(Field.INDEX_2);
    assertFieldValues("changes pre-save", changes, page);
    LibraryPage page2 = page.save();
    assertNotNull(page2);
    assertFieldValues("changes post-save", changes, page2);
    DetailedLibrary lib = (DetailedLibrary) getSession().get(LibraryImpl.class, 110001L);
    assertDetailedLibraryAttributes(changes, lib);
}
Also used : Field(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.LibraryPage.Field) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.LibraryPage) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) Test(org.junit.Test)

Aggregations

DetailedLibrary (uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary)30 Test (org.junit.Test)22 LibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl)16 BulkLibraryPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryPage)12 HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)12 DetailedSample (uk.ac.bbsrc.tgac.miso.core.data.DetailedSample)8 DetailedLibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl)8 DetailedSampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)6 LibraryDesignCode (uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode)5 LibraryType (uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType)4 Library (uk.ac.bbsrc.tgac.miso.core.data.Library)3 DetailedLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot)3 LibraryPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.LibraryPage)3 Field (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.LibraryPage.Field)3 DateFormat (java.text.DateFormat)2 SimpleDateFormat (java.text.SimpleDateFormat)2 LibraryDesign (uk.ac.bbsrc.tgac.miso.core.data.LibraryDesign)2 SampleIdentity (uk.ac.bbsrc.tgac.miso.core.data.SampleIdentity)2 TransferLibrary (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary)2 ValidationError (uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationError)2