Chapter 3 Cache Object Management Tutorial : Test the Application

Test the Application
Learning Points
As in the section Test the Application, while the nodes are running, you will use ActiveMatrix BusinessWorks to simulate data coming into the application from account activity. See that section for detailed instructions. It is assumed here that you are now familiar with the steps.
The process you created in Configure an ActiveMatrix BusinessWorks Process for Testing can be used again without modification.
Task L Test the Application
1.
With the project open in TIBCO Designer, open the DebitAccount process and then select the Tester tab.
2.
Click the Supply Input Data to Starter () button. In the AccountID field, enter ActA (or ActB) and in the Amount field enter a figure such as 3000. This amount will be debited each time you run a job. Click OK. to save and dismiss the window.
3.
Position the command windows for all three inference agents so you will be able to see the messages. Remember that agent1 and agent2 are configured to be active while agent3 is inactive, for fault tolerance.
4.
Click the Start Testing Viewed Process () button. At the Select Processes to Load dialog select DebitAccount(Current) (if it is not selected) and click Load and Start Current.
In the command window for engine1 (agent1), look for the following message:
   [FraudDetection] ############## Debiting account <ActA> by
   <3000.0> dollars. New balance is <17000.0>
5.
Start JConsole, which is in the bin directory of your JDK installation (for example, C:/Program Files/Java/jdk1.6.0_07/bin/JConsole.exe) and expand the Coherence folders. For example, expand to:
Coherence > Cache > DistributedCache > dist-unlimited-nobs$AcmeCluster$$be.gen.Concepts.Account > 1 > back
Then click on Attributes. The panel on the right displays information.
Click Refresh periodically to refresh the display as you perform actions.
6.
Run another job to again debit ActA. You see the message for this debit action in the command window for Engine2 (agent2).
Continue to run jobs. The JMS server sends messages to each active agent in a round-robin manner. If you created ActB you can send it test data, too.
Command windows for the active agents look similar to the following:
When the rule conditions are met, you see a message like the following:
[FraudDetection] #### Account id <ActA> STATUS set to <Suspended>
7.
To demonstrate failover to the inactive agent, press Ctrl-C to stop engine2. (It doesn’t actually matter which active engine you stop). You see engine3 activating. Look for messages READY TO ACTIVATE then Activated.
8.
Send some more events using the tester. Now you see the messages appear alternately in engine1 and engine3 command windows.
9.
To demonstrate failback, start engine2 again. You see engine2 resume its active role, and in the command window for engine3, you see messages such as Setting Rule Session to INACTIVE and DeActivate.
10.
To reset the test data, stop all nodes and start them again. Because cache data is all held in memory, stopping the system clears all data.
 
CongratulationsYou have completed the caching tutorial!