Uploading Attachments for RQM Automation Result through OSLC
Hello,
I have written a few questions along my journey creating an RQM Automation Adapter from scratch. I have finally created an adapter that is able to handle Automation Requests and post the result back to the system. I now have to attach the actual test system results to the object as explained in Step 30 in the API Reference.
https://jazz.net/wiki/bin/view/Main/RQMTestAutomationAdapterAPI
The uploadAttachmentUrl property is clearly there in the Automation Request object. If I run a GET request on the URI, I receive a list of attachments in the system:
I thought that perhaps it is a special class of attachment that wouldn't show up in the base query, so I have tried adding an
There are no 3xx or 4xx Responses in the entire sequence, however the attachment does not end up in the attachment list or in the desired Automation Result.
How can I get my test results attached to the final Automation Result Resource?
Regards,
Elliot
I have written a few questions along my journey creating an RQM Automation Adapter from scratch. I have finally created an adapter that is able to handle Automation Requests and post the result back to the system. I now have to attach the actual test system results to the object as explained in Step 30 in the API Reference.
https://jazz.net/wiki/bin/view/Main/RQMTestAutomationAdapterAPI
The uploadAttachmentUrl property is clearly there in the Automation Request object. If I run a GET request on the URI, I receive a list of attachments in the system:
<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title type="text">attachment ATOM feed for project area ...</title> <id>https://server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Project/attachment</id>I can also send a POST request to the address with a multipart/form-data request with my file included.
<link href="https://server:9443/qm/web/console/" rel="alternate"/>
<link rel="self" href="https://server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Project/attachment"/>
<entry
xmlns="http://www.w3.org/2005/Atom">
<id>https://server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Project/attachment/urn:com.ibm.rqm:attachment:1</id>
<updated>2013-02-11T09:40:29.794Z</updated>
<title type="text">SW-List.csv</title>
<summary type="text">Attachments Section</summary>
<link href="https://server.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Project/attachment/urn:com.ibm.rqm:attachment:1" rel="alternate" type="application/xml" title=""/>
</entry>
...
</feed>
Headers: Content-Type: multipart/form-data Accept: */*This appears to work at first glance: I receive a 201: Created HTTP response with a 'location' header ('https://server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Project/attachment/slug__yAG_tVzpEeOFGtOkGKTDbw'). However, the new attachment does not appear in the list of attachments if I run another GET on the base address.
Body:
--6c0ebc3aea8b406a8f9aa9955227b52c
Content-Disposition: form-data; name="test_result_report.txt"; filename="test_result_report.txt"
Content-Type: application/octet-stream; name="test_result_report.txt"
<... file-data ...>
--6c0ebc3aea8b406a8f9aa9955227b52c--
I thought that perhaps it is a special class of attachment that wouldn't show up in the base query, so I have tried adding an
rqm_auto:attachment
triple to the URI provided by the in the location header anyways. This does not cause an error in the Automation Result Creation Factory POST, but when I run a GET on the created Automation Result, there is no attachment property included.
There are no 3xx or 4xx Responses in the entire sequence, however the attachment does not end up in the attachment list or in the desired Automation Result.
How can I get my test results attached to the final Automation Result Resource?
Regards,
Elliot
Accepted answer
Hi Elliot,
It appears the attachment is not being created correctly. You need to following the conditions in https://jazz.net/wiki/bin/view/Main/RqmApi#ResourcesFootnote6.
It appears the attachment is not being created correctly. You need to following the conditions in https://jazz.net/wiki/bin/view/Main/RqmApi#ResourcesFootnote6.
Comments
Hi Paul,
I was able to figure it out eventually. Seems like it had to do with tagging the Content-Transfer-Encoding in the request body as "binary". Now I can see the attachment tag is saved in the OSLC representation, and I can access the attachment through the OSLC resources link. However, I can't find any mention of the attachment in the web interface. It seems like all the other pieces of information (verdict, startTime, endTime, other links, etc.) are there, but not attachment. Any idea where I should look for it?
Regards,
Elliot
Hi Elliot,
Attachments are not exposed in the Request and Execution Result editors.
Is this by design? How is the end user supposed to access the results of the test?
2 other answers
Hi Elliot,
By any chance have you looked at how the Eclipse Lyo sample adapter works to upload the attachments?
http://wiki.eclipse.org/Lyo/BuildClient#RQMAutomationSample
The sample adapter runs a test and at the end uploads a sample file to the result. This sample file is visible in the RQM's result UI. Here is a UI screenshot on how the attachment appears here
In eclipse Lyo sample, look for the comment
// Upload an attachment for the result in RQMAutomationSample.java
Hope this helps
Vaibhav