RQM: how to read Test case category attributes values from extended properties through OSLC
Hi All,
{
Map<String,String> testCaseAttributes = new HashMap<String, String>();
for (Entry<QName, Object> extendedProperty : testCase.getExtendedProperties().entrySet()) {
if("category".equalsIgnoreCase(extendedProperty.getKey().getLocalPart())) {
//System.out.println("Key :" +extendedProperty.getKey() + " Value : " + extendedProperty.getValue());
Object value = extendedProperty.getValue();
if(value instanceof ArrayList<?>){
ArrayList<?> extendedProp = (ArrayList<?>) value;
//System.out.println("we are getting category value : " );
for(int i = 0; i< extendedProp. size(); i++){
AnyResource resources = (AnyResource) extendedProp.get(i); // Getting URI and can not Cast to AnyResource.
String categoryName = "";
String categoryValue = "";
for (Entry<QName, Object> resource : resources.getExtendedProperties().entrySet()) {
if("title".equalsIgnoreCase(resource.getKey().getLocalPart())){
categoryName = resource.getValue().toString();
}else if("subject".equalsIgnoreCase(resource.getKey().getLocalPart())){
categoryValue = resource.getValue().toString();
}
}
testCaseAttributes.put(categoryName, categoryValue);
}
}
}
}
|
One answer
The category in a test case looks like this in the XML output.
<ns2:category term="Test Phase" value="Integration Test"/>What do you mean that you get "an array of the URI"? |
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.