Create a new RQM test case with OSLC
Nicola Carusi (28●10●11)
| asked May 22 '14, 12:11 p.m.
edited May 23 '14, 5:00 a.m. by Ralph Schoon (63.6k●3●36●46) Hi, I'm trying to create a TestCase usign OSLC. These are the step that I'm following: STEP 1 GET request to https://jazz.amsspa.it:9443/qm/rootservices. What I get is the following: ... <oslc_qm:qmServiceProviders xmlns:oslc_qm="http://open-services.net/xmlns/qm/1.0/" rdf:resource="https://jazz.amsspa.it:9443/qm/oslc_qm/catalog" /> ...
STEP 2 GET request to https://jazz.amsspa.it:9443/qm/oslc_qm/catalog What I get is the following: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <oslc_disc:ServiceProviderCatalog rdf:about="https://jazz.amsspa.it:9443/qm/oslc_qm/catalog" xmlns:jproc="http://jazz.net/xmlns/prod/jazz/process/1.0/" xmlns:oslc_qm="http://open-services.net/xmlns/qm/1.0/" xmlns:ns5="http://open-services.net/ns/qm#" xmlns="http://purl.org/dc/elements/1.1/" xmlns:ns8="http://jazz.net/ns/qm/rqm#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/" xmlns:jpres="http://jazz.net/xmlns/prod/jazz/presentation/1.0/" xmlns:ns3="http://open-services.net/ns/core#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:dc="http://purl.org/dc/terms/"> <dc:title>RQM Quality Management Service Provider Catalog</dc:title> <oslc_disc:entry>
</oslc_disc:entry> </oslc_disc:ServiceProviderCatalog>
STEP 3
GET Request to https://jazz.amsspa.it:9443/qm/oslc_qm/contexts/_7jMxz8YsEeOl9adIPSWrPQ/services.xml
With the 3rd request I get the following response: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <oslc_qm:ServiceDescriptor xmlns:jproc="http://jazz.net/xmlns/prod/jazz/process/1.0/" xmlns:oslc_qm="http://open-services.net/xmlns/qm/1.0/" xmlns:ns5="http://open-services.net/ns/qm#" xmlns="http://purl.org/dc/elements/1.1/" xmlns:ns8="http://jazz.net/ns/qm/rqm#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/" xmlns:jpres="http://jazz.net/xmlns/prod/jazz/presentation/1.0/" xmlns:ns3="http://open-services.net/ns/core#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:dc="http://purl.org/dc/terms/"> <dc:title>Project Area Prova Cate RQM</dc:title> <dc:description>Project Area Prova Cate RQM</dc:description> <oslc_qm:testplans oslc_qm:version="I20140205_1831">
</oslc_qm:testplans> <oslc_qm:testcases oslc_qm:version="I20140205_1831">
</oslc_qm:testcases> <oslc_qm:executionresults oslc_qm:version="I20140205_1831">
</oslc_qm:executionresults> <oslc_qm:executionrecords oslc_qm:version="I20140205_1831">
</oslc_qm:executionrecords> </oslc_qm:ServiceDescriptor>
At this point of the process, I'm missing the following step!! Can anyone help me? Thank you Nicola
|
7 answers
Nicola
Have you tried [“Cheat sheets” for creating test resources through REST APIs.] from http://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api/ Thanks |
You might want to POST to those URI's:
Test Case: http://SERVERNAME:PORT/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTNAME/testcase/urn:com.ibm.rqm:testcase Test Plan: http://SERVERNAME:PORT/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTNAME/testplan/urn:com.ibm.rqm:testplan Project Name should be decoded by using URLEncoder.encode(projectname, HTTP.UTF_8) In case you want to GET test case or plan, you need to GET those URI's Test Case: http://SERVERNAME:PORT/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTNAME/testcase/urn:com.ibm.rqm:testcase:TESTCASEID Test Plan: http://SERVERNAME:PORT/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTNAME/testplan/urn:com.ibm.rqm:testplan:TESTPLANID |
Hi Camberk, I'm trying your suggestions. I'm trying to send a POST request to the following URL. Is the encoding of the Project Name correct or do I have to use Project%20Area%20Prova%20Cate%20RQM instead of projectAreaId=_7jMxz8YsEeOl9adIPSWrPQ? Anyway, in both cases I'm getting from the server an empty string as response e no test cases are created. With a POST request, can I send an XML file? Thank you!
Comments
Canberk Akduygu
commented May 23 '14, 4:51 a.m.
You need to use the encoded project name.
|
Hi Don, following your link, it seems that the URL to be used to create a new test case is I'm trying with it, but I'm always getting an empty string from the server. Probably I'm doing something wrong in the request..I don't know!
Comments add urn:com.ibm.rqm:testcase add the end of the URI. so your URI be like
Nicola Carusi
commented May 23 '14, 5:18 a.m.
Ok, I'm using a PHP script like the following one. $content="xml string of the test case"; $url = "https://jazz.amsspa.it:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Project%20Area%20Prova%20Cate%20RQM/testcase/urn:com.ibm.rqm:testcase";
$headers = Array('Accept: application/xml', 'OSLC-Core-Version: 2.0', 'Content-Type: application/rdf+xml'); $ch= curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, "$content"); $response = curl_exec($ch); The variable $response is set to TRUE by the curl_exec function, which means that the request is correctly done. But if I go on the server there is no new test case!!
Where is the mistake?
|
I'm trying to analyze my request with an HTTP analyzer. In the response header there is: X-com-ibm-team-repository-web-auth-msg: authrequired.
Do I have to send also my username and password? How can I do that? Comments
Canberk Akduygu
commented May 23 '14, 6:58 a.m.
You should first login to the application as anonymous access is not possible.
|
Hi Camberk, I'm trying with RESTClient of Firefox. I correctly created a TestCase with an XML file and now I'm trying with the RDF. I'm performing this request: POST Headers: Accept: application/rdf+xml OSLC-Core-Version: 2.0 X-Jazz-CSRF-Prevent: 00002mT2kZHJgS67Jd5U-2PPFkU:-1 Content-Type: application/rdf+xml In the Body i'm putting this:
<?xml version="1.0" encoding="UTF-8"?>
I'm getting the response 400 Bad request: The uploaded content does not consist of well-formed XML or does not match the XML schema for testcase I cannot understand what is wrong in the content. Any suggestion? Thank you
Comments
Donald Nong
commented Jul 24 '14, 10:00 p.m.
If you get complaints about a malformed XML content, try to use the XML response of an existing test case as a template. Also, IE can do a fine job when verifying the format of an XML file.
|
Hello,
I am trying to set owner of a test plan during test plan creation by adding <ns5:owner ns1:resource="https://wat01ibmclm.int.teb.com.tr:9443/jts/resource/itemName/com.ibm.team.repository.Contributor/P21885">P21885</ns5:owner> line to my xml. test Plan is created but its owner is always the creator. Is there a way to set owner via REST API? Comments
Donald Nong
commented Jul 24 '14, 9:57 p.m.
That should be the right way since it works for me with RQM 4.0.6.
Canberk Akduygu
commented Jul 25 '14, 2:14 a.m.
I also cannot set Categories.
Canberk Akduygu
commented Jul 25 '14, 2:52 a.m.
I found the problem.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.