Changeset 5690


Ignore:
Timestamp:
Aug 11, 2011, 12:01:32 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #1153: Handling short read transcript sequence data

Fixed 'set owner' test so that it now uses a Tag instead of a Label.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test/TestUser.java

    r5689 r5690  
    5555    test_duplicate(id);
    5656
     57    // Extra test: create an item and change the owner
     58    int tag_id = TestTag.test_create("Test tag for setting owner", 0, false);
     59    test_set_owner(id, Item.TAG, tag_id);
     60   
    5761    // Extra tests: add, list and remove groups
    5862    int groupId = TestGroup.test_create(true);
     
    8589    TestProject.test_delete(projectId);
    8690
    87     // Extra test: create an item and change the owner
    88 //    TODO (#1153)
    89 //    int label_id = TestLabel.test_create();
    90 //    test_set_owner(id, label_id);
    91 //    TestLabel.test_delete(label_id);
    92 
    9391    // Standard test: Delete
     92    TestTag.test_delete(tag_id);
    9493    test_delete(base1Id);
    9594    test_delete(id);
     
    444443  }
    445444
    446 /*
    447   TODO (#1153)
    448   static void test_set_owner(int id, int label_id)
    449   {
    450     if (id == 0 || label_id == 0) return;
    451     BaseControl bc = null;
    452     try
    453     {
    454       bc = TestUtil.getBaseControl();
    455       User u = User.getById(bc, id);
    456       Label l = Label.getById(bc, label_id);
    457       l.setOwner(u);
    458       l.save();
    459       bc.commit();
     445  static void test_set_owner(int id, Item itemType, int item_id)
     446  {
     447    if (id == 0 || item_id == 0) return;
     448    DbControl dc = null;
     449    try
     450    {
     451      dc = TestUtil.getDbControl();
     452      User u = User.getById(dc, id);
     453      Ownable o = (Ownable)itemType.getById(dc, item_id);
     454      o.setOwner(u);
     455      dc.commit();
    460456      write("--Set owner OK");
    461457    }
     
    468464    finally
    469465    {
    470       if (bc != null) bc.close();
    471     }
    472   }
    473   */
     466      if (dc != null) dc.close();
     467    }
     468  }
    474469
    475470}
Note: See TracChangeset for help on using the changeset viewer.