This workflow accepts any parameter URL from DTP's Explorer views (Test Explorers and Violations Explorers) and passes the parameters to the DTP REST API so that it can query the test cases and generate a CSV output.
In this section:
Requirements
- This artifact is only supported in DTP Enterprise Pack 5.3.2 and is deprecated in 5.3.3.
- This artifact is only supported in DTP 5.3.2 and is deprecated in 5.3.3. See サーバーの設定.
Installation
See アーティファクトのダウンロードとインストール for instructions on installing DTP Enterprise Pack extensions.
Available Endpoints
The workflow provides endpoints specific to the service. To get the endpoint URLs, click on the category in which the artifact is running and expand the appropriate services.
Customization
The Convert Results to Data needed for CSV function node constructs a msg.payload object array for the CSV node to accept.
The CSV node header columns list must be used to construct a new msg.payload object array.
The two items must be in sync. Review the DTP REST API documentation to become familiar with how to customize CSV output from the violation or test case data.
Any fields returned from the /dynamicAnalysisTestCases and /staticAnalysisViolations APIs can be included in CSV output.
DTP Test Case Explorer
The /dynamicAnalysisTestCases API returns data from the テスト エクスプローラー.
Populate the request parameters with URL parameters and click Send Request to view the output.
In the Convert Results to Data needed for CSV node, the values in the csvEntry variable must match the fields specified in the API. For example, if you want to add branch from the resource to be exported. You would add a branch column name and assign a value. Each test case will be under the testCase variable and the branch will be under the testCase.resource object.
Edit the CVS node and add branch to the Columns field.
DTP Violations Explorer
The /staticAnalysisViolations API returns data from the 違反エクスプローラー.
As with the Test Case Explorer, any output from this API can be exported to CSV. See DTP Test Case Explorer for details.
Example
- In Report Center, click Search in the Test Explorer and configure the search options (see テスト エクスプローラー). The search parameters are passed to the URL. For example:
http://<DTP Server>:8080/grs/dtp/explorers/test?filterId=71&buildId=parabank-cbt&action=Retest
- Note the URL and click on the Services tab in Extension Designer.
- Get the endpoints from the services category page (see Available Endpoints):
Run CURL or make an HTTP request to the endpoint with the parameters in your URL. For example:
curl http://localhost:8321/slices/d3cbc19d.a299d?filterId=71&buildId=parabank-cbt&action=RetestUse HTTP(S)-compliance Parameters
パラメーターを追加する際は、文字列パラメーターにスペース、プラス (+)、スラッシュ (/)、その他 HTTP(S) プロトコルが許可しない文字を必ず適切にエンコードしてください。
たとえば、以下のパラメーターは許可されないため、アーティファクトが正しく動作しません。
buildId=c++test
このパラメーターをエンコードすると、以下のようになります。
buildId=C%2D%2Dtest
エンコーディング ツール (たとえば http://www.url-encode-decode.com) を使用すると、規格に準拠するよう適切にパラメーターをエンコードするのに役立ちます。
- If you want to reroute the output stream as a CSV file, use a request such as the following:
curl "http://localhost:8321/slices/d3cbc19d.a299d?filterId=71&buildId=parabank-cbt&action=Retest" > retest-7-parabank-cbt.csv