* @param map
* @return
*/
public static final Execution getExecution(Map<String, Object> map)
{
Execution execution = null;
if ( map != null && map.size() > 0 )
{
Object o = map.get( TestLinkResponseParams.id.toString());
if ( o != null )
{
Integer id = Integer.parseInt( o.toString() );
if ( id > 0 )
{
execution = new Execution();
execution.setId( id );
execution.setBuildId( getInteger(map, TestLinkResponseParams.buildId.toString()) );
execution.setTesterId( getInteger(map, TestLinkResponseParams.testerId.toString()) );
String statusText = getString(map, TestLinkResponseParams.status.toString());
ExecutionStatus status = ExecutionStatus.getExecutionStatus(statusText.charAt(0));
execution.setStatus( status );
execution.setTestPlanId( getInteger(map, TestLinkResponseParams.testPlanId.toString()) );
execution.setTestCaseVersionId( getInteger(map, TestLinkResponseParams.testCaseVersionId.toString()) );
execution.setTestCaseVersionNumber( getInteger(map, TestLinkResponseParams.testcaseVersionNumber.toString()) );
Integer executionTypeText = getInteger( map, TestLinkResponseParams.executionType.toString() );
ExecutionType executionType = ExecutionType.getExecutionType(executionTypeText);
execution.setExecutionType(executionType);
execution.setNotes( getString(map, TestLinkResponseParams.notes.toString()) );
}
}
}
return execution;