Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 13 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD,Manual Testing

Followers

Saturday, March 15, 2014

How to Fetch the Rally User Story List

public Map<String, Map<String, String>> getFolderList() throws IOException {
if (folderReferenceMap.isEmpty()) {
QueryRequest folderRequest = new QueryRequest("TestFolder");
// spaces
folderRequest.setFetch(new Fetch("FormattedID", "Name"));
LOGGER.info("Feting the folder list from Rally for project ["
+ ReadProperties.getInstance().getProperty("rallyProject")
+ "]");
folderRequest.setQueryFilter(new QueryFilter("Project.Name", "=",
ReadProperties.getInstance().getProperty("rallyProject")));
QueryResponse folderQueryResponse = restApi.query(folderRequest);
// JsonObject testSetJsonObject =
// testSetQueryResponse.getResults().get(0).getAsJsonObject();
JsonArray resultArray = folderQueryResponse.getResults();
for (JsonElement result : resultArray) {
String rallyFolderObjId = result.getAsJsonObject().get("_ref")
.getAsString();
LOGGER.debug(rallyFolderObjId);
String rallyFolderName = result.getAsJsonObject()
.get("_refObjectName").getAsString();
// System.out.println(rallyFolderName);

String formattedId = result.getAsJsonObject()
.get("FormattedID").getAsString();
// System.out.println(formattedId);

String testFolder = "testfolder";
int stringPosition = rallyFolderObjId.indexOf(testFolder)
+ testFolder.length() + 1;
rallyFolderObjId = rallyFolderObjId.substring(stringPosition,
rallyFolderObjId.length());
// System.out.println(rallyFolderObjId);
Map<String, String> folderMap = new HashMap<String, String>();
folderMap.put(rallyFolderObjId, rallyFolderName);
folderReferenceMap.put(formattedId, folderMap);

}
LOGGER.debug("Folder list loading  from Rally is complete");
}

return folderReferenceMap;

}

No comments:

Post a Comment