Package com.thed.util
Class ScriptUtil
java.lang.Object
com.thed.util.ScriptUtil
This class contains utility methods to assist in communicating status of testcase to server.
- Author:
- zephyrDev
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<TestCaseResultModel>
prepareZephyrTests
(List<TestcaseModel> testsFromTestSuiteList) static List<ReleaseTestSchedule>
processTestCaseExecution
(TestcaseBatchExecution testcaseBatchExecution, String statusId, Agent agent) static void
processTestCaseExecution
(TestcaseBatchExecution testcaseBatchExecution, List<ReleaseTestSchedule> releaseTestSchedules, List<TestCaseResultModel> testCaseResultModels, Agent agent) static String
sendResponse
(org.apache.commons.httpclient.HttpClient client, String url, String token, String status, TestcaseBatchExecution task) Sends overall batch status along with TestcaseBatchExecution details to server.static ReleaseTestSchedule
setExecutionInRTS
(ReleaseTestSchedule releaseTestSchedule, ExecutionRequest executionRequest) static void
updateAgentRealTimeStatus
(org.apache.commons.httpclient.HttpClient client, String url, String token, String status) Refreshes Agent entity's realtime status.static void
updateParseTestcaseExecutionResult
(TestcaseBatchExecution testcaseBatchExecution, Agent agent) static void
updateTestcaseExecutionResult
(TestcaseBatchExecution testcaseBatchExecution, TestcaseExecution tce, int executionStatus, String executionNotes) static void
updateTestcaseExecutionResult
(String serverUrl, TestcaseBatchExecution testcaseBatchExecution, TestcaseExecution tce, int executionStatus, String executionNotes) Webservice call to update testcase execution result.
-
Constructor Details
-
ScriptUtil
public ScriptUtil()
-
-
Method Details
-
sendResponse
public static String sendResponse(org.apache.commons.httpclient.HttpClient client, String url, String token, String status, TestcaseBatchExecution task) throws org.apache.commons.httpclient.HttpException, IOException Sends overall batch status along with TestcaseBatchExecution details to server.- Parameters:
client
- instance of HttpClient objecturl
- server url.token
- Agent.tokenstatus
- overall status of batch, hardcoded to "success". Even though individual testcase may fail, overall batch was executed by zbot successfully.task
- TestcaseBatchExecution object in JSON format.- Returns:
- response String. Servlet returns STATUS_OK
- Throws:
org.apache.commons.httpclient.HttpException
IOException
-
updateTestcaseExecutionResult
public static void updateTestcaseExecutionResult(String serverUrl, TestcaseBatchExecution testcaseBatchExecution, TestcaseExecution tce, int executionStatus, String executionNotes) Webservice call to update testcase execution result. Values should match to value in preference table where key is testresult.testresultStatus.LOV Zephyr app uses these values: 10=Change Status;1=Pass;2=Fail;3=WIP;4=Blocked This method doesn't validate status value against database values. If status value is < 1, it is set to 3 (WIP). Server url to be invoked is of format: "http://127.0.0.1:80/flex/rpc/zephyrrpcservice?wsdl". Parameter passed may have url format as "http://127.0.0.1:80/flex/agent", notice "/flex/agent" suffix attached to it.- Parameters:
tce
- TestcaseExecution, stores parameters to identify testcaseexecutionStatus
- test case status, refer javadoc above.executionNotes
- Freeform notes, stack trace etc.
-
updateTestcaseExecutionResult
public static void updateTestcaseExecutionResult(TestcaseBatchExecution testcaseBatchExecution, TestcaseExecution tce, int executionStatus, String executionNotes) throws Exception - Throws:
Exception
-
updateParseTestcaseExecutionResult
public static void updateParseTestcaseExecutionResult(TestcaseBatchExecution testcaseBatchExecution, Agent agent) -
updateAgentRealTimeStatus
public static void updateAgentRealTimeStatus(org.apache.commons.httpclient.HttpClient client, String url, String token, String status) Refreshes Agent entity's realtime status.- Parameters:
client
-url
- Zephyr Server machineURLtoken
- Zbot's tokenstatus
- Status that need to be updated
-
processTestCaseExecution
public static List<ReleaseTestSchedule> processTestCaseExecution(TestcaseBatchExecution testcaseBatchExecution, String statusId, Agent agent) throws IOException - Throws:
IOException
-
processTestCaseExecution
public static void processTestCaseExecution(TestcaseBatchExecution testcaseBatchExecution, List<ReleaseTestSchedule> releaseTestSchedules, List<TestCaseResultModel> testCaseResultModels, Agent agent) throws IOException - Throws:
IOException
-
setExecutionInRTS
public static ReleaseTestSchedule setExecutionInRTS(ReleaseTestSchedule releaseTestSchedule, ExecutionRequest executionRequest) -
prepareZephyrTests
public static List<TestCaseResultModel> prepareZephyrTests(List<TestcaseModel> testsFromTestSuiteList)
-