- Timestamp:
- 07/05/08 22:16:06 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/tools/OmeroPy/test/integration/isession.py
r2592 r2597 9 9 10 10 """ 11 import unittest 11 12 import test.integration.library as lib 12 13 import omero 13 14 import omero_RTypes_ice 15 import omero_Constants_ice 14 16 from omero_model_PixelsI import PixelsI 15 17 from omero_model_ImageI import ImageI … … 44 46 45 47 def testCreateSessionForUser(self): 46 user = self.root.sf.getQueryService().findAllByQuery(""" 48 p = omero.sys.Parameters() 49 p.theFilter = omero.sys.Filter() 50 p.theFilter.limit = omero.RInt(1) 51 user = self.root.sf.getQueryService().findByQuery(""" 47 52 select e from Experimenter e where e.id > 0 and e.omeName != 'guest' 48 """, None)[0]53 """, p) 49 54 p = omero.sys.Principal() 50 55 p.name = user.omeName.val … … 71 76 72 77 def testCreationDestructionClosing(self): 73 self.client.detachOnDestroy() 74 sess = self.client.sf.ice_getIdentity().category 75 self.client.destroyConnection() 78 c1 = omero.client() 79 s1 = c1.createSession() 80 s1.detachOnDestroy() 81 uuid = s1.ice_getIdentity().name 76 82 77 self.client = omero.client() 78 self.client.createSession(sess, sess) 79 self.client.closeOnDestroy() 80 self.client.destroyConnection() 83 # Intermediate "disrupter" 84 c2 = omero.client() 85 s2 = c2.createSession(uuid, uuid) 86 s2.closeOnDestroy() 87 s2.getAdminService().getEventContext() 88 c2.closeSession() 89 90 # 1 should still be able to continue 91 s1.getAdminService().getEventContext() 92 93 # Now if s1 exists another session should be able to connect 94 c1.closeSession() 95 c3 = omero.client() 96 s3 = c3.createSession(uuid, uuid) 97 s3.closeOnDestroy() 98 s3.getAdminService().getEventContext() 99 c3.closeSession() 100 101 # Now a connection should not be possible 102 c4 = omero.client() 103 s4 = c4.createSession(uuid, uuid); 104 105 def testSimpleDestruction(self): 106 c = omero.client() 107 c.ic.getImplicitContext().put(omero.constants.CLIENTUUID,"SimpleDestruction") 108 s = c.createSession() 109 s.closeOnDestroy() 110 c.closeSession() 81 111 82 112 if __name__ == '__main__':
