testSuite.py

Go to the documentation of this file.
00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
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__ = "Sample suite class based on seSuiteBase"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2005/07/23 00:08:27"
00014 __updated__  = "$Date: 2006/04/28 02:09:15 $"
00015 __version__  = "$Revision: 1.9 $"
00016 __release__  = "$Name: HEAD $"
00017 __credits__  = "SLAC"
00018 
00019 import LICOS.copyright_SLAC
00020 
00021 import logging as log
00022 
00023 from LICOS.lib.scriptEngine.seSuiteBase import seSuiteBase
00024 
00025 class testSuite(seSuiteBase):
00026   """!\brief Sample suite class based on seSuiteBase.
00027 
00028   """
00029   def __init__(self, common):
00030     """!\brief testSuite constructor.
00031 
00032     Here the script can do any initialization that is required
00033     once per suite load.
00034 
00035     Also additional parameters can be specified as arguments
00036     to the constructor in which case they should be included
00037     when calling the scriptLoad method:
00038 
00039     \code
00040     self.scriptLoad("testSuite", par1, par2)
00041     \endcode
00042 
00043     \param common ScriptEngineCommon instance
00044     """
00045     seSuiteBase.__init__(self, common)
00046 
00047   def setup(self):
00048     """!\brief SETUP transition method.
00049 
00050     Any code that is required before the suite starts
00051     can be entered here. This method is usually where
00052     the application scripts are loaded.
00053 
00054     \return Transition result
00055     """
00056     log.debug("%s Suite setup" % self.getName())
00057     #Make sure $ONLINE_ROOT/LICOS/tests/scriptEngine is in PYTHONPATH
00058     self.__app1 = self.scriptLoad("testApp", 30, 40)
00059     self.__app3 = self.scriptLoad("testApp", 10, 20)
00060     self.setSessionVar("suiteSessionVar", "1234567890")
00061     self.__app2 = self.scriptLoad("testSuite2")
00062 
00063   def run(self):
00064     """!\brief RUN transition method.
00065 
00066     Any code that is required before the suite starts
00067     can be entered here. This method is usually where
00068     the application scripts are loaded.
00069 
00070     \return Transition result
00071     """
00072     log.debug("%s Suite run" % self.getName())
00073     self.scriptRun(self.__app1)
00074     self.scriptRun(self.__app3)
00075     # We need to check both self and self.__app1 since the
00076     # first case is when we abort after we request a pause
00077     # during the run for app1 and the second case is when we
00078     # abort while we are running app1.
00079     if self.isStopRequested() or self.__app1.isStopRequested():
00080       return
00081     self.scriptRun(self.__app2)
00082 
00083   def stopRun(self):
00084     """!\brief STOP_RUN transition method.
00085 
00086     """
00087     log.debug("%s Suite stopRun" % self.getName())
00088 
00089   def pause(self):
00090     """!\brief PAUSE transition method.
00091 
00092     """
00093     log.debug("%s Suite pause" % self.getName())
00094 
00095   def resume(self):
00096     """!\brief RESUME transition method.
00097 
00098     """
00099     log.debug("%s Suite resume" % self.getName())
00100 
00101   def stop(self):
00102     """!\brief STOP transition method.
00103 
00104     """
00105     log.debug("%s Suite stop" % self.getName())
00106 
00107   def abort(self):
00108     """!\brief ABORT transition method.
00109 
00110     """
00111     log.debug("%s Suite abort" % self.getName())

Generated on Thu Apr 27 20:52:44 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO