Class IAFHelper
source code
Helper class for the Software AG Apama Integration Adapter Framework
(IAF).
The IAF Helper class has been designed for use as an extension module
to the PySys System Test Framework, offering the ability to configure,
start and interact with an instance of the IAF. The usage pattern of the
class is to create an instance per IAF, and to then make method calls
onto the instance to perform operations such as to start the component,
request reload of the configuration file, perform management operationes
etc. For example:
iaf = IAFHelper(self, config="iaf-config.xml")
iaf.start(logfile="iaf.log")
iaf.client(reload=True)
Process related methods of the class declare a method signature which
includes named parameters for the most frequently used options to the
method. They also declare the **xargs parameter to allow passing in of
additional supported arguments to the process. The additional arguments
that are currently supported via **xargs are:
workingDir: The default value for the working directory of a process
state: The default state of the process (pysys.constants.BACKGROUND | pysys.constants.FOREGROUND)
timeout: The default value of the process timeout
stdout: The default value of the process stdout
stderr: The default value of the process stderr
arguments: List of extra arguments to be passed to the process
This means that legitimate calls to the start method include:
iaf.start(logfile="iaf.log")
iaf.start(logfile="iaf.log", stdout="correlator1.out")
iaf.start(state=FOREGROUND, timeout=5)
|
__init__(self,
parent,
port=None,
host=None)
Create an instance of the IAFHelper class. |
source code
|
|
|
addToClassPath(self,
path)
Add the supplied path to the APAMA_IAF_CLASSPATH environment variable
for starting this IAF instance. |
source code
|
|
|
addToPath(self,
path)
Add the supplied path to the PATH (win32) or LD_LIBRARY_PATH (unix)
environment variable for starting this IAF instance. |
source code
|
|
|
start(self,
configname,
configdir=None,
replace={ } ,
logfile=None,
verbosity=None,
**xargs)
Start the IAF. |
source code
|
|
|
client(self,
reload=False,
suspend=False,
resume=False,
**xargs)
Perform client operations against the IAF (reload, suspend, resume). |
source code
|
|
|
waitForIAFUp(self,
timeout=20)
Block until the IAF declares itself to be ready for processing. |
source code
|
|
dictionary
|
environ
The environment for running the IAF
|
string
|
host
Hostname for interaction with a remote Event Correlator
|
pysys.basetest
|
parent
Reference to the PySys testcase instantiating this class instance
|
integer
|
port
Port used for starting and interaction with the Event Correlator
|
__init__(self,
parent,
port=None,
host=None)
(Constructor)
| source code
|
Create an instance of the IAFHelper class.
If no port parameter is used in the argument list an available port
will be dynamically found from the OS and used for starting the IAF, and
performing all operations against it. The host parameter is only used to
perform operations against a remote IAF started external to the PySys
framework - the class does not support the starting of an IAF remote to
the localhost.
- Parameters:
parent - Reference to the parent PySys testcase
port - The port used for starting and interacting with the IAF
host - The hostname used for interaction with a remote IAF
|
start(self,
configname,
configdir=None,
replace={ } ,
logfile=None,
verbosity=None,
**xargs)
| source code
|
Start the IAF.
Start an IAF using the supplied configuration file. If the
configdir argument is not supplied, the location of the
configuration file defaults to the testcase input directory. The
configuration file can first be tailored to replaced token values within
the file with values required at run time using the replace
argument. For replace of the form :
replace = {"@logs_dir@":"/var/tmp/logs"}
any tokens in the coniguration file directly matching @logs_dir@ will
be replaced with the value "/var/tmp/logs". Note that multiple
token value pairs can be supplied in the replace dictionary.
- Parameters:
configname - The IAF configuration file or template name
configdir - The directory containing the IAF configuration file or template
logfile - Name of the IAF log file
verbosity - The verbosity level of the IAF logging
replace - A dictionary of tokens / values to be replaced in the
configuration file
xargs - Variable argument list for the additional supported process
parameters
|
client(self,
reload=False,
suspend=False,
resume=False,
**xargs)
| source code
|
Perform client operations against the IAF (reload, suspend,
resume).
- Parameters:
reload - Request reload of the IAF configuration file
suspend - Request the IAF to suspend event sending
resume - Request the IAF to resume event sending
xargs - Variable argument list for the additional supported process
parameters
|