Changeset 3774
- Timestamp:
- Sep 25, 2007, 9:35:09 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4-stable/src/test/TestAnnotation.java
r3679 r3774 26 26 27 27 import net.sf.basedb.core.*; 28 import net.sf.basedb.core.query.Hql; 29 import net.sf.basedb.core.query.Orders; 28 30 29 31 import java.util.Date; … … 81 83 // Test: list inherited annotations and annotation sets 82 84 test_list_inherited_annotations(rawBioAssayId, 2); 85 test_list_allinherited_annotations(rawBioAssayId, 9); 83 86 test_list_inherited_annotationsets(rawBioAssayId, 1); 84 87 test_list_inheriting_annotationsets(arrayDesignId, 1); … … 342 345 } 343 346 } 347 348 static void test_list_allinherited_annotations(int rawBioAssayId, int expectedResults) 349 { 350 if (rawBioAssayId == 0) return; 351 DbControl dc = null; 352 try 353 { 354 dc = TestUtil.getDbControl(); 355 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId); 356 ItemQuery<Annotation> query = rba.getAnnotationSet().getAllInheritedAnnotations(); 357 query.join(Hql.innerJoin(null, "annotationType", "at", true)); 358 query.order(Orders.asc(Hql.property("at", "name"))); 359 List<Annotation> l = query.list(dc); 360 for (int i = 0; i<l.size(); i++) 361 { 362 write_item(i, l.get(i)); 363 } 364 if (expectedResults >= 0 && expectedResults != l.size()) 365 { 366 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 367 } 368 write("--List all inherited annotations OK ("+l.size()+")"); 369 } 370 catch (Throwable ex) 371 { 372 write("--List all inherited annotations FAILED"); 373 ex.printStackTrace(); 374 ok = false; 375 } 376 finally 377 { 378 if (dc != null) dc.close(); 379 } 380 } 344 381 345 382 static void test_list_inherited_annotationsets(int rawBioAssayId, int expectedResults)
Note: See TracChangeset
for help on using the changeset viewer.