def execute(self): # create the correlator helper, start the correlator and attach an # engine_receive process listening to a test channel. The helper will # automatically get an available port that will be used for all # operations against it correlator = CorrelatorHelper(self, name='testcorrelator') self.project.APAMA_WORK = self.descriptor.testDir + '/../../EPLApp' correlator.start(logfile='testcorrelator.log', config=[ os.path.join(self.project.APAMA_WORK, 'initialization.yaml') ]) receiveProcess = correlator.receive(filename='receive.evt', channels=['EchoChannel'], logChannels=True) correlator.applicationEventLogging(enable=True) # not strictly necessary in this testcase, but a useful example of waiting # for a log message self.waitForSignal('testcorrelator.out', expr="AverageReadings\(\"S001\",105\.25,825\)", process=correlator.process, errorExpr=[' (ERROR|FATAL) .*']) # wait for all events to be processed correlator.flush()
def execute(self): # create the correlator helper, start the correlator and attach an # engine_receive process listening to a test channel. The helper will # automatically get an available port that will be used for all # operations against it correlator = CorrelatorHelper(self, name='testcorrelator') correlator.start( logfile='testcorrelator.log', config=[os.path.join(self.project.APAMA_WORK, 'complex.yaml')]) correlator.applicationEventLogging(enable=True) # inject the monitor (directory defaults to the testcase input) correlator.injectEPL(filenames=[ os.path.join(self.project.APAMA_WORK, 'ComplexPlugin.mon') ]) # wait for all events to be processed correlator.flush()
def execute(self): # create the correlator helper, start the correlator and attach an # engine_receive process listening to a test channel. The helper will # automatically get an available port that will be used for all # operations against it correlator = CorrelatorHelper(self, name='testcorrelator') correlator.start(logfile='testcorrelator.log', config=PROJECT.TEST_SUBJECT_DIR + '/initialization.yaml') receiveProcess = correlator.receive(filename='receive.evt', channels=['output'], logChannels=True) correlator.applicationEventLogging(enable=True) # send in the events contained in the test.evt file (directory defaults # to the testcase input) correlator.send(filenames=['test.evt']) # wait for all events to be processed correlator.flush() # wait until the receiver writes the expected events to disk self.waitForSignal('receive.evt', expr="Msg", condition="==1")