Changeset 109 for branches/omero
- Timestamp:
- 06/13/05 17:12:24 (4 years ago)
- Location:
- branches/omero
- Files:
-
- 7 modified
-
components/client/.springBeans (modified) (1 diff)
-
components/server/.springBeans (modified) (2 diffs)
-
components/server/src/org/openmicroscopy/omero/logic/queries.hbm.xml (modified) (6 diffs)
-
components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java (modified) (5 diffs)
-
components/test/src/org/openmicroscopy/omero/test/OmeroGrinderTest.java (modified) (1 diff)
-
maven.xml (modified) (1 diff)
-
project.properties (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/omero/components/client/.springBeans
r108 r109 7 7 </configs> 8 8 <configSets> 9 <configSet> 10 <name>client testing</name> 11 <allowBeanDefinitionOverriding>false</allowBeanDefinitionOverriding> 12 <incomplete>false</incomplete> 13 <configs> 14 <config>src/org/openmicroscopy/omero/client/spring.xml</config> 15 <config>test/org/openmicroscopy/omero/client/itests/data.xml</config> 16 <config>test/org/openmicroscopy/omero/client/itests/test.xml</config> 17 </configs> 18 </configSet> 9 19 </configSets> 10 20 </beansProjectDescription> -
branches/omero/components/server/.springBeans
r99 r109 7 7 <config>web/WEB-INF/config.xml</config> 8 8 <config>web/WEB-INF/facade-servlet.xml</config> 9 <config>web/WEB-INF/config-test.xml</config>10 9 <config>web/WEB-INF/dao.xml</config> 11 10 </configs> … … 17 16 <configs> 18 17 <config>web/WEB-INF/config.xml</config> 19 <config>web/WEB-INF/config-test.xml</config>20 18 <config>web/WEB-INF/dao.xml</config> 21 19 <config>web/WEB-INF/data.xml</config> -
branches/omero/components/server/src/org/openmicroscopy/omero/logic/queries.hbm.xml
r106 r109 81 81 left outer join fetch cg_mex.experimenter as cg_exp 82 82 where i in (:img_list) 83 and cla.valid = true 83 and ( cla.valid = true or cla.valid is null) 84 ALSO NEED VALID STATEMENTS ON OTHER CLA QUERIES ABOVE!!! 84 85 ]]></query> 85 86 --> … … 88 89 left outer join fetch i.classifications as cla 89 90 where i in (:img_list) 90 and cla.valid = true 91 and ( cla.valid = true or cla.valid is null) 91 92 ]]></query> 92 93 … … 98 99 left outer join fetch ann_mex.experimenter as ann_exp 99 100 where ann.image in (:img_list) 100 and ann.valid = true101 and ( ann.valid = true or ann.valid is null) 101 102 ]]></query> 102 103 … … 107 108 left outer join fetch ann_mex.experimenter as ann_exp 108 109 where ann.image in (:img_list) 109 and ann.valid = true110 and ( ann.valid = true or ann.valid is null) 110 111 and ann_exp = :expId 111 112 ]]></query> … … 117 118 left outer join fetch ann_mex.experimenter as ann_exp 118 119 where ann.dataset in (:ds_list) 119 and ann.valid = true120 and ( ann.valid = true or ann.valid is null) 120 121 ]]></query> 121 122 … … 126 127 left outer join fetch ann_mex.experimenter as ann_exp 127 128 where d in (:ds_list) 128 and ann.valid = true129 and ( ann.valid = true or ann.valid is null) 129 130 and ann_exp = :expId 130 131 ]]></query> -
branches/omero/components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java
r107 r109 6 6 import java.io.FileInputStream; 7 7 import java.util.ArrayList; 8 import java.util.HashSet; 9 import java.util.Iterator; 8 10 import java.util.List; 11 import java.util.Set; 9 12 10 13 import javax.sql.DataSource; … … 25 28 import org.springframework.test.AbstractSpringContextTests; 26 29 30 import org.openmicroscopy.omero.logic.AnnotationDao; 31 import org.openmicroscopy.omero.logic.ContainerDao; 32 import org.openmicroscopy.omero.logic.Utils; 27 33 import org.openmicroscopy.omero.model.DatasetAnnotation; 34 import org.openmicroscopy.omero.model.Image; 28 35 29 36 /** … … 32 39 public class HierarchyBrowsingDbUnitTest extends AbstractSpringContextTests { 33 40 41 static IDatabaseConnection c = null; 34 42 ApplicationContext ctx; 35 DataSource ds; 36 static IDatabaseConnection c = null; 37 43 DataSource ds = null; 44 ContainerDao cdao = null; 45 AnnotationDao adao = null; 46 38 47 public static void main(String[] args) { 39 48 junit.textui.TestRunner.run(HierarchyBrowsingDbUnitTest.class); … … 55 64 protected void setUp() throws Exception { 56 65 ctx = getContext(getConfigLocations()); 57 58 if (null==ds){ 66 67 if (null == cdao || null == adao || null == ds) { 68 cdao = (ContainerDao) ctx.getBean("containerDao"); 69 adao = (AnnotationDao) ctx.getBean("annotationDao"); 59 70 ds = (DataSource) ctx.getBean("dataSource"); 60 71 } … … 71 82 } 72 83 73 public void testFindDSAnnWithId() { 84 public void testFindPDIHierarchies(){ 85 Set set = getSetFromInt(new int[]{1,5,6,7,8,9,0}); 86 List result = cdao.findPDIHierarchies(set); 87 assertTrue("Should have found all the images but Zero", result.size()==set.size()+1); 88 for (Iterator i = result.iterator(); i.hasNext();) { 89 Image img = (Image) i.next(); 90 assertTrue("Fully initialized",Hibernate.isInitialized(img.getDatasets())); 91 } 92 } 93 94 public void testFindDSAnn() { 74 95 // Use filter sets to DRY 75 SessionFactory sf = (SessionFactory) ctx.getBean("sessionFactory"); // TODO put in spring 76 HibernateTemplate ht = new HibernateTemplate(sf); 77 List result = ht.executeFind(new HibernateCallback() { 78 public Object doInHibernate(Session session) 79 throws HibernateException { 80 List l = new ArrayList(); 81 l.add(new Integer(120)); 82 Query q = session.getNamedQuery("findDatasetAnnWithID"); 83 q.setParameterList("ds_list",l); 84 q.setLong("expId",286035); 85 return q.list(); 86 } 87 }); 88 96 Set set = new HashSet(); 97 set.add(new Integer(120)); 98 int experimenter = 286033; 99 testDsResult(adao.findDataListAnnotationForExperimenter(set,experimenter)); 100 testDsResult(adao.findDataListAnnotations(set)); 101 } 102 103 void testDsResult(List result){ 89 104 assertTrue("This should be the only known DS annotation",result.size()==1); 90 105 DatasetAnnotation ann = (DatasetAnnotation) result.get(0); 91 106 assertTrue("Attribute id is also known.", ann.getAttributeId().intValue()==320101); 92 107 assertTrue("Mex should be fetched.",Hibernate.isInitialized(ann.getModuleExecution())); 93 108 } 109 110 public void testFindImageAnn(){ 111 Set set = new HashSet(); 112 //select a.image_id, m.experimenter_id from module_executions m, image_annotations a where a.module_execution_id = m.module_execution_id; 113 //images{1,27, 313,36,42, 7,41, 357, 296,11,26,28,39,31, 485, 558,25,24, 340,4391,4446,4507, 8, 1,22}; 114 //users 115 set.add(new Integer(1)); 116 set.add(new Integer(27)); 117 set.add(new Integer(313)); 118 int experimenter = 1; 119 List r1 = adao.findImageAnnotations(set); 120 List r2 = adao.findImageAnnotationsForExperimenter(set,experimenter); 121 assertTrue("The user filtered list should be smaller", r2.size() < r1.size()); 122 } 123 124 Set getSetFromInt(int[] ids){ 125 Set set = new HashSet(); 126 for (int i = 0; i < ids.length; i++) { 127 set.add(new Integer(ids[i])); 128 } 129 return set; 94 130 } 95 131 } -
branches/omero/components/test/src/org/openmicroscopy/omero/test/OmeroGrinderTest.java
r108 r109 66 66 return new String[] { 67 67 "org/openmicroscopy/omero/client/spring.xml", 68 "org/openmicroscopy/omero/client/itests/data.xml" }; 68 "org/openmicroscopy/omero/client/itests/data.xml", 69 "org/openmicroscopy/omero/client/itests/test.xml"}; 69 70 } 70 71 -
branches/omero/maven.xml
r108 r109 39 39 <ant:delete file="${basedir}/src/spring.properties"/> 40 40 </preGoal> 41 <goal name="test"> 42 <maven:property name="goal" defaultValue="test:test" /> 43 <attainGoal name="multiproject:goal"/> 44 </goal> 41 45 42 46 <!-- Setup --> -
branches/omero/project.properties
r100 r109 6 6 maven.test.mode=unit 7 7 test.unit.includes = **/utests/** 8 test.unit.excludes = **/itests/** 8 test.unit.excludes = **/itests/**,**/test** 9 9 test.integration.includes = **/itests/** 10 test.integration.excludes = **/utests/** 10 test.integration.excludes = **/utests/**,**/test/** 11 11 12 12
