Changeset 3647
- Timestamp:
- Aug 9, 2007, 11:11:10 AM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/BioAssaySet.java
r2998 r3647 313 313 if (action == Transactional.Action.CREATE) 314 314 { 315 checkAndCreateTables(); 315 316 countSpotsAndReporters(); 316 317 } … … 1177 1178 } 1178 1179 1180 private void checkAndCreateTables() 1181 { 1182 VirtualDb vdb = getVirtualDb(); 1183 vdb.createTables(VirtualTable.SPOT, VirtualTable.POSITION); 1184 if (getDataCubeFilterNo() != 0) 1185 { 1186 vdb.createTables(VirtualTable.FILTER); 1187 } 1188 } 1189 1179 1190 /** 1180 1191 Called when a bioassayset is about to be deleted. Finds which data cubes, layers, -
trunk/src/test/TestExperiment.java
r3626 r3647 38 38 import net.sf.basedb.util.ConsoleProgressReporter; 39 39 40 import java.util.Collections; 40 41 import java.util.Date; 41 42 import java.util.Set; … … 88 89 test_list_rawbioassays(id, 2); 89 90 91 int emptyRootId = test_create_empty_root_bioassayset(id, rbaId1, rbaId2); 92 90 93 int rootBasId = test_create_root_bioassayset_using_calculator(id, "mean", rbaId1, rbaId2); 91 94 int rootBasId2 = test_create_root_bioassayset_using_query(id, "mean", rbaId1, rbaId2); … … 109 112 //int mergedBasId = test_merge_bioassays(filterBasId); 110 113 111 test_list_bioassaysets(id, 7);114 test_list_bioassaysets(id, 8); 112 115 113 116 test_list_bioassays(basId, 2); … … 600 603 return id; 601 604 } 605 606 static int test_create_empty_root_bioassayset(int experimentId, int... rawBioAssays) 607 { 608 if (experimentId == 0) return 0; 609 int id = 0; 610 DbControl dc = null; 611 try 612 { 613 dc = TestUtil.getDbControl(); 614 Experiment e = Experiment.getById(dc, experimentId); 615 616 Set<RawBioAssay> rbaCollection = new HashSet<RawBioAssay>(); 617 for (int rbaId : rawBioAssays) 618 { 619 rbaCollection.add(RawBioAssay.getById(dc, rbaId)); 620 } 621 622 Transformation t = e.newTransformation(null, rbaCollection); 623 BioAssaySet root = t.newProduct("new", "new", false); 624 root.setName("No spots"); 625 dc.saveItem(t); 626 dc.saveItem(root); 627 628 for (RawBioAssay rba : rbaCollection) 629 { 630 // Create a new BioAssay for each raw bioassay 631 BioAssay ba = root.newRootBioAssay(Collections.singleton(rba)); 632 ba.setName(rba.getName()); 633 dc.saveItem(ba); 634 } 635 dc.commit(); 636 637 int numSpots = root.getNumSpots(); 638 id = root.getId(); 639 dc = TestUtil.getDbControl(); 640 dc.reattachItem(root); 641 write_item(0, root); 642 write("--Create empty root bioassayset OK ("+numSpots+" spots inserted)"); 643 } 644 catch (Throwable ex) 645 { 646 write("--Create empty root bioassayset FAILED"); 647 ex.printStackTrace(); 648 ok = false; 649 } 650 finally 651 { 652 if (dc != null) dc.close(); 653 } 654 return id; 655 } 656 602 657 603 658 static int test_create_bioassayset(int bioAssaySetId)
Note: See TracChangeset
for help on using the changeset viewer.