テスト成果物のマッピングは、migration.cfg という名前の XML ファイル経由で制御されます。 Rational ClearQuest 7.0.1 では、このファイルは通常、以下のディレクトリー・パスにインストールされます。
CQInstallDir.Rational¥ClearQuest¥rcp_configuration_701¥eclipse¥plugins
¥com.ibm.rational.clearquest.testmanagement.rqmexport_datestamp¥data
Rational ClearQuest 7.1 以降では、このファイルは通常、以下のユーザー・ホーム・ディレクトリーにインストールされます。
UserHome¥.Rational¥ClearQuest¥rcp_configuration_71¥eclipse¥plugins
¥com.ibm.rational.clearquest.testmanagement.rqmexport_datestamp¥data
例えば、Windows XP で Rational ClearQuest 7.1 を実行するコンピューターでは、次のような場所になります。
C:¥Documents and Settings¥myname¥.Rational¥ClearQuest¥rcp_configuration_71¥eclipse¥plugins
¥com.ibm.rational.clearquest.testmanagement.rqmexport_2.0.0.v20091119_1542¥data
migration.cfg ファイルでは、特定の成果物のマッピングは <field _mapping> タグの中に含まれますが、成果物内のフィールドごとの個々のマッピングは <mapping> タグにおいて定義されます。 例えば、XML コードの以下の 2 行は、Rational ClearQuest Test Manager の TMTestCase 成果物が Rational Quality Manager の TestCase 成果物にマップされ、TMTestCase 内の Headline フィールドが TestCase 内の title フィールドにマップされることを示します。
<field_mapping type="TMTestCase" target="TestCase" task="Test Cases">
<mapping from="Headline" to="dc:title"/>
フィールドのマッピングを更新するには、既存のマッピングを適切な from または to 属性設定で変更します。 新規マッピングを追加するには、既存のマッピングを複製し、必要に応じて更新します。 フィールドのマッピングを調整した後、更新されたマッピング・ファイルを使用するために、マイグレーション・ウィザードを再実行します。
migration.cfg ファイルのテスト・ケースのデフォルト・マッピングを以下に示します。<?xml version="1.0" encoding="UTF-8"?>
<config>
<!-- TEST CASE -->
<field_mapping type="TMTestCase" target="TestCase" task="Test Cases">
<mapping from="Headline" to="dc:title"/>
<mapping from="Description" to="dc:description"/>
<mapping from="owner.login_name" to="jzalm:owner"/>
<mapping from="State" to="jzalm:state"/>
<mapping from="Notes_Log" to="myns:com.ibm.rqm.planning.editor.section.testCaseNotes extensionDisplayName="Notes"" pre="true"/>
<mapping from="LegacyAcceptanceCriteria" to="myns:com.ibm.rqm.planning.editor.section.testCaseAcceptanceCriteria extensionDisplayName="Acceptance Criteria"" pre="true"/>
<mapping from="LegacyPreConditions" to="myns:com.ibm.rqm.planning.editor.section.testCasePreCondition extensionDisplayName="Precondition"" pre="true"/>
<mapping from="LegacyPostConditions" to="myns:com.ibm.rqm.planning.editor.section.testCasePostCondition extensionDisplayName="Postcondition"" pre="true"/>
<mapping from="LegacyCustom1" to="myns:LegacyCustomField" pre="true"/>
<mapping from="LegacyInputs" to="myns:LegacyInputData" pre="true"/>
<mapping from="LegacyPassPoints" to="myns:LegacyPassPoints" pre="true"/>
<mapping from="LegacyFailPoints" to="myns:LegacyFailPoints" pre="true"/>
<mapping from="LegacyDesign" to="myns:LegacyDesign" pre="true"/>
<mapping from="History" to="myns:History" pre="true"/>
<mapping from="DefaultScript" to="testscript" scripttype="DefaultScriptType"/>
<mapping from="ExternalMotivators" to="attachment" file="true"/>
<mapping from="LegacyTotalPoints" to="weight"/>
<mapping from="ConfiguredTestCases.Script" to="testscript" scripttype="ConfiguredTestCases.TestType"/>
<!-- TM "properties" RAProject and Requirements_List are placeholders and can not be renamed -->
<!-- <mapping from="RAProject" to="RAProject"/> -->
<mapping from="Requirements_List" to="requirement"/>
<mapping from="Notes_Log" to="myns:com.ibm.rqm.planning.editor.section.testCaseNotes extensionDisplayName="Notes"" pre="true"/>
<mapping from="custom2" to="LegacyCustom2"/>
<mapping from="custom3" to="LegacyCustom3"/>
</field_mapping>
以下の表は、マッピング内に含めることができる追加のディレクティブについて説明しています。
| ディレクティブ | 説明 |
|---|---|
| pre="true" | ベタ書き。データの書式が再設定されないように折り返します。 |
| file="true" | フィールドが Rational ClearQuest Test Manager の外部ファイルを参照することを指定します。 |
| scripttype | 関連付けられたスクリプトにのみ使用されます。 |
この例では、Rational ClearQuest Test Manager のユーザー定義フィールドが Rational Quality Manager の既存のフィールドにマップされる単純な例を示します。
<mapping from="InternalName" to="dc:title"/>
この例では、InternalName という名前のユーザー定義フィールドが Rational Quality Manager の title フィールドにマップされます。
この例では、参照元の成果物のフィールドが Rational Quality Manager のフィールドにどのようにマップされるのかを示します。
<mapping from="ParentPlan.Headline" to="dc:description"/>
この例では、ParentPlan 成果物の Headine フィールドは、Rational Quality Manager の description フィールドにマップされます。
この例では、Rational ClearQuest Test Manager のユーザー定義フィールドが Rational Quality Manager のユーザー定義セクションにどのようにマップされるのかを示します。
<mapping from="InternalName" to="myns:InternalName extensionDisplayName="Internal Name"">
この例では、マッピングは依然として Rational ClearQuest Test Manager のカスタム InternalName フィールドを参照しますが、今回は InternalName という Rational Quality Manager のユーザー定義セクションにマップしています。
Rational Quality Manager のユーザー定義セクションの名前は、スペースを含まない任意の名前にすることができますが、名前の前に myns: を付ける必要があります。
この例の最後の部分 extensionDisplayName="Internal Name"" は、セクション名が Rational Quality Manager でどのように現れるかを指定します。
ここで、ユーザー定義セクション名、InternalName は内部名として表示されます。 内部名は引用符で囲む必要がありますが、これは XML ファイルに組み込まれるため、引用符は引用符のエスケープ・バージョン、つまり " に置き換える必要があります。
この例は、Rational ClearQuest Test Manager での値が Rational Quality Manager での値に置換される方法を示しています。
<enum_mapping name="jzalm:state">
<mapping from="pass" to="com.ibm.rqm.execution.common.state.passed"/>
<mapping from="fail" to="com.ibm.rqm.execution.common.state.failed"/>
<mapping from="inconclusive" to="com.ibm.rqm.execution.common.state.inconclusive"/>
<mapping from="error" to="com.ibm.rqm.execution.common.state.inconclusive"/>
<mapping from="Draft" to="com.ibm.rqm.planning.common.new"/>
<mapping from="Approved" to="com.ibm.rqm.planning.common.approved"/>
<mapping from="ForReview" to="com.ibm.rqm.planning.common.underreview"/>
<mapping from="Blocked" to="com.ibm.rqm.planning.common.new"/>
<mapping from="Implemented" to="com.ibm.rqm.planning.common.new"/>
</enum_mapping>
この例では、列挙タグがキーワード enum_mapping で始まり、name 属性は、値が置換される Rational ClearQuest Test Manager のフィールドを指定します。 第 1 行の pass 属性は、Rational Quality Manager における com.ibm.rqm.execution.common.state.passed に置換されます。 他方で、確定不能なすべてのテスト結果を Rational Quality Manager における障害にマップしたい場合は、その行を <mapping from="inconclusive" to="com.ibm.rqm.execution.common.state.failed"/> に変更することができます。
Rational ClearQuest Test Manage でのフィールドとその値を、Rational Quality Manager でのカテゴリーおよび値にマップすることができます。 カテゴリーが存在しない場合は、それが作成されます。
<attribute from="State" to="category term="Test" " value="value"/>
この例では、State フィールドおよびその値が、Test という名前のカテゴリーにマップされます。 さらに、State フィールドの値がマイグレーションされます。