def preProcess(self): """ Initialize the plugin to be launched """ EDTestCasePlugin.preProcess(self) if(EDUtilsPath.EDNA_SITE == None): raise RuntimeError, "EDNA_SITE must be set" # Load the plugin that should be executed self._edPlugin = EDFactoryPluginStatic.loadPlugin(self.getPluginName()) if(self._edPlugin is not None): for strInputDataKey in self._dictStrDataInputFiles.keys(): if (type(self._dictStrDataInputFiles[ strInputDataKey ]) == types.ListType): for strDataInputFile in self._dictStrDataInputFiles[ strInputDataKey ]: strXMLData = self.readAndParseFile(strDataInputFile) if (strInputDataKey == self._strDefaultInputDataKey): self._edPlugin.setDataInput(strXMLData) else: self._edPlugin.setDataInput(strXMLData, strInputDataKey) else: strXMLData = self.readAndParseFile(self._dictStrDataInputFiles[ strInputDataKey ]) if (strInputDataKey == self._strDefaultInputDataKey): self._edPlugin.setDataInput(strXMLData) else: self._edPlugin.setDataInput(strXMLData, strInputDataKey) #self._edPlugin.setDataInput( self._strXMLData, "inputMXCuBE" ) else: EDVerbose.ERROR("Cannot load plugin: %s" % self.getPluginName()) raise RuntimeError self._edPlugin.setConfiguration(self.getPluginConfiguration())
def __init__(self, _strPluginName, _strPluginDir=None, _strTestName=None): """ Initialize the Plugin Unit test """ EDTestCasePlugin.__init__(self, _strPluginName, _strPluginDir, _strTestName) self.__edPlugin = None # To track dead locks EDUtilsParallel.initializeNbThread(1)
def readAndParseFile(self, _strFileName): """ Reads a file and parses potential existing environment variables such as: - EDNA_WORKING_DIR Returns the content of this file as a string """ strXML = EDTestCasePlugin.readAndParseFile(self, _strFileName) if (self.__edPlugin.getWorkingDirectory() is not None): strXML = strXML.replace("${EDNA_WORKING_DIR}" , self.__edPlugin.getWorkingDirectory()) return strXML
def __init__(self, _strPluginName, _strPluginDir=None, _strTestName=None): """ Initialise the Plugin Execution test - Edna site - Configuration files - Data input file - Plugin launcher """ EDTestCasePlugin.__init__(self, _strPluginName, _strPluginDir, _strTestName) self._strRefConfigFile = None self._dictStrDataInputFiles = {} self._strDefaultInputDataKey = "defaultInputData" self._dictStrReferenceDataOutputFiles = {} self._strDefaultOutputDataKey = "defaultOutputData" self._iNoExpectedErrorMessages = 0 self._iNoExpectedWarningMessages = 0 self._bAcceptPluginFailure = False # Deprecated! self.m_edObtainedOutputDataFile = None EDUtilsParallel.uninitializeNbThread()