Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 40 Testing and Debugging Projects : Creating and Working With Test Data

Creating and Working With Test Data
You can send data to the engine through channels in the normal way. You can also create data within TIBCO BusinessEvents Studio for assertion into the running engine’s Rete network during testing and debugging. Doing so means you don’t have to have the external resources in place in order to test or debug the runtime.
You can create data while you are working in the debug perspective. You can also create and save test data ahead of time and save it in your project for later use.
The internal data is used at the following bottom tabs, within the Rule Input tab:
Tester Data  This is concept and event instance data. You create it in the TIBCO BusinessEvents Development perspective, right-click an entity and select Create Test Data. You use it in the Debug perspective: select the Rule Input View > Tester Data tab.
Rule Data  This is data directly provided as rule input. It is created and edited in the Rule Input View > Rule Data tab (in the Debug perspective).
How you use test data depends on what aspect of a project you want to test or debug.
Working with Concept and Event Test Data
You can enter data in the Test Data editor for event payloads, and for concept, event and scorecard properties, including properties that are primitive types, array types, contained concepts, and reference concepts. If the concept, event or scorecard properties are associated with a domain model, then the test data gets populated with the values in the domain model. You can use global variables.
To Create Concept and Event Instance Test Data
1.
The Test Data editor appears showing the event or concept properties as column headers.
2.
In the Test Data editor, click Add to add rows for new instances. You can add your own unique extId values to the test data input, as needed. You can also use global variables.
You can also remove existing rows by selecting one or more rows and clicking Remove.
3.
Click Save. The entity’s test data is saved to an XML file stored within the TestData folder in the project root.
The /TestData folder is the default location (see Tester Preferences).
To Edit Test Data for Concepts and Events in BusinessEvents Studio Explorer
To add more test data or edit test data you created earlier, do the following.
1.
In BusinessEvents Studio Explorer, expand the TestData folder in the root of the project.
The /TestData folder is the default location (see Tester Preferences).
2.
3.
Test data filenames use the format eventName.eventtestdata and conceptName.concepttestdata.
To Edit Concept and Instance Test Data in the Rule Input View
1.
Select the Debug perspective as follows: select Window > Open Perspective, or click the Open Perspective () button). Then select Other > Debug. The views associated with the Debug perspective open.
In the Window menu, click Show View > Other. Expand TIBCO BusinessEvents, and select Rule Input. Click OK.
2.
Click the Rule Input tab and then select the Tester Data bottom tab.
For each concept or event for which you created test data, you see one row showing the project path to that concept or event.
3.
The Test Data editor appears, showing the rows of test data already created.
4.
Working with Rule Data
To Create and Save Rule Data
1.
Select the Debug perspective: Select Window > Open Perspective, or click the Open Perspective () button). Then select Other > Debug. The views associated with the Debug perspective open.
In the Window menu, click Show View > Other. Expand TIBCO BusinessEvents, and select Rule Input. Click OK.
2.
3.
4.
5.
Click Save to save the input values.
You can reuse these saved values for repetitive tests.
Click Load to load the input values from an existing XML file.
Click Assert to assert the data to a running engine.
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved