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:38:09 $").split(' ')[1]
00014 __version__ = "$Revision: 1.1 $"
00015 __credits__ = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 # History:
00020 # $Log: testSuiteSummary.py,v $
00021 # Revision 1.1 2005/03/25 00:38:09 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
00068 def startSuite(self):
00069 sessionContext = {"test":"abc", "eventCount":10000}
00070 # The following script will change the value of session var "test"
00071 appDir = self.gui.preferences()['appdir']
00072 try:
00073 sessionContext = self.scriptRun(module=os.path.join(appDir,'testSAppCal'), context=sessionContext)
00074 sessionContext = self.scriptRun(module=os.path.join(appDir,'testSummary'), context=sessionContext)
00075 except rcSuite.StopRequestedException, e:
00076 log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00077 self.clearStopRequested()
00078 sessionContext = self.scriptRun(module=os.path.join(appDir,'testSummary'), context=sessionContext)
00079 if self.gui is not None:
00080 self.gui.doStopRun()
00081
00082 def stopSuite(self):
00083 log.info("End of long suite")