Changeset 5688


Ignore:
Timestamp:
Aug 10, 2011, 2:29:52 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #1153: Handling short read transcript sequence data

Fixes some test program failures. Started to re-enable all tests in the TestItemImporter (batch importers). Also need to create a batch DerivedBioAssayImporter that replaces the ScanImporter and add support for linking to extracts from raw bioassays.

Location:
trunk/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java

    r5685 r5688  
    271271    <li>(root) {@link DerivedBioAssay}:s created from this physical bioassay
    272272    <ul>
    273     @since 2.2
    274273  */
    275274  @Override
     
    279278    org.hibernate.Session session = getDbControl().getHibernateSession();
    280279    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    281       "GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY", "dbs.id");
     280      "GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY", "dba.id");
    282281      /*
    283282        SELECT {1}
    284         FROM DerivedBioAssayData dbs
    285         WHERE dbs.physicalBioAssay = :bioAssay
    286         AND dbs.creationEvent.parent is null
     283        FROM DerivedBioAssayData dba
     284        WHERE dba.physicalBioAssay = :bioAssay
     285        AND dba.parent is null
    287286      */
    288287    query.setEntity("bioAssay", this.getData());
     
    311310
    312311  /**
    313     Get the extracts, possible on a specific assay index, and the array slide.
    314     @param index If > 0 only include the extracts which has been
    315       linked with {@link BioMaterialEvent#setSourceGroup(MeasuredBioMaterial, int)}.
     312    Get the extracts, possible on a specific assay poisition, and the array slide.
     313    @param position If > 0 only include the extracts on that
     314      position in the bioassay (see {@link BioMaterialEventSource#getPosition()}.
    316315      If <= 0 include all extracts.
    317316  */
    318317  @SuppressWarnings("unchecked")
    319   public Set<Annotatable> getAnnotatableParents(int index)
     318  public Set<Annotatable> getAnnotatableParents(int position)
    320319    throws BaseException
    321320  {
     
    326325      ItemQuery<Extract> query = (ItemQuery<Extract>)event.getSources();
    327326      query.include(Include.ALL);
    328       if (index > 0)
     327      if (position > 0)
    329328      {
    330329        query.restrict(
    331330          Restrictions.eq(
    332             Hql.property("srcevt", "sourceGroup"),
    333             Expressions.integer(index)
     331            Hql.property("srcevt", "position"),
     332            Expressions.integer(position)
    334333          )
    335334        );
  • trunk/src/core/net/sf/basedb/core/Sample.java

    r5663 r5688  
    216216  {
    217217    Extract e = Extract.getNew(getDbControl(), master);
    218     e.getCreationEvent().setSource(e).setUsedQuantity(usedQuantity);
     218    e.getCreationEvent().setSource(this).setUsedQuantity(usedQuantity);
    219219    return e;
    220220  }
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r5687 r5688  
    4545import net.sf.basedb.core.DataFileType;
    4646import net.sf.basedb.core.DbControl;
     47import net.sf.basedb.core.DerivedBioAssay;
    4748import net.sf.basedb.core.Extract;
    4849import net.sf.basedb.core.File;
     
    15331534    Subsequent calls uses the same query. Thus, this method should always be
    15341535    called with the same id method object, otherwise the result is undefined.
     1536    <p>
     1537    NOTE! A labeled extract is an extract with a subtype {@link Extract#LABELED}
    15351538   
    15361539    @param dc The DbControl to use for database access
     
    16381641    Subsequent calls uses the same query. Thus, this method should always be
    16391642    called with the same id method object, otherwise the result is undefined.
     1643    <p>
     1644    NOTE! A hybridization is a physical bioassay with a subtype {@link
     1645    PhysicalBioAssay#HYBRIDIZATION}
    16401646   
    16411647    @param dc The DbControl to use for database access
     
    16491655    {
    16501656      hybQuery = initReferenceQuery(dc, idMethod, PhysicalBioAssay.getQuery(), false);
    1651     }
    1652     return findReferencedItem(dc, idMethod, hybQuery, identifier, 0, false);
    1653   }
    1654 
     1657      hybQuery.restrictPermanent(
     1658          Restrictions.eq(
     1659            Hql.property("itemSubtype"),
     1660            Expressions.integer(SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION))
     1661          )
     1662        );
     1663    }
     1664    return findReferencedItem(dc, idMethod, hybQuery, identifier, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), false);
     1665  }
     1666
     1667  private ItemQuery<PhysicalBioAssay> physicalBioAssayQuery;
     1668  /**
     1669    Find a physical bioassay with a given identifier. This is a utility method that
     1670    subclasses can use when creating or updating items.
     1671    <p>
     1672    NOTE! The first time this method is called a query object is initialised
     1673    using the {@link IdMethod#prepareQuery(DbControl, ItemQuery)} method.
     1674    Subsequent calls uses the same query. Thus, this method should always be
     1675    called with the same id method object, otherwise the result is undefined.
     1676    <p>
     1677    NOTE! If this method is called with a non-null item subtype parameter and
     1678    no bioassay is found the query will be retried without any subtype.
     1679 
     1680    @param dc The DbControl to use for database access
     1681    @param identifier The identifier protocol
     1682    @param subtype The bioassay subtype, or null if the type doesn't matter
     1683    @return A physical bioassay, or null if no item could be found
     1684    @since 3.0
     1685  */
     1686  protected PhysicalBioAssay findPhysicalBioAssay(DbControl dc, IdMethod idMethod, String identifier, ItemSubtype subtype)
     1687  {
     1688    if (identifier == null) return null;
     1689    if (physicalBioAssayQuery == null)
     1690    {
     1691      physicalBioAssayQuery = initReferenceQuery(dc, idMethod, PhysicalBioAssay.getQuery(), true);
     1692    }
     1693    return findReferencedItemWithSubtype(dc, idMethod, physicalBioAssayQuery, identifier, subtype, false);
     1694  }
     1695
     1696  private ItemQuery<DerivedBioAssay> derivedBioAssayQuery;
     1697  /**
     1698    Find a derived bioassay with a given identifier. This is a utility method that
     1699    subclasses can use when creating or updating items.
     1700    <p>
     1701    NOTE! The first time this method is called a query object is initialised
     1702    using the {@link IdMethod#prepareQuery(DbControl, ItemQuery)} method.
     1703    Subsequent calls uses the same query. Thus, this method should always be
     1704    called with the same id method object, otherwise the result is undefined.
     1705    <p>
     1706    NOTE! If this method is called with a non-null item subtype parameter and
     1707    no bioassay is found the query will be retried without any subtype.
     1708 
     1709    @param dc The DbControl to use for database access
     1710    @param identifier The identifier protocol
     1711    @param subtype The bioassay subtype, or null if the type doesn't matter
     1712    @return A derived bioassay, or null if no item could be found
     1713    @since 3.0
     1714  */
     1715  protected DerivedBioAssay findDerivedBioAssay(DbControl dc, IdMethod idMethod, String identifier, ItemSubtype subtype)
     1716  {
     1717    if (identifier == null) return null;
     1718    if (derivedBioAssayQuery == null)
     1719    {
     1720      derivedBioAssayQuery = initReferenceQuery(dc, idMethod, DerivedBioAssay.getQuery(), true);
     1721    }
     1722    return findReferencedItemWithSubtype(dc, idMethod, derivedBioAssayQuery, identifier, subtype, false);
     1723  }
     1724 
    16551725  private ItemQuery<ArrayDesign> designQuery;
    16561726  /**
     
    20842154              "Only look for items of selected subtypes. If none is selected, all subtypes " +
    20852155              "will be searched. If a single subtype is selected, new items will automatically " +
    2086               "be assiged that subtype.",
     2156              "be assigned that subtype.",
    20872157              new ItemParameterType<ItemSubtype>(ItemSubtype.class, defaultSubtype, false, 0, subtypes)
    20882158            );
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/PhysicalBioAssayImporter.java

    r5662 r5688  
    8888        "Mapping that picks the size of the bioassay. The " +
    8989        "values must be in the numeric format specified by the 'Number format' parameter." +
    90         "Example: \\Num arrays\\",
     90        "Example: \\Size\\",
    9191        optionalColumnMapping
    9292    );
     
    9494  protected static final PluginParameter<String> extractPositionColumnMapping =
    9595    new PluginParameter<String>(
    96         "extractPosition",
     96        "extractPositionColumnMapping",
    9797        "Extract position",
    9898        "Mapping that picks the (1-based) position an extract " +
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/RawBioAssayImporter.java

    r5657 r5688  
    2929import net.sf.basedb.core.DataFileType;
    3030import net.sf.basedb.core.DbControl;
     31import net.sf.basedb.core.DerivedBioAssay;
    3132import net.sf.basedb.core.File;
    3233import net.sf.basedb.core.Item;
     
    3536import net.sf.basedb.core.Path;
    3637import net.sf.basedb.core.PathParameterType;
     38import net.sf.basedb.core.PermissionDeniedException;
    3739import net.sf.basedb.core.Platform;
    3840import net.sf.basedb.core.PlatformVariant;
     
    181183  private Mapper protocolMapper;
    182184  private Mapper softwareMapper;
    183   private Mapper scanMapper;
     185  private Mapper bioAssayMapper;
    184186  private Mapper arrayDesignMapper;
    185187  private Mapper platformMapper;
     
    265267    protocolMapper = getMapper(ffp, (String)job.getValue("protocolColumnMapping"), null, null);
    266268    softwareMapper = getMapper(ffp, (String)job.getValue("softwareColumnMapping"), null, null);
    267     scanMapper = getMapper(ffp, (String)job.getValue("scanColumnMapping"), null, null);
     269    bioAssayMapper = getMapper(ffp, (String)job.getValue("bioAssayColumnMapping"), null, null);
    268270    arrayDesignMapper = getMapper(ffp, (String)job.getValue("arrayDesignColumnMapping"), null, null);
    269271    platformMapper = getMapper(ffp, (String)job.getValue("platformColumnMapping"), null, null);
     
    326328    if (nameMapper != null) rba.setName(nameMapper.getValue(data));
    327329    if (descriptionMapper != null) rba.setDescription(descriptionMapper.getValue(data));
    328     ArrayDesign designFromScan = null;
     330    ArrayDesign designFromBioAssay = null;
     331    if (bioAssayMapper != null)
     332    {
     333      String nameOrId = bioAssayMapper.getValue(data);
     334      DerivedBioAssay bioAssay = findDerivedBioAssay(dc, FallbackIdMethod.NAME_OR_ID, bioAssayMapper.getValue(data), null);
     335      if (nameOrId == null || bioAssay != null) rba.setParentBioAssay(bioAssay);
     336      if (bioAssay != null)
     337      {
     338        try
     339        {
     340          designFromBioAssay = bioAssay.getArrayDesign();
     341        }
     342        catch (PermissionDeniedException ex)
     343        {}
     344      }
     345    }
     346   
    329347    if (!rba.hasData())
    330348    {
     
    333351        String nameOrId = arrayDesignMapper.getValue(data);
    334352        ArrayDesign design = nameOrId == null ?
    335             designFromScan : findArrayDesign(dc, FallbackIdMethod.NAME_OR_ID, nameOrId);
     353            designFromBioAssay : findArrayDesign(dc, FallbackIdMethod.NAME_OR_ID, nameOrId);
    336354        if (nameOrId == null || design != null) rba.setArrayDesign(design);
    337355      }
    338       else if (designFromScan != null)
     356      else if (designFromBioAssay != null)
    339357      {
    340         rba.setArrayDesign(designFromScan);
     358        rba.setArrayDesign(designFromBioAssay);
    341359      }
    342360      // Only do this when updating since the same thing is done in 'createItem'
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java

    r5685 r5688  
    3636import net.sf.basedb.core.SystemItems;
    3737import net.sf.basedb.core.plugin.GuiContext;
     38import net.sf.basedb.core.query.Expressions;
     39import net.sf.basedb.core.query.Hql;
     40import net.sf.basedb.core.query.Restrictions;
    3841import net.sf.basedb.util.parser.FlatFileParser;
    3942import net.sf.basedb.util.parser.Mapper;
     
    211214 
    212215  /**
    213     Calls {@link DerivedBioAssay#getQuery()}.
     216    Calls {@link DerivedBioAssay#getQuery()} and set a subtype filter for
     217    {@link DerivedBioAssay#SCAN}.
    214218  */
    215219  @Override
    216220  protected ItemQuery<DerivedBioAssay> createItemQuery()
    217221  {
    218     return DerivedBioAssay.getQuery();
    219   }
    220  
     222    ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
     223    query.restrictPermanent(
     224        Restrictions.eq(
     225          Hql.property("itemSubtype"),
     226          Expressions.integer(SystemItems.getId(DerivedBioAssay.SCAN))
     227        )
     228      );
     229    return query;
     230  }
     231   
    221232  @Override
    222233  protected void createColumnMappers(FlatFileParser ffp, boolean cropStrings)
     
    249260      hyb = findHybridization(dc, FallbackIdMethod.NAME_OR_ID, hybridizationMapper.getValue(data));
    250261    }
    251 
    252262    DerivedBioAssay scan = DerivedBioAssay.getNew(dc, hyb);
     263    scan.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(DerivedBioAssay.SCAN)));
    253264    updateItem(dc, scan, data);
    254265    return scan;
     
    260271    if (nameMapper != null) scan.setName(nameMapper.getValue(data));
    261272    if (descriptionMapper != null) scan.setDescription(descriptionMapper.getValue(data));
    262     /*
    263     if (hybridizationMapper != null && scan.isInDatabase())
    264     {
    265       String nameOrId = hybridizationMapper.getValue(data);
    266       if (nameOrId != null)
    267       {
    268         PhysicalBioAssay hyb = findHybridization(dc, FallbackIdMethod.NAME_OR_ID, hybridizationMapper.getValue(data));
    269         scan.setHybridization(hyb);
    270       }
    271     }
    272     */
    273273    if (protocolMapper != null)
    274274    {
     
    285285      if (nameOrId == null || scanner != null) scan.setHardware(scanner);
    286286    }
    287    
    288287    updateMultiLineItem(dc, scan, data, 0);
    289288  }
  • trunk/src/test/TestArrayBatch.java

    r5340 r5688  
    200200      dc = TestUtil.getDbControl();
    201201      ItemResultList<ArrayBatch> l = ArrayBatch.getQuery().list(dc);
    202       Trashcan.delete(dc.getSessionControl(), l, true, null);
     202      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     203      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    203204      dc.commit();
    204205      write("--Delete all array batches OK ("+l.size()+")");
  • trunk/src/test/TestArrayDesign.java

    r5623 r5688  
    261261      dc = TestUtil.getDbControl();
    262262      List<ArrayDesign> l = new ArrayList<ArrayDesign>(ArrayDesign.getQuery().list(dc));
     263      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     264      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    263265      dc.commit();
    264       Trashcan.delete(TestUtil.getSessionControl(), l, true, null);
    265266      write("--Delete all array designs OK ("+l.size()+")");
    266267    }
  • trunk/src/test/TestArraySlide.java

    r5340 r5688  
    197197      dc = TestUtil.getDbControl();
    198198      ItemResultList<ArraySlide> l = ArraySlide.getQuery().list(dc);
    199       Trashcan.delete(dc.getSessionControl(), l, true, null);
     199      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     200      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    200201      dc.commit();
    201202      write("--Delete all array slides OK ("+l.size()+")");
  • trunk/src/test/TestBioPlate.java

    r5641 r5688  
    271271      dc = TestUtil.getDbControl();
    272272      ItemResultList<BioPlate> l = BioPlate.getQuery().list(dc);
    273       Trashcan.delete(dc.getSessionControl(), l, true, null);
     273      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     274      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    274275      dc.commit();
    275276      write("--Delete all bioplates OK ("+l.size()+")");
  • trunk/src/test/TestBioPlateEvent.java

    r5630 r5688  
    272272      dc = TestUtil.getDbControl();
    273273      ItemResultList<BioPlateEvent> l = BioPlateEvent.getQuery().list(dc);
    274       Trashcan.delete(dc.getSessionControl(), l, true, null);
     274      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     275      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    275276      dc.commit();
    276277      write("--Delete all bioplate events OK ("+l.size()+")");
  • trunk/src/test/TestBioSource.java

    r5340 r5688  
    179179      dc = TestUtil.getDbControl();
    180180      ItemResultList<BioSource> l = BioSource.getQuery().list(dc);
    181       Trashcan.delete(dc.getSessionControl(), l, true, null);
     181      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     182      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    182183      dc.commit();
    183184      write("--Delete all biosources OK ("+l.size()+")");
  • trunk/src/test/TestDerivedBioAssay.java

    r5685 r5688  
    5757    int child1 = test_create_child("Child #1", id, 0, 0, 0, 0);
    5858    int child2 = test_create_child("Child #2", id, 0, 0, 0, 0);
    59     //int bioAssay1 = test_add_bioassay(id, extractId1, "Bioassay #1");
    60     //int bioAssay2 = test_add_bioassay(id, extractId2, "Bioassay #2");
    6159
    6260    // Listing
     
    6462    test_list(hybridizationId, 2);
    6563    test_list_children(id, 2);
    66     //test_list_bioassays(id, 2);
    6764   
    6865    // Adding files
    6966    int samId = TestFile.test_create("data/test.assembly.sam", false, false);
    70     //TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, bioAssay1, DataFileType.SAM, samId);
     67    TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, child1, DataFileType.SAM, samId);
    7168   
    7269    // Standard test: Delete
     
    280277      dc = TestUtil.getDbControl();
    281278      ItemResultList<DerivedBioAssay> l = DerivedBioAssay.getQuery().list(dc);
    282       Trashcan.delete(dc.getSessionControl(), l, true, null);
     279      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     280      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    283281      dc.commit();
    284282      write("--Delete all derived bioassays OK ("+l.size()+")");
  • trunk/src/test/TestExtract.java

    r5663 r5688  
    2323*/
    2424import net.sf.basedb.core.*;
     25import net.sf.basedb.core.query.Expressions;
     26import net.sf.basedb.core.query.Hql;
     27import net.sf.basedb.core.query.Restrictions;
    2528import net.sf.basedb.core.query.ResultList;
    2629import net.sf.basedb.util.biomaterial.ChildrenTransformer;
     
    6063 
    6164    test_load(id);
    62     test_list(-1);
     65    test_list(0, -1);
    6366   
    6467    write_events_header();
     
    208211  }
    209212
    210   static void test_list(int expectedResults)
    211   {
    212     DbControl dc = null;
    213     try
    214     {
    215       dc = TestUtil.getDbControl();
    216       ItemResultList<Extract> l = Extract.getQuery().list(dc);
     213  static void test_list(int subtypeId, int expectedResults)
     214  {
     215    DbControl dc = null;
     216    try
     217    {
     218      dc = TestUtil.getDbControl();
     219      ItemQuery<Extract> query = Extract.getQuery();
     220      if (subtypeId > 0)
     221      {
     222        query.restrict(Restrictions.eq(Hql.property("itemSubtype"), Expressions.integer(subtypeId)));
     223      }
     224      ItemResultList<Extract> l = query.list(dc);
    217225      for (int i = 0; i<l.size(); i++)
    218226      {
     
    273281      dc = TestUtil.getDbControl();
    274282      ItemResultList<Extract> l = Extract.getQuery().list(dc);
    275       Trashcan.delete(dc.getSessionControl(), l, true, null);
     283      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     284      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    276285      dc.commit();
    277286      write("--Delete all extracts OK ("+l.size()+")");
  • trunk/src/test/TestItemImporter.java

    r5667 r5688  
    2323import net.sf.basedb.core.BaseException;
    2424import net.sf.basedb.core.DbControl;
     25import net.sf.basedb.core.Extract;
    2526import net.sf.basedb.core.File;
    2627import net.sf.basedb.core.Hardware;
     
    100101    int extractJobId = test_create_item_import_job(Item.EXTRACT, extractImporterId, extractFileId);
    101102    ok &= TestJob.test_execute(extractJobId, false);
    102     TestExtract.test_list(4);
     103    TestExtract.test_list(0, 4);
    103104
    104105    // Import labeled extracts
     
    107108    int labledExtractJobId = test_create_item_import_job(Item.EXTRACT, labledExtractImporterId, labledExtractFileId);
    108109    ok &= TestJob.test_execute(labledExtractJobId, false);
    109     TestExtract.test_list(11);
     110    TestExtract.test_list(SystemItems.getId(Extract.LABELED), 7);
    110111   
    111112    // Import array designs
     
    142143
    143144    // Import scans
    144     /*
    145145    int scanFileId = TestFile.test_create("data/test.batchimport.scans.txt", false, false);
    146146    int scanImporterId  = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ScanImporter");
    147     int scanJobId = test_create_item_import_job(Item.SCAN, scanImporterId, scanFileId);
     147    int scanJobId = test_create_item_import_job(Item.DERIVEDBIOASSAY, scanImporterId, scanFileId);
    148148    ok &= TestJob.test_execute(scanJobId, false);
    149     TestScan.test_list(3);
    150     */
     149    TestDerivedBioAssay.test_list(0, 3);
    151150 
    152151    // Import raw bioassays
     
    171170   
    172171    // Delete scans
    173     /*
    174     TestScan.test_delete_all();
     172    TestDerivedBioAssay.test_delete_all();
    175173    TestJob.test_delete(scanJobId);
    176174    TestFile.test_delete(scanFileId);
    177     */
    178175
    179176    // Delete hybridizations
     
    373370      request.setParameterValue("arraySlideColumnMapping", "\\Array slide\\");
    374371    }
    375     /*
    376     if (itemType == Item.SCAN)
     372    if (itemType == Item.DERIVEDBIOASSAY)
    377373    {
    378374      request.setParameterValue("hybridizationColumnMapping", "\\Hybridization\\");
     
    380376      request.setParameterValue("hardwareColumnMapping", "\\Scanner\\");
    381377    }
    382     */
    383378    if (itemType == Item.RAWBIOASSAY)
    384379    {
    385380      request.setParameterValue("dataDirectory", "/");
    386381      request.setParameterValue("arrayIndexColumnMapping", "\\Array index\\");
    387     //  request.setParameterValue("scanColumnMapping", "\\Scan\\");
     382      request.setParameterValue("bioAssayColumnMapping", "\\Scan\\");
    388383      request.setParameterValue("protocolColumnMapping", "\\Protocol\\");
    389384      request.setParameterValue("platformColumnMapping", "\\Platform\\");
  • trunk/src/test/TestMetadata.java

    r5685 r5688  
    5959      test_create_property_path(RawBioAssay.class, "name", false);
    6060    // Association + id property
    61     PropertyPath<RawBioAssay, DerivedBioAssay> scan =
    62       test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.id", false);
     61    PropertyPath<RawBioAssay, Integer> scan =
     62      test_create_property_path(RawBioAssay.class, "parentBioAssay.id", false);
    6363    // Null association
    6464    PropertyPath<RawBioAssay, String> protocolName =
    65       test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.creationEvent.protocol.name", false);
     65      test_create_property_path(RawBioAssay.class, "parentBioAssay.protocol.name", false);
    6666    // Date value
    6767    PropertyPath<RawBioAssay, Date> hybDate =
    68       test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.physicalBioAssay.creationEvent.entryDate", false);
     68      test_create_property_path(RawBioAssay.class, "parentBioAssay.physicalBioAssay.creationEvent.entryDate", false);
    6969    // Long path + case insensitive
    7070    PropertyPath<RawBioAssay, String> design =
    71       test_create_property_path(RawBioAssay.class, "Parent.BioAssaySet.PhysicalBioAssay.Arrayslide.Arraybatch.Arraydesign", false);
     71      test_create_property_path(RawBioAssay.class, "ParentBioAssay.PhysicalBioAssay.Arrayslide.Arraybatch.Arraydesign", false);
    7272    // Component
    7373    PropertyPath<Formula, Float> formulaMinValue =
     
    8080    test_create_property_path(RawBioAssay.class, "foo", true);
    8181    test_create_property_path(RawBioAssay.class, "name.foo", true);
    82     test_create_property_path(RawBioAssay.class, "parent.foo", true);
     82    test_create_property_path(RawBioAssay.class, "parentBioAssay.foo", true);
    8383   
    8484    // Collection of entities should fail
    85     test_create_property_path(DerivedBioAssay.class, "bioAssays", true);
     85    test_create_property_path(DerivedBioAssay.class, "children", true);
    8686   
    8787    int designId = TestArrayDesign.test_create(Platform.GENERIC, true);
     
    9191    int labeledExtractId = TestExtract.test_create(0, "Test extract", SystemItems.getId(Extract.LABELED), labelId, true);
    9292    int hybId = TestPhysicalBioAssay.test_create(slideId, "Test hyb", SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), 1, labeledExtractId);
    93 //    int scanId = TestScan.test_create(hybId, 0, 0, true);
    94 int scanId = 0;
     93    int scanId = TestDerivedBioAssay.test_create_root("Test scan", hybId, SystemItems.getId(DerivedBioAssay.SCAN), 0, 0, 0);
    9594    int rawId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "My raw bioassay",
    9695        scanId, 0, 0, designId, true);
     
    111110    TestFormula.test_delete(formulaId);
    112111    TestRawBioAssay.test_delete(rawId);
    113 //    TestScan.test_delete(scanId);
     112    TestDerivedBioAssay.test_delete(scanId);
    114113    TestPhysicalBioAssay.test_delete(hybId);
    115114    TestExtract.test_delete(labeledExtractId);
  • trunk/src/test/TestPhysicalBioAssay.java

    r5663 r5688  
    219219      dc = TestUtil.getDbControl();
    220220      ItemResultList<PhysicalBioAssay> l = PhysicalBioAssay.getQuery().list(dc);
    221       Trashcan.delete(dc.getSessionControl(), l, true, null);
     221      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     222      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    222223      dc.commit();
    223224      write("--Delete all physical bioassay OK ("+l.size()+")");
  • trunk/src/test/TestRawBioAssay.java

    r5685 r5688  
    265265      List<RawBioAssay> l = new ArrayList<RawBioAssay>(RawBioAssay.getQuery().list(dc));
    266266      dc.commit();
    267       Trashcan.delete(TestUtil.getSessionControl(), l, true, null);
     267      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     268      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    268269      write("--Delete all raw bioassays OK ("+l.size()+")");
    269270    }
  • trunk/src/test/TestSample.java

    r5663 r5688  
    263263      dc = TestUtil.getDbControl();
    264264      ItemResultList<Sample> l = Sample.getQuery().list(dc);
    265       Trashcan.delete(dc.getSessionControl(), l, true, null);
     265      int numDeleted = Trashcan.delete(dc.getSessionControl(), l, true, null);
     266      if (numDeleted != l.size()) throw new BaseException("Could not delete all items: " + numDeleted + " of " + l.size());
    266267      dc.commit();
    267268      write("--Delete all samples OK ("+l.size()+")");
Note: See TracChangeset for help on using the changeset viewer.