Changeset 2568


Ignore:
Timestamp:
Aug 22, 2006, 2:22:13 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #221: Create enhanced test procedure.
References #222: Automated test program suite for enhanced test procedure.

Location:
trunk
Files:
8 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/styles.css

    r2525 r2568  
    3030}
    3131
    32 td {
     32td, th {
    3333  font-family: verdana, arial, sans-serif;
    3434  font-size: 10pt;
     
    165165.red {
    166166  background: #FF0000;
    167   xborder: 1px solid #000000;
    168167  width: 20px;
    169168  text-align: center;
     
    172171.yellow {
    173172  background: #FFFF00;
    174   xborder: 1px solid #000000;
    175173  width: 20px;
    176174  text-align: center;
     
    179177.green {
    180178  background: #00FF00;
    181   xborder: 1px solid #000000;
    182179  width: 20px;
    183180  text-align: center;
    184181  font-weight: bold;
    185182}
     183
     184table.listing {
     185  border: 1px solid #999999;
     186  width: 100%;
     187}
     188table.listing tr {
     189  vertical-align: top;
     190}
     191table.listing th {
     192  text-align: left;
     193  background: #E0E0E0;
     194  border-bottom: 1px solid #999999;
     195}
     196table.listing tr.oddrow {
     197}
     198table.listing tr.evenrow, .shaded {
     199  background: #E0E0E0;
     200}
     201
     202
     203
  • trunk/src/test/net/sf/basedb/test/TestUtil.java

    r2314 r2568  
    2424package net.sf.basedb.test;
    2525
     26import java.io.FileWriter;
     27import java.io.Writer;
    2628import java.net.InetAddress;
    2729
     
    5052  private static String client = "net.sf.basedb.clients.test";
    5153  private static SessionControl sc = null;
     54  private static Writer memoryLog = null;
     55  private static long startTime = 0;
     56  private static Runtime runtime = Runtime.getRuntime();
    5257
    5358  /**
    5459    Start the testing. Starts BASE and creates a SessionControl.
    5560  */
    56   public static void begin()
     61  public static void begin(boolean logMemoryUsage)
    5762  {
    5863    if (Application.isRunning()) return;
     
    6065    {
    6166      write("++Starting BASE...");
    62       Application.start();
     67      if (logMemoryUsage)
     68      {
     69        memoryLog = new FileWriter("memory.log");
     70        memoryLog.write("Time (ms)\tTotal\tFree\tUsed\n");
     71        startTime = System.currentTimeMillis();
     72      }
     73      Application.start(false);
    6374      sc = Application.newSessionControl(client, getLocalIp(), null);
    6475      write("done.\n");
     
    8394      if (sc != null && sc.isLoggedIn()) sc.logout();
    8495      Application.stop();
     96      if (memoryLog != null) memoryLog.close();
    8597      write("done.\n");
    8698    }
     
    96108  public static SessionControl getSessionControl()
    97109  {
    98     if (sc == null) begin();
     110    if (sc == null) begin(false);
    99111    return sc;
    100112  }
     
    105117  public static DbControl getDbControl()
    106118  {
     119    if (memoryLog != null)
     120    {
     121      try
     122      {
     123        long time = System.currentTimeMillis() - startTime;
     124        long total = runtime.totalMemory();
     125        long free = runtime.freeMemory();
     126        long used = total - free;
     127        memoryLog.write(time + "\t" + total +"\t"+free+"\t"+used+"\n");
     128        memoryLog.flush();
     129      }
     130      catch (Throwable t)
     131      {}
     132    }
    107133    return getSessionControl().newDbControl();
    108134  }
  • trunk/src/test/net/sf/basedb/test/roles/AnalysisTest.java

    r2314 r2568  
    176176      job.setParameterValue("delta", new FloatParameterType(), 0.1f);
    177177      job.setParameterValue("iter", new IntegerParameterType(), 4);
    178       job.setParameterValue("blockGroup", new IntegerParameterType(), 100);
     178      job.setParameterValue("blockGroup", new IntegerParameterType(), 1);
    179179     
    180180      dc.saveItem(job);
  • trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java

    r2548 r2568  
    120120      Protocol printing = createProtocol(dc, "Printing A", ProtocolType.PRINTING);
    121121     
     122      Hardware hybStation = createHardware(dc, "Hybridization station A", HardwareType.HYBRIDIZATION_STATION);
    122123      Hardware robot = createHardware(dc, "Print robot A", HardwareType.PRINT_ROBOT);
    123124      Hardware scanner = createHardware(dc, "Scanner A", HardwareType.SCANNER);
     
    167168      dc = TestUtil.getDbControl();
    168169      ArrayDesign design = createArrayDesign(dc, "Array design A");
     170      dc.commit();
     171
     172      importFeatures(printMapImporter, printMap, design);
     173     
     174      dc = TestUtil.getDbControl();
    169175      ArrayBatch batch = createArrayBatch(dc, "Array batch A", design, robot, printing);
    170176      ArraySlide slide1 = createArraySlide(dc, "Array slide A.1", batch, 1);
    171177      ArraySlide slide2 = createArraySlide(dc, "Array slide A.2", batch, 2);
    172       dc.commit();
    173 
    174       importFeatures(printMapImporter, printMap, design);
     178      ArraySlide slide3 = createArraySlide(dc, "Array slide A.3", batch, 3);
     179      ArraySlide slide4 = createArraySlide(dc, "Array slide A.4", batch, 4);
     180      dc.commit();
     181
    175182      TestUtil.logout();
    176183    }
     
    450457    parameters.put("dataSplitterRegexp", "\\t");
    451458    parameters.put("ignoreRegexp", ".*(NoOligoInfo|no clone).*");
    452     parameters.put("dataHeaderRegexp", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*");
     459    if (dyeSwap)
     460    {
     461      parameters.put("dataHeaderRegexp", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*\"Ratio of Medians \\(635\\/532\\)\".*");   
     462    }
     463    else
     464    {
     465      parameters.put("dataHeaderRegexp", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*\"Ratio of Medians \\(532\\/635\\)\".*");
     466    }
    453467    parameters.put("minDataColumns", 48);
    454468    parameters.put("maxDataColumns", 48);     
  • trunk/src/test/net/sf/basedb/test/roles/Run.java

    r2259 r2568  
    4444    Set<String> cmds = new HashSet<String>(Arrays.asList(args));
    4545    boolean all = cmds.contains("all");
     46    boolean logMemoryUsage = cmds.contains("-m");
    4647   
    4748    int tests = 0;
     
    4950    if (ok && (all || cmds.contains("root")))
    5051    {
    51       TestUtil.begin();
     52      TestUtil.begin(logMemoryUsage);
    5253      ok = RootTest.run();
    5354      tests++;
     
    5556    if (ok && (all || cmds.contains("admin")))
    5657    {
    57       TestUtil.begin();
     58      TestUtil.begin(logMemoryUsage);
    5859      ok = AdminTest.run();
    5960      tests++;
     
    6162    if (ok && (all || cmds.contains("power")))
    6263    {
    63       TestUtil.begin();
     64      TestUtil.begin(logMemoryUsage);
    6465      ok = PowerUserTest.run();
    6566      tests++;
     
    6768    if (ok && (all || cmds.contains("user")))
    6869    {
    69       TestUtil.begin();
     70      TestUtil.begin(logMemoryUsage);
    7071      ok = UserTest.run();
    7172      tests++;
     
    7374    if (ok && (all || cmds.contains("guest")))
    7475    {
    75       TestUtil.begin();
     76      TestUtil.begin(logMemoryUsage);
    7677      ok = GuestTest.run();
    7778      tests++;
     
    8990  {
    9091    TestUtil.write(
    91       "test.sh roles <cmds>\n" +
     92      "test.sh roles [-m] <cmds>\n" +
     93      "     -m = log memory usage to file memory.log\n" +
    9294      "     cmds = list of tests to run; all, root, admin, power, user, guest\n\n");
    9395   
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r2548 r2568  
    9292      Extract eRef = createExtract(dc, "Extract A.ref", sRef);
    9393     
    94       LabeledExtract le1 = createLabeledExtract(dc, "Labeled extract A.00h", e1, "cy3");
    95       LabeledExtract le2 = createLabeledExtract(dc, "Labeled extract A.24h", e2, "cy3");
    96       LabeledExtract leRef = createLabeledExtract(dc, "Labeled extract A.ref", eRef, "cy5");
     94      Label cy3 = Util.findLabel(dc, "cy3");     
     95      Label cy5 = Util.findLabel(dc, "cy5");     
     96      LabeledExtract le1 = createLabeledExtract(dc, "Labeled extract A.00h", e1, cy3);
     97      LabeledExtract le2 = createLabeledExtract(dc, "Labeled extract A.24h", e2, cy3);
     98      LabeledExtract leRef = createLabeledExtract(dc, "Labeled extract A.ref", eRef, cy5);
     99      LabeledExtract le1DyeSwap = createLabeledExtract(dc, "Labeled extract A.00h (dye-swap)", e1, cy5);
     100      LabeledExtract le2DyeSwap = createLabeledExtract(dc, "Labeled extract A.24h (dye-swap)", e2, cy5);
     101      LabeledExtract leRefDyeSwap = createLabeledExtract(dc, "Labeled extract A.ref (dye-swap)", eRef, cy3);
    97102      dc.commit();
    98103     
     
    101106      Hybridization h1 = createHybridization(dc, "Hybridization A.00h", "Array slide A.1", le1, leRef);
    102107      Hybridization h2 = createHybridization(dc, "Hybridization A.24h", "Array slide A.2", le2, leRef);
     108      Hybridization h1DyeSwap = createHybridization(dc, "Hybridization A.00h (dye-swap)", "Array slide A.3", le1, leRef);
     109      Hybridization h2DyeSwap = createHybridization(dc, "Hybridization A.24h (dye-swap)", "Array slide A.4", le2, leRef);
    103110
    104111      Scan sc1 = createScan(dc, "Scan A.00h", h1);
    105112      Scan sc2 = createScan(dc, "Scan A.24h", h2);
     113      Scan sc1DyeSwap = createScan(dc, "Scan A.00h (dye-swap)", h1DyeSwap);
     114      Scan sc2DyeSwap = createScan(dc, "Scan A.24h (dye-swap)", h2DyeSwap);
    106115     
    107116      // Images
     
    111120      RawBioAssay rba1 = createRawBioAssay(dc, "Raw bioassay A.00h", sc1);
    112121      RawBioAssay rba2 = createRawBioAssay(dc, "Raw bioassay A.24h", sc2);
    113       RawBioAssay rba1DyeSwap = createRawBioAssay(dc, "Raw bioassay A.00h (dye-swap)", sc1);
    114       RawBioAssay rba2DyeSwap = createRawBioAssay(dc, "Raw bioassay A.24h (dye-swap)", sc2);
     122      RawBioAssay rba1DyeSwap = createRawBioAssay(dc, "Raw bioassay A.00h (dye-swap)", sc1DyeSwap);
     123      RawBioAssay rba2DyeSwap = createRawBioAssay(dc, "Raw bioassay A.24h (dye-swap)", sc2DyeSwap);
    115124      inheritAnnotations(dc, rba1, s1, bioSource);
    116125      inheritAnnotations(dc, rba2, s2, bioSource);
     
    219228    Create a labeled extract.
    220229  */
    221   public static LabeledExtract createLabeledExtract(DbControl dc, String name, Extract extract, String labelName)
     230  public static LabeledExtract createLabeledExtract(DbControl dc, String name, Extract extract, Label label)
    222231  {
    223232    TestUtil.write("--Creating labeled extract: " + name + "\n");
    224    
    225     Label label = Util.findLabel(dc, labelName);
    226233   
    227234    LabeledExtract labeledExtract = LabeledExtract.getNew(dc, label);
     
    245252    BioMaterialEvent creationEvent = hyb.getCreationEvent();
    246253    creationEvent.setProtocol(Util.findProtocol(dc, "Hybridization A"));
     254    creationEvent.setHardware(Util.findHardware(dc, "Hybridization station A"));
    247255    for (LabeledExtract le : extracts)
    248256    {
Note: See TracChangeset for help on using the changeset viewer.