IBM
Contents Index Previous Next



Replacing, Comparing and Merging


In this exercise you are going to merge the two test suites, the Example_A and the Example_B that you have just created. First you should change some names in one test suite though - to make it different - and then compare it with the other.

What You Will Learn

Searching and Replacing

The first thing you should do is to change some text in Example_B. The reason for this is that there would be no use comparing the documents - which you are soon going to do - if they both are the same.

You can start the search from both the Browser and the Table Editor, and in this case you will do it from the Browser:

  1. In the Browser displaying Example_B, click the Search button.
    The Table Editor will be opened, and as you can see it is empty.

  1. Type 1 in the Look for field
  2. Click the Search button.
    The first table of the test suite containing 1 is opened and 1 is highlighted.
  3. Type 2 in the Change to field.

  1. Click the Replace button.
    1 will be changed to 2 and it is no longer highlighted.

  1. Click the Search button again.
    This will find another occurrence of 1.

  1. Click the Proceed button.
    This is the same as first clicking Search and then Replace. Another occurrence of 1 will be found.

  1. Click the Replace all button.
    This will change all occurrences of 1 to 2. The Table Editor will display the table in which the final replacement was made and the status bar will show the total number of replacements.

Comparing Two Documents

When you have changed some text in Example_B, you can compare it to Example_A to see if any similarities exist:

  1. Ensure that the test suites Example_A and Example_B are opened.
  2. Select the entire test suite Example_B
  3. Select Compare from the Browser Tools menu.
    The Compare Documents dialog is opened:

Figure 56 : The Compare dialog

  1. Make the dialog settings as depicted in Figure 56.
    This will compare the test suite Example_A with the selection that you made in Example_B, in this case the entire test suite.
    Also make sure that Example_A is selected in the Documents field in the dialog.
  2. Click the Compare button.
    The comparison will deselect all items in the Browser for Example_B that do not match with items in Example_A. What remains are the items that are the same in both test suites, namely the lower PCO L and the PDUs SEND and RECEIVE. These tables will also be presented in the TTCN Suite log.
  3. Delete the selected items from Example_B.
    The only items left now are the ones that differ between the two test suites. You are now ready to try a merge.

Merging Two Documents

The Merge tool is used for merging one TTCN document (complete or partial) into another. This only works on condition that the documents do not conflict, that is, if an item in one document has the same name as another item in the other document. This will not be a problem now, as you have already compared the documents and deleted the similarities.

The final exercise in this tutorial is that you should merge what is left of Example_B into Example_A:

  1. Select the entire suite Example_B.
  2. Select Merge from the Browser Tools menu.
    The Merge Documents dialog is opened:

Figure 57 : The Merge Documents dialog

  1. Select Example_A in the Documents chapter. That is the suite that you are going to merge Example_B into
  2. Click the Merge button.
    If you look at the Example_A Browser, you should see that the suites have been merged into one. This is also depicted in Figure 58.

Figure 58 : The Example_B has been merged into Example_A


http://www.ibm.com/rational
Contents Index Previous Next