@@ -0,0 +1,2058 @@
+package jira;%0A%0Aimport static com.jayway.restassured.RestAssured.preemptive;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport static com.jayway.restassured.RestAssured.get;%0Aimport com.jayway.restassured.RestAssured;%0Aimport com.jayway.restassured.authentication.AuthenticationScheme;%0Aimport com.jayway.restassured.path.json.JsonPath;%0A%0Aimport selenium.Tool;%0A%0Apublic class SearchExecutions %7B%0A%0A%09private final AuthenticationScheme auth = preemptive().basic(%22rgates%22,%22password1%22);%0A%09private final String zapiURI = %22http://localhost:8079/rest/zapi/latest%22;%0A%09%0A%09private final JsonPath jsonPath;%0A%09%0A%09public SearchExecutions(final String query)%0A%09%7B%0A%09%09RestAssured.baseURI = zapiURI;%0A%09%09RestAssured.authentication = auth;%0A%09%09%0A%09%09jsonPath = get(String.format(%22zql/executeSearch?zqlQuery=%25s%22, query)).andReturn().jsonPath();%0A%09%7D%0A%09%0A%09//Returns the execution Ids returned by the search%0A%09public List%3CInteger%3E getExecutionIds()%0A%09%7B%0A//TODO%09%09final String browser = getBrowserNameAndVersion();%0A%09%09final String browser = %22FF10%22;%0A%09%09%0A%09%09final List%3CInteger%3E tempExecutionIds = jsonPath.getList(%22executions.id%22);%0A%09%09final List%3CInteger%3E executionIds = new ArrayList%3CInteger%3E();%0A%09%09final List%3CString%3E cycleNames = jsonPath.getList(%22executions.cycleName%22);%0A%09%09for (int idx = 0; idx %3C cycleNames.size(); idx++)%0A%09%09%7B%0A%09%09%09if (cycleNames.get(idx).contains(browser))%0A%09%09%09%7B%0A%09%09%09%09executionIds.add(tempExecutionIds.get(idx));%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return executionIds;%0A%09%7D%0A%09%0A%09//Returns the execution statuses returned by the search%0A%09public List%3CInteger%3E getExecutionStatuses()%0A%09%7B%0A//TODO%09%09final String browser = getBrowserNameAndVersion();%0A%09%09final String browser = %22FF10%22;%0A%09%09%0A%09%09final List%3CInteger%3E tempExecutionStatuses = jsonPath.getList(%22executions.status.id%22);%0A%09%09final List%3CInteger%3E executionStatuses = new ArrayList%3CInteger%3E();%0A%09%09final List%3CString%3E cycleNames = jsonPath.getList(%22executions.cycleName%22);%0A%09%09for (int idx = 0; idx %3C cycleNames.size(); idx++)%0A%09%09%7B%0A%09%09%09if (cycleNames.get(idx).contains(browser))%0A%09%09%09%7B%0A%09%09%09%09executionStatuses.add(tempExecutionStatuses.get(idx));%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return executionStatuses;%0A%09%7D%09%0A%7D%0A

Create SearchExecutions.java