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

How to set priority in RQM while creating test case using Eclipse Lyo

Hello,

I am trying to create a test case using eclipse lyo. I am not able to set the priority using QName.
Please help

private static final String QM_NAMESPACE = "http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/";
private static final String PRIORITY = "priority";

TestCase tc = new TestCase();      
tc.setTitle(rqmAdapterInput.getTestCaseDTO().getTitle());        tc.setDescription(rqmAdapterInput.getTestCaseDTO().getDescription());                      
QName priority = new QName(QM_NAMESPACE, PRIORITY,PRIORITY);       
Map<QName, Object> priorityMap = new HashMap<QName, Object>();       
priorityMap.put(priority, "literal.priority.130");                       
tc.setExtendedProperties(priorityMap);                               
String testcaseCreation = client.lookupCreationFactory(serviceProviderUrl,OSLCConstants.OSLC_QM_V2,              tc.getRdfTypes()[0].toString());               
System.out.println(testcaseCreation);       

ClientResponse creationResponse = client.createResource(testcaseCreation, tc,OslcMediaType.APPLICATION_RDF_XML);      

if (creationResponse.getStatusCode() != HttpServletResponse.SC_CREATED) {            System.err.println("ERROR: Could not create the test case (status "creationResponse.getStatusCode()+ ")\n");            System.err.println(creationResponse.getEntity(String.class));                  
 }       
creationResponse.consumeContent();       

String testcaseLocation = creationResponse.getHeaders().getFirst(HttpHeaders.LOCATION);        System.out.println("Test Case created a location " + testcaseLocation);




























0 votes



2 answers

Permanent link

The property is rqm_process:hasPriority.  Please review the test case resource shape.  Also, when testing your code, try the same request using a HTTP client to eliminate any issues with your code or Eclipse Lyo.

1 vote


Permanent link

Thanks Paul for your reply.
My observation

While creating , it is no setting the priority. But if i update by modifying the existing QName and set the value to LOW, MEDIUM, HIGH is working.

private static final String QM_NAMESPACE = "http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/";    private static final String PRIORITY = "hasPriority";   
private static final String PREFIX = "rqm_process";


To be precise, while creating priority value is not getting set but for updating it works. I dont know whether this is a bug in eclipse lyo API implementation or from RQM test creation using OSLC.





0 votes

Comments

The qm_process:hasPriority property support create/update/read operation.  This information is in the test case resource shape. 

As mentioned, when testing your code, try the same request using a HTTP client to eliminate any issues with your code or Eclipse Lyo.

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

Question asked: Mar 12 '18, 10:13 a.m.

Question was seen: 2,139 times

Last updated: Mar 14 '18, 7:14 a.m.

Confirmation Cancel Confirm