Changeset 4803


Ignore:
Timestamp:
Mar 6, 2009, 3:37:33 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #1238: Check performance of BioAssaySetExporter?

Added test code for generating export jobs.

Location:
trunk/src/test/net/sf/basedb/test/performance
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test/net/sf/basedb/test/performance/Run.java

    r4514 r4803  
    7474      tests++;
    7575    }
     76    if (ok && (all || cmds.contains("export")))
     77    {
     78      String bioAssaySet = cmdLine.getOption("-b", null);
     79      if (bioAssaySet != null)
     80      {
     81        ok = ExportTest.run(user, password, bioAssaySet);
     82        tests++;
     83      }
     84      else
     85      {
     86        TestUtil.write("No name for bioassay set specified. Use -b option!\n\n");
     87      }
     88    }
    7689    if (ok && cmds.contains("clean"))
    7790    {
     
    91104  {
    92105    TestUtil.write(
    93       "test.sh performance [-n xxx] [-u user] [-p password] <cmd>\n" +
     106      "test.sh performance [-n xxx] [-u user] [-p password] [-b bioassayset] <cmd>\n" +
    94107      "     -n = number of items to import; default = 100\n" +
    95108      "     -u = username; default = root\n" +
    96109      "     -p = password; default = root\n" +
     110      "     -b = Name of bioassay set to export; no default\n" +
    97111      "     cmd = the tests to run; all, raw\n\n");
    98112   
  • trunk/src/test/net/sf/basedb/test/performance/Util.java

    r4514 r4803  
    124124  }
    125125 
     126  /**
     127    Find all bioassaysets with a matching name using LIKE comparison
     128  */
     129  public static List<BioAssaySet> findAllBioAssaySets(DbControl dc, Experiment experiment, String name)
     130  {
     131    TestUtil.write("--Loading bioassaysets: " + name);
     132    ItemQuery<BioAssaySet> query = experiment.getBioAssaySets();
     133    query.restrict(Restrictions.like(Hql.property("name"), Expressions.string(name)));
     134    query.order(Orders.asc(Hql.property("name")));
     135    List<BioAssaySet> result = query.list(dc);
     136    return result;
     137  }
     138 
    126139 
    127140 
Note: See TracChangeset for help on using the changeset viewer.