Linux または MacOS の場合は、製品のインストール・ディレクトリーを指す環境変数 (例: export TEST_WORKBENCH_HOME=/opt/IBM/SDP) を追加します。
Windows の場合、この環境変数は既に定義されています。
Maven を使用してテストを自動化するには、pom.xml ファイルを構成し、Maven コマンドを使用してコマンド行からテストを起動する必要があります。ユーザー独自の pom ファイルを使用することも、製品に付属のファイルを使用することもできます。
これらのファイルには、すべてのタイプの依存関係と、テスト・スクリプトの実行に必要な引数が含まれています。Maven を使用してテストを実行する方法は 2 つあります。
<!--test suite="testSources/Test1.testsuite"/-->
<!--test suite="Test2.testsuite"/-->
<test suite="C:/Runtimes/runtime-RptMvn/AA/testSources/Test2.testsuite" plugins="C:/Program Files/IBM/IBMIMShared/plugins"/>
<!--test schedule="Schedule.testsuite" project="AA" workspace="C:/Runtimes/runtime-RptMvn" plugins="C:/Program Files/IBM/IBMIMShared/plugins"/-->
<!--test suite="Test2.testsuite" project="AA" workspace="C:/Runtimes/runtime-RptMvn"/-->
<!--test aftsuite="Test1.xml" project="AA" workspace="C:/Runtimes/runtime-RptMvn" plugins="C:/Program Files/IBM/IBMIMShared/plugins"/-->
mvn versions:update-properties -Dincludes=com.hcl.products.test.it -f pomCustomSurefireSample.xml
mvn clean verify -f pomCustomSurefireSample.xml
フェイルセーフ・レポートが、ターゲット・ディレクトリー (特に、実行の画面キャプチャーが含まれる target/failsafe-reports/<ProjectName>/<TestName>_<timestamp>.txt) に生成されます。
<argument>/C</argument>
<argument>${pt-plugin-cmdline}</argument>
<argument>-workspace</argument>
<argument>C:\Runtimes\runtime-RptMvn</argument>
<argument>-project</argument>
<argument>AA</argument>
<argument>-suite</argument>
<argument>Test1.testsuite</argument>
<argument>-plugins</argument>
<argument>C:/Program Files/IBM/IBMIMShared/plugins</argument>
Windows の場合:
mvn clean verify -f pomMojoExecPluginSample_Windows.xml
Linux または MacOS の場合:
mvn clean verify -f pomMojoExecPluginSample_Linux.xml