|
||
In the previous section, you created a simple ATM protocol comprising two Processing Entities (Customer and ATM). These PEs are able to communicate with each other via two possible Messages (cardInserted and keypressCancel). The structure of the communication is represented via Rules (insertCard, acceptCard, pressCancel, and cancelOperation) contained by the PEs and the connections among them formed by Messages.
The design captured on the ATM Protocol Edit Sheet is a specification of the Simple ATM Protocol; i.e., it represents what is possible with the protocol, not any particular usage of the protocol.
In this section, we will cover the creation of a Test Scenario for a protocol specification. A Test Scenario represents a specific set of messages sent in a particular order. It is through Test Scenarios that a protocol specification can be exercised.
In terms of the Simple ATM Example, the Protocol Specification given on the Edit Sheet represents all possible interactions between a customer and an ATM while the Test Scenario on a Test Sheet represents a particular instance of a particular customer interacting with a particular ATM.
Before starting the operations detailed below, ensure that you have loaded the design information captured and saved in the previous section.
A Test Sheet can be added to the ProtoCollum binder by means of the Edit>New Sheet menu item. Left-clicking on New Sheet brings up the submenu as shown in Figure ???.
Left-click on For Testing to add the Test Sheet. Once the Test Sheet is added, right-click on the sheet name tab along the bottom edge of the sheet to get the Sheet Tab Menu pop-up. Select the Rename... menu item and rename the sheet to ATM Test. At this point, your sheet should look like Figure ???.
A ProtoCollum Test Sheet is an instance of a particular Edit Sheet. In the current example, the edit sheet ATM Protocol contains two Processing Entities, so when a Test Sheet is constructed for it, that Test Sheet has instances of those two PEs. See Figure ? and the following notes for an explanation of everything on the Test Sheet.
positioned
at one of the "+" signs. Nodes are described in more detail below
when the message connection mechanism is explained.
is an
independent (that is, non-PE) source for messages on a Test Sheet.
On the Edit Sheet, all messages are sourced by one PE and transmitted to
one or more destination PEs. On a Test Sheet, a White Hole is used to
insert a message into the system of PEs so that its response may be
observed.
Before adding the first instance of a Message to this Test Sheet, we will move the White Hole that the Message will originate from into a more convenient position.
|
The White Hole is initially in the position shown in the image to the right. Start by clicking on the Select Mode button
As the mouse pointer is moved, it will change to
|
|
|
Select the White Hole As shown in the image to the right, a handle The selected White Hole may be repositioned by moving the mouse pointer over its handle and left-dragging it to its new position. |
|
|
The mouse cursor will change to the movement cursor
While a move is in progress, the mouse pointer will change to a crosshair
Drag the White Hole 2 cm lower and release the left mouse button. Your sheet should now appear as shown to the right. |
|
Now that the White Hole is in its more convenient position, we can add an instance of a Message to the ATM Test sheet.
|
Click on the Message Mode button
Move the cursor over the white hole
Left-click and the "Choose a Message" dialog box will appear (as shown in the image to the right). Select the message Init_Msg and click "OK". |
|
|
Now that you have selected which message is emerge from the white hole, you have to indicate where that message is to go. The mouse pointer will have changed back to the Message cursor
|
|
|
When you left-click on the "+" sign, a Node
(Note: It's necessary to select a rule to activate since the Customer Cus0 PE has two different rules, either one of which can receive the Init_Msg message.) |
|
|
After the insertCard rule has been selected, the sheet will update to appear as the image to the right. The small white circle
This marker is displayed in white to indicate that a message was generated by the evaluation of the Action event. |
|
|
The mouse pointer should be Move the mouse cursor over the Action event marker
Left-click on the Action marker
|
|
|
When you left-click on the "+" sign, a Node
Since in this case there is only one rule that is suitable for a cardInserted message, ProtoCollum selects it automatically and does not require you to pick it from a Rule List dialog box. |
|
At this point, the Test Sheet should look like Figure ???. Save your work using the File>Save (or File>Save As...) menu item before we move on to adding the next message.
The insertion of the bank card was represented by a insertCard message moving from the Customer Cus0 PE to the ATM ATM0 PE. Similarly, the pressing of a "Cancel" button on our Simple ATM will be represented by sending of a pressCancel message in the same direction.
To add the second message instance, we need another White Hole for the message to originate from. Adding a new White Hole is very simple.
|
Click on the Whitehole Mode button
Your Test Sheet should look like the image to the right. |
|
Since you already have experience in adding a message instance to a Test Sheet, we will summarize the steps for adding the second message instance in the following list. The process exactly parallels that used above to add the first message instance.
on the toolbar.
that appears to
the lower right of the node
(which has the label pressCancel)
and move the cursor over to the stem under the
ATM ATM0 PE instance.
with the label
cancelOperation will appear.
At this point, the Test Sheet should look like Figure ???. Save your work using the File>Save (or File>Save As...) menu item before we move on.
???
|
Copyright © 2003-2005 by Bellum Software
last updated on 10 August 2005 |