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 Folder 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);
xAFTRallyScenarioDataMap.getInstance().setFolderReferenceMap(
folderReferenceMap);
}
LOGGER.debug("Folder list loading  from Rally is complete");
}

return folderReferenceMap;

}

1 comment:

  1. Casino Slots - JTHub
    Free 김포 출장안마 Play for 안성 출장샵 Casino 용인 출장마사지 Slots. If you 거제 출장마사지 are a fan of the best casino slots we recommend JTG's, check out the 세종특별자치 출장마사지 official site. Find all the great casino games you

    ReplyDelete