Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

testSuiteLong.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009 
00010 __facility__ = "Online"
00011 __abstract__ = "Example test suite"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/25 00:36:44 $").split(' ')[1]
00014 __version__  = "$Revision: 1.4 $"
00015 __credits__  = "SLAC"
00016 
00017 import LATTE.copyright_SLAC
00018 
00019 # History:
00020 #     $Log: testSuiteLong.py,v $
00021 #     Revision 1.4  2005/03/25 00:36:44  stuvi
00022 #     Test of running a suite summary after a StopRequestedException.
00023 #
00024 #     Revision 1.3  2005/03/24 03:37:36  stuvi
00025 #     Removed obsolete code.
00026 #
00027 #     Revision 1.2  2004/08/16 23:00:20  stuvi
00028 #     no message
00029 #
00030 #     Revision 1.1  2004/08/16 22:30:44  stuvi
00031 #     no message
00032 #
00033 #     Revision 1.1  2004/08/07 02:10:42  stuvi
00034 #     Test suite examples.
00035 #
00036 #     Revision 1.2  2004/01/24 00:27:17  stuvi
00037 #     Modified to use the appdir from preferences
00038 #
00039 #     Revision 1.1  2003/12/11 01:22:34  stuvi
00040 #     A sample test suite that is called as a sub suite from the testSuite sample.
00041 #
00042 #     Revision 1.2  2003/07/26 04:15:30  stuvi
00043 #     Fixed schema path
00044 #
00045 #     Revision 1.1  2003/03/28 03:21:41  stuvi
00046 #     Fixed FITS file status display
00047 #     Added test suite capability
00048 #
00049 
00050 from   LATTE.runcontrol.rcSuite import rcSuite
00051 import logging as     log
00052 import                os
00053 import time
00054 
00055 
00056 class userSuite(rcSuite):
00057   "Implmentation class for a user application"
00058   def __init__(self, gui, userId, debug):
00059     rcSuite.__init__(self, gui, userId, debug)
00060     log.debug("userSuite.__init__()")
00061 
00062   def getName(self):
00063     return __name__
00064 
00065   def setupSuite(self):
00066     pass
00067     #self.addApplication('./applications/testSAppCal.py', schema)
00068     #self.addApplication('./applications/testSAppEvt.py', schema)
00069 
00070   def startSuite(self):
00071     sessionContext = {"test":"abc", "eventCount":5}
00072     # The following script will change the value of session var "test"
00073     appDir = self.gui.preferences()['appdir']
00074     for i in xrange(1000000):
00075       if i % 1000 == 0:
00076         print("Test Run #%d" %i)
00077       # The following script will print the value of session var "test" and modify it
00078       try:
00079         sessionStateAfterTest2 = self.scriptRun(module=os.path.join(appDir,'testSAppCal'), context=sessionContext)
00080       except rcSuite.StopRequestedException, e:
00081         log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00082         break
00083     if self.gui is not None:
00084       self.gui.doStopRun()
00085 
00086   def stopSuite(self):
00087     log.info("End of long suite")

Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3