Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RQM API - Creating a Test Case

Hello Colleagues!

I have been unsuccessfully trying to create test cases for the https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/projects/IBM+Ad+Hoc project through the REST API.

I can successfully create the same described test case in the https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Integrator+New+Automation project. I've hit a wall after a couple days and am out of ideas. Creating test cases just returns me a HTTP 400 error. I included the HTTP input / output in the following yucky trace.  I would be very grateful for any suggestions.

Thanks.
Matt


2991 2013-04-29 15:07:37,634 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.renerateRequestBody()
2991 2013-04-29 15:07:37,634 [main] DEBUG httpclient.wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.0[\r][\n]"
2991 2013-04-29 15:07:37,634 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2991 2013-04-29 15:07:37,634 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2991 2013-04-29 15:07:37,634 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2992 2013-04-29 15:07:37,635 [main] DEBUG httpclient.wire.header - >> "Host: jazzc01.hursley.ibm.com:9443[\r][\n]"
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2992 2013-04-29 15:07:37,635 [main] DEBUG httpclient.wire.header - >> "Cookie: JSESSIONID=FCDD6469B3BF85A29C99BA4A796FC045; JazzFormAuth=Form; JSESSIONIDSSO=272FB0FC4662422CE7E340E26BA76084[\r][\n]"
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2992 2013-04-29 15:07:37,635 [main] DEBUG httpclient.wire.header - >> "Content-Length: 1800[\r][\n]"
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2992 2013-04-29 15:07:37,635 [main] DEBUG httpclient.wire.header - >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2992 2013-04-29 15:07:37,635 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.writeLine()
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2993 2013-04-29 15:07:37,636 [main] DEBUG httpclient.wire.header - >> "[\r][\n]"
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection)
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.methods.PostMethod - enter PostMethod.hasRequestContent()
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.hasRequestContent()
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.getRequestContentLength()
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.methods.PostMethod - enter PostMethod.hasRequestContent()
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.hasRequestContent()
2993 2013-04-29 15:07:37,636 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.getRequestOutputStream()
2993 2013-04-29 15:07:37,636 [main] DEBUG httpclient.wire.content - >> "<?xml version="1.0" encoding="UTF-8"?>[\r][\n]"
2993 2013-04-29 15:07:37,636 [main] DEBUG httpclient.wire.content - >> "<testcase[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns="http://jazz.net/xmlns/alm/qm/v0.1/"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns2="http://schema.ibm.com/vega/2008/"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns4="http://purl.org/dc/elements/1.1/"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1"[\r][\n]"
2994 2013-04-29 15:07:37,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1"[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1"[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1">[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "  <projectArea href="https://jazzc01.hursley.ibm.com:9443/qm/resource/itemOid/com.ibm.team.process.ProjectArea/_Bor5QY7IEeGnhIYzInFR8Q"/>[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "  <ns4:title>CopyFileTC</ns4:title>[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "  <ns4:description>Test</ns4:description>[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "  <creationDate>2013-04-29T15:07:37-05:00</creationDate>[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "  <ns5:updated>2013-04-29T15:07:37-05:00</ns5:updated>[\r][\n]"
2995 2013-04-29 15:07:37,638 [main] DEBUG httpclient.wire.content - >> "  <ns5:state>com.ibm.rqm.planning.common.new</ns5:state>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <ns4:creator ns3:resource="https://jazzc01.hursley.ibm.com:9443/jts/resource/itemName/com.ibm.team.repository.Contributor/ebarry@us.ibm.com">ebarry@us.ibm.com</ns4:creator>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <ns5:owner>unassigned</ns5:owner>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <weight>100</weight>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <category term="Function" value="Accessibility"/>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <category term="Sub-function" value="Unassigned"/>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <category term="Micro-function" value="Unassigned"/>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <category term="PE-Build" value="Unassigned"/>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <category term="Release" value="IBM QuickFile 1.1.0.0"/>[\r][\n]"
2996 2013-04-29 15:07:37,639 [main] DEBUG httpclient.wire.content - >> "  <category term="Story" value="1000"/>[\r][\n]"
2997 2013-04-29 15:07:37,640 [main] DEBUG httpclient.wire.content - >> "  <category term="Test Phase" value="Draft"/>[\r][\n]"
2997 2013-04-29 15:07:37,640 [main] DEBUG httpclient.wire.content - >> "  <category term="Test Type" value="Iteration 10"/>[\r][\n]"
2997 2013-04-29 15:07:37,640 [main] DEBUG httpclient.wire.content - >> "</testcase>[\r][\n]"
2997 2013-04-29 15:07:37,640 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - Request body sent

0 votes



2 answers

Permanent link
Hi Matthew,

I would start investigating these 2 directions :

1) HTTP 400 response code means "Bad Request". That's normally seen when the resource URL is malformed or the specified project area does not exist. Can you open the URL used for the creation of the test case - minus the specific test case - part in your browser (with your exact same user logged) ? ( should be sthg like : https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Integrator+New+Automation/testcase )
2) did you check that your user has permission to create artefacts in the project, has the right license and is a member of the Integrator+New+Automation  project area ?

For more references / guidance, you could refer to the RQM wiki for OSLC QM V2 API
If looking for sample-based information, have a read to OSLC/REST APIs "cheat sheets" / "How Tos"

Regards,
Stéphane

0 votes

Comments

I would suggest it's #1:

2993 2013-04-29 15:07:37,636 [main] DEBUG httpclient.wire.content - >> "<testcase[\r][\n]" <br=""> 2994

See https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip.


Permanent link
Thank you for your suggestions.  I used your method of logging into the web view and playing with the URL.  It seems that my problem project area uses the Alias to create a testcase.  The previous project area was able to use the Title.  Once I popped the Alias in there on a guess, I got an atom feed back.  That was the key.  Thanks for the hints!

Matt

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,953

Question asked: Apr 29 '13, 4:15 p.m.

Question was seen: 5,437 times

Last updated: Apr 30 '13, 10:19 a.m.

Confirmation Cancel Confirm