![]() |
![]() |
![]() |
![]() |
![]() |
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.
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.
- Log device
- Enables the user to define the log device for the Merge tool. The default value is Screen, but the user can direct the log to a named file by choosing File or turn it off altogether by choosing None.
- For a full description of this command see The TTCN Suite Logs.
- Documents
- Presents a list of currently open documents. For Merge to work correctly at least two documents must be present in this list. The document name in bold italic font is the document from which the Merge tool was called, i.e. the merge document. The user must choose another document in this list, i.e. the destination document, in order to do a merge.
- In the dialog above the destination document is Test_Suite_B and the merge document is Test_Suite_A.
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:
- Create a new (empty) document.
- Open the document containing objects that are to be copied.
- Select the desired objects in the Browser (possibly aided by the Selector tool).
- 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.
TTCNMerge <Destination TTCN Suite file> <Source file 1> ... <Source file n>If <Destination TTCN Suite file> doesn't exist, it will be created.
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 |
![]() |
![]() |
![]() |
![]() |