• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 2597 for trunk/components/tools/OmeroPy/test/integration/isession.py

Show
Ignore:
Timestamp:
07/05/08 22:16:06 (5 months ago)
Author:
jmoore
Message:

ticket:1018 - Fixing memory leak in solution

  • Added ome/services/messaging.xml to publish messages to child contexts
  • Fixed ordering issues SessionManagerI
  • Also:
    • Using ice_getCommunicator() if ic null in omero.client
    • Catching exceptions on session close in test.integration.library
Files:
1 modified

  • trunk/components/tools/OmeroPy/test/integration/isession.py (modified) (3 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/components/tools/OmeroPy/test/integration/isession.py

    r2592 r2597  
    99 
    1010""" 
     11import unittest 
    1112import test.integration.library as lib 
    1213import omero 
    1314import omero_RTypes_ice 
     15import omero_Constants_ice 
    1416from omero_model_PixelsI import PixelsI 
    1517from omero_model_ImageI import ImageI 
    … …  
    4446 
    4547    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(""" 
    4752            select e from Experimenter e where e.id > 0 and e.omeName != 'guest' 
    48             """, None)[0] 
     53            """, p) 
    4954        p = omero.sys.Principal() 
    5055        p.name  = user.omeName.val 
    … …  
    7176 
    7277    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 
    7682 
    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() 
    81111 
    82112if __name__ == '__main__': 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/