Package com.thed.zblast.util
Class RestUtil
java.lang.Object
com.thed.zblast.util.RestUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAttachment
(Map<Long, List<File>> releaseAttachmentFile, long testerId) static CyclePhaseDTO
addPhaseToCycle
(CyclePhaseDTO cyclePhase, AutomationJobDetail automationJobDetail) static void
addTestCaseAttachment
(Map<Long, List<File>> testCaseAttachmentFile, long testerId) static void
assignExecutions
(CyclePhaseDTO cyclePhase, ZephyrConfigModel zephyrData) static void
browseTestcases
(CyclePhaseDTO cyclePhase, List<TreeSelectionInfo> selectionTree, Boolean createPackage) static AutomationJobSet
checkPayLoadForZblast
(String status, Agent agent) Input: method sends agent.token attribute Output: can be one of these: TestcaseBatchExecution object in JSON format.static CycleDTO
CreateCycle
(CycleDTO rCycle) static TCRCatalogTreeDTO
createNode
(TCRCatalogTreeDTO tree, String type, Long parentId, String parentName) static List<AutomationJobScheduleDTO>
createScheduleForSchduledJobs
(AutomationJobDetail automationJobDetail, String status) static TCRCatalogTreeDTO
createTree
(TCRCatalogTreeDTO remoteRepositoryTree) static List<ReleaseTestSchedule>
execute
(List<ExecutionRequest> executionRequestList) static List<ReleaseTestSchedule>
executeAll
(List<ExecutionRequest> executionRequestList) static Integer
static org.apache.commons.httpclient.HttpClient
static UserDTO
static CycleDTO
static CycleDTO
getCycleNames
(Long releaseId, String sortBy, String cycleName) static List<ScheduledTestCaseMetaDataDTO>
getFailedTCSMetadata
(int schedulerId) static List<AutomationJobDetail>
getFileWatcherJobs
(Agent agent) static ProjectDTO
static SearchResult<ReleaseTestSchedule>
getReleaseTestSchedules
(CyclePhaseDTO cycle, Long releaseId) static List<ReleaseTestSchedule>
getReleaseTestSchedulesById
(List<Long> rtsIds) static AutomationScriptJobDTO
getScriptJobDetail
(Long JobId) static TestStep
getStepsForTestcase
(Long testcaseId) getTCRCatalogTreeIdHierarchy
(Long tcrCatalogTreeId) static PreferenceDTO
static List<TCRCatalogTreeDTO>
getTreesByReleaseId
(AutomationJobDetail releaseId, String type, int revisionId) static TCRCatalogTreeDTO
getTreesByTreeId
(Long tcrCatalogTreeId) static String
getURL()
static void
handleHttpError
(int statusCode, String calledMethodName, org.apache.commons.httpclient.HttpMethod method) static SearchResult<ReleaseTestSchedule>
inGetReleaseTestSchedules
(org.apache.commons.httpclient.methods.GetMethod method) static SearchResult<TCRCatalogTreeTestcase>
inSearchtestcase
(org.apache.commons.httpclient.methods.GetMethod method) static String
static boolean
static void
static List<TCRCatalogTreeTestcase>
saveBulkTestCases
(List<TCRCatalogTreeTestcase> testcaseList, AutomationJobDetail automationJobDetail) static SearchResult<TCRCatalogTreeTestcase>
searchtestcase
(Long altId) static List<SearchResult<TCRCatalogTreeTestcase>>
searchTestcaseOnName
(String name, long releaseId) static String
updateAutomationScheduledJobStatus
(Long id, String status) static String
updateAutomationStatusInBulk
(LongIdListRequest ids, String status) static CycleDTO
updateCycle
(CycleDTO rCycle) static List<ReleaseTestSchedule>
updateExecutions
(List<ReleaseTestSchedule> releaseSchedulesList) static List<ReleaseTestSchedule>
updateExecutions
(List<ReleaseTestSchedule> releaseSchedulesList, int batch_size) static boolean
updateFailedTestExecutions
(List<ScheduledTestCaseMetaDataDTO> scheduledTestCaseMetaDataDTOResults) static void
updateFileWatcher
(AutomationJobDetail schedule, String status, String info) static String
updateRequirement
(List<MapTestcaseToRequirement> mapTestcaseToRequirements) static String
updateRequirement
(List<MapTestcaseToRequirement> mapTestcaseToRequirements, int batchSize) static void
updateStatus
(Long scheduleId, String zblastJobStatusInprogress, AutomationJobDetail automationJob, long cycleId) static List<TestStepResult>
updateStepExecutions
(List<TestStepResult> releaseStepList) static List<TestStepResult>
updateStepExecutions
(List<TestStepResult> releaseStepList, int batchSize) static String
updateTCRTestCasesForCycleName
(String cycleName, List<Long> tcrCatalogTreeTestcasesIds) static List<TCRCatalogTreeTestcase>
updateTestcases
(List<TestcaseBulkUpdateParam> paramList) static void
updateTestResult
(List<RemoteTestResult> testResults) static String
updateZblastScheduleStatus
(Long id, String status, String cycleId, AutomationJobDetail automationJob)
-
Field Details
-
urlFragmentZblast
- See Also:
-
URL_BULK_AUTOMATION_UPDATE
- See Also:
-
URL_FOR_PROJECT
- See Also:
-
URL_BULK_TESECASES
- See Also:
-
URL_RELEASE_SCHEDULED_TCRTESTCASES
- See Also:
-
URL_BULK_TESECASES_UPDATE
- See Also:
-
URL_TESTCASE_SEARCH
- See Also:
-
URL_CREATE_CYCLE
- See Also:
-
URL_UPDATE_CYCLE
- See Also:
-
URL_CREATE_PHASE
- See Also:
-
URL_ADD_PHASE_TO_CYCLE
- See Also:
-
URL_ASSIGN_PHASE
- See Also:
-
URL_UPDATE_EXECUTION
- See Also:
-
URL_EXECUTE_IN_BULK
- See Also:
-
URL_UPDATE_STEP_EXECUTION
- See Also:
-
URL_GET_PHASES
- See Also:
-
URL_GET_PHASES_BY_ID
- See Also:
-
URL_GET_TESTSTEPS
- See Also:
-
URL_GET_LOGGED_IN_USER
- See Also:
-
URL_GET_RELEASE_TEST_SCHEDULES
- See Also:
-
URL_BROWSE_TESTCASES_TO_PHASE
- See Also:
-
URL_SEARCH_TESTCASES_ON_NAME
- See Also:
-
URL_GET_CYCLE_BY_ID
- See Also:
-
URL_GET_CYCLE_NAMES
- See Also:
-
URL_GET_CYCLE_PHASE_BY_ID
- See Also:
-
URL_BULK_REQUIREMENTS_RELEASE
- See Also:
-
URL_JOB_SCHEDULED
- See Also:
-
-
Constructor Details
-
RestUtil
public RestUtil()
-
-
Method Details
-
getConnectionFromPool
-
getURL
-
getAutomationJobResultFilereadingMonitorWaitTime
-
updateZblastScheduleStatus
public static String updateZblastScheduleStatus(Long id, String status, String cycleId, AutomationJobDetail automationJob) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateFileWatcher
public static void updateFileWatcher(AutomationJobDetail schedule, String status, String info) throws IOException - Throws:
IOException
-
getMethodForProject
- Throws:
IOException
-
updateTCRTestCasesForCycleName
public static String updateTCRTestCasesForCycleName(String cycleName, List<Long> tcrCatalogTreeTestcasesIds) throws IOException - Throws:
IOException
-
saveBulkTestCases
public static List<TCRCatalogTreeTestcase> saveBulkTestCases(List<TCRCatalogTreeTestcase> testcaseList, AutomationJobDetail automationJobDetail) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateTestcases
public static List<TCRCatalogTreeTestcase> updateTestcases(List<TestcaseBulkUpdateParam> paramList) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
inSearchtestcase
public static SearchResult<TCRCatalogTreeTestcase> inSearchtestcase(org.apache.commons.httpclient.methods.GetMethod method) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
searchtestcase
- Throws:
IOException
-
CreateCycle
public static CycleDTO CreateCycle(CycleDTO rCycle) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateCycle
- Throws:
IOException
-
createTree
public static TCRCatalogTreeDTO createTree(TCRCatalogTreeDTO remoteRepositoryTree) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
addPhaseToCycle
public static CyclePhaseDTO addPhaseToCycle(CyclePhaseDTO cyclePhase, AutomationJobDetail automationJobDetail) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
getTCRCatalogTreeIdHierarchy
- Throws:
IOException
-
assignExecutions
public static void assignExecutions(CyclePhaseDTO cyclePhase, ZephyrConfigModel zephyrData) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
inGetReleaseTestSchedules
public static SearchResult<ReleaseTestSchedule> inGetReleaseTestSchedules(org.apache.commons.httpclient.methods.GetMethod method) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
getReleaseTestSchedules
public static SearchResult<ReleaseTestSchedule> getReleaseTestSchedules(CyclePhaseDTO cycle, Long releaseId) throws IOException - Throws:
IOException
-
updateExecutions
public static List<ReleaseTestSchedule> updateExecutions(List<ReleaseTestSchedule> releaseSchedulesList) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateExecutions
public static List<ReleaseTestSchedule> updateExecutions(List<ReleaseTestSchedule> releaseSchedulesList, int batch_size) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
executeAll
public static List<ReleaseTestSchedule> executeAll(List<ExecutionRequest> executionRequestList) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
execute
public static List<ReleaseTestSchedule> execute(List<ExecutionRequest> executionRequestList) throws IOException - Throws:
IOException
-
getTreesByReleaseId
public static List<TCRCatalogTreeDTO> getTreesByReleaseId(AutomationJobDetail releaseId, String type, int revisionId) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
getTreesByTreeId
public static TCRCatalogTreeDTO getTreesByTreeId(Long tcrCatalogTreeId) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
createNode
public static TCRCatalogTreeDTO createNode(TCRCatalogTreeDTO tree, String type, Long parentId, String parentName) throws IOException - Throws:
IOException
-
getCurrentLoggedinUser
public static UserDTO getCurrentLoggedinUser() throws org.apache.commons.httpclient.HttpException, IOException- Throws:
org.apache.commons.httpclient.HttpException
IOException
-
addAttachment
public static void addAttachment(Map<Long, List<File>> releaseAttachmentFile, long testerId) throws org.apache.http.client.ClientProtocolException, IOException- Throws:
org.apache.http.client.ClientProtocolException
IOException
-
updateStepExecutions
public static List<TestStepResult> updateStepExecutions(List<TestStepResult> releaseStepList) throws IOException - Throws:
IOException
-
updateStepExecutions
public static List<TestStepResult> updateStepExecutions(List<TestStepResult> releaseStepList, int batchSize) throws IOException - Throws:
IOException
-
getStepsForTestcase
- Throws:
IOException
-
browseTestcases
public static void browseTestcases(CyclePhaseDTO cyclePhase, List<TreeSelectionInfo> selectionTree, Boolean createPackage) throws IOException - Throws:
IOException
-
logout
- Throws:
IOException
-
login
- Throws:
IOException
-
searchTestcaseOnName
public static List<SearchResult<TCRCatalogTreeTestcase>> searchTestcaseOnName(String name, long releaseId) throws IOException - Throws:
IOException
-
updateStatus
public static void updateStatus(Long scheduleId, String zblastJobStatusInprogress, AutomationJobDetail automationJob, long cycleId) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
checkPayLoadForZblast
public static AutomationJobSet checkPayLoadForZblast(String status, Agent agent) throws org.apache.commons.httpclient.HttpException, IOException Input: method sends agent.token attribute Output: can be one of these: TestcaseBatchExecution object in JSON format. i.e. task to be processed blank string, i.e. no task to be processed STATUS_SESSION_EXPIRED, i.e. session expired.- Throws:
org.apache.commons.httpclient.HttpException
IOException
-
getFileWatcherJobs
public static List<AutomationJobDetail> getFileWatcherJobs(Agent agent) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
updateAutomationStatusInBulk
public static String updateAutomationStatusInBulk(LongIdListRequest ids, String status) throws IOException - Throws:
IOException
-
createScheduleForSchduledJobs
public static List<AutomationJobScheduleDTO> createScheduleForSchduledJobs(AutomationJobDetail automationJobDetail, String status) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateAutomationScheduledJobStatus
public static String updateAutomationScheduledJobStatus(Long id, String status) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
postProgressDetails
- Throws:
IOException
-
getFailedTCSMetadata
public static List<ScheduledTestCaseMetaDataDTO> getFailedTCSMetadata(int schedulerId) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateFailedTestExecutions
public static boolean updateFailedTestExecutions(List<ScheduledTestCaseMetaDataDTO> scheduledTestCaseMetaDataDTOResults) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
getCycle
- Throws:
IOException
-
getCycleNames
public static CycleDTO getCycleNames(Long releaseId, String sortBy, String cycleName) throws IOException - Throws:
IOException
-
addTestCaseAttachment
public static void addTestCaseAttachment(Map<Long, List<File>> testCaseAttachmentFile, long testerId) throws org.apache.http.client.ClientProtocolException, IOException- Throws:
org.apache.http.client.ClientProtocolException
IOException
-
updateRequirement
public static String updateRequirement(List<MapTestcaseToRequirement> mapTestcaseToRequirements) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateRequirement
public static String updateRequirement(List<MapTestcaseToRequirement> mapTestcaseToRequirements, int batchSize) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateTestResult
public static void updateTestResult(List<RemoteTestResult> testResults) throws org.apache.commons.httpclient.HttpException, IOException - Throws:
org.apache.commons.httpclient.HttpException
IOException
-
getTestExecutionStatuses
- Throws:
IOException
-
getReleaseTestSchedulesById
public static List<ReleaseTestSchedule> getReleaseTestSchedulesById(List<Long> rtsIds) throws IOException - Throws:
IOException
-
getScriptJobDetail
- Throws:
IOException
-
handleHttpError
public static void handleHttpError(int statusCode, String calledMethodName, org.apache.commons.httpclient.HttpMethod method) throws IOException - Throws:
IOException
-