How to invoke a Preprocessor in a BEUnit test

How to invoke a Preprocessor in a BEUnit test

book

Article ID: KB0073501

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.6.1 and later

Description

I have selected the option to "Invoke Preprocessor while asserting Events" in my *.eventtestdata file.  However, when I run the BEUnit test for my application, the Preprocessor is not used, and the test fails as a result.  How can the Preprocessor be invoked in the BEUnit test?
 

Issue/Introduction

Discusses how to invoke a Preprocessor in a BEUnit test that uses *.eventtestdata files

Resolution

The BEUnit test will not consider the "Invoke Preprocessor" option in the *.eventtestdata file.  Instead, you must use the appropriate variant of the assertEvent() method, which accepts the Preprocessor URI as a parameter..
 
assertEvent(SimpleEvent event, *boolean* executeRules, String preprocessorUri)

If the preprocessorUri is specified, it will be invoked when asserting the event.