IBM
Contents Index Previous Next



Merging TTCN Documents


The Merge tool is used for merging one TTCN document (complete or partial) into another TTCN document.

A useful application of the Merge tool is to use the Selector tool and the Convert to MP tool to extract a complete test case (the Test Case Dynamic Behaviour together with its declarations, constraints etc.) and merge it with another TTCN document.

Preparing for a Merge

The merge tool requires that two TTCN documents are opened. We shall call them the merge TTCN document and the destination TTCN document or selection.

Figure 196 : Shows how Merge works

The Merge tool will always try to perform the merge operation, also when the two documents have conflicts. A conflict occurs if any TTCN objects in the TTCN documents have the same name. If any name conflicts are detected, this will be logged and the conflict tables will not be merged.

One of the first things Merge does is to compare the two TTCN documents. Any conflicts found will be notified in the log and the Merge operation will then continue. The Compare tool can be used to find and resolve the conflicts.

For a full description of this command see Comparing TTCN Documents.

Merging of constraint tables are handled specially. For example, a merge TTCN document may contain a TTCN ASP Constraint constraint1 that refers to the type type1, where the type1 Type table is of the incompatible type TTCN PDU TypeDef. This will make the merge process insert a copy of constraint1 as a table of type TTCN PDU Constraint instead of the original type. There are, however, limitations to this "type conversion". The conversion will not convert an ASN.1 Constraint to a TTCN Constraint nor vice versa.

Merging Two TTCN Documents

Tools > Merge

Merges a selection into another TTCN document. Make the selection in the merge TTCN document and call the merge tool to merge the selected nodes into the destination document.

Figure 197 : Merge Documents dialog

Creating Documents by Using the Merge Tool

The Merge Tool is not only useful when merging two documents together. It can also be used in the creation of a new document that needs to obtain some information from another document. The following procedure can be useful:

  1. Create a new (empty) document.
  2. Open the document containing objects that are to be copied.
  3. Select the desired objects in the Browser (possibly aided by the Selector tool).
  4. Merge them into the empty document.

There are also alternate ways of doing this. Copy/Paste between the documents or using the Convert to MP tool and the Convert to GR tool or the Merge from MP tool.

Merge from command line

TTCNMerge is a command-line tool for merging two or more TTCN documents into one.

Usage:

TTCNMerge <Destination TTCN Suite file> <Source file 1> 
... <Source file n>

If <Destination TTCN Suite file> doesn't exist, it will be created.

Example 202

TTCNMerge total.itex main.mp decl.mp initial.itex

The appearance order of source files in command line is significant such that files are being merged one by one in order of their appearance, and, if the table with the same name exists in several TTCN source documents, only the first appearance will be merged. All others will be skipped with warnings given.


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