문제

랠리 SOAP API를 사용하여 이전에 생성 된 테스트 케이스에 대해 새로운 TestCaseresult를 만듭니다.그러나 결과를 작성할 때 오류가 발생합니다. '유효성 검사 오류 : testCaseresult.Date는 null "

왜 이것이 왜 그렇게 해야하는지 모르겠습니다. 도움이 될 수 있습니까?

    private Boolean createTestResultForTest(String aResult, String aTestCase)
    {
        TestCaseResult myTestCaseResult = new TestCaseResult();
        myTestCaseResult.Build = "1";
        DateTime myDate = DateTime.Now;
        myTestCaseResult.Date = myDate;
        String myQuery = "(FormattedID = " + aTestCase + ")";
        QueryResult myTestCaseReturn = m_rallyService.query(m_workspace, "TestCase", myQuery, "", true, 0, 100);
        long mycount = myTestCaseReturn.TotalResultCount;
        if (mycount > 0)
        {
            TestCase myTestCase = (TestCase)myTestCaseReturn.Results[0];
            myTestCaseResult.TestCase = myTestCase;
        }
        else
        {
            return false;
        }
        myTestCaseResult.Verdict = aResult;


        CreateResult myCreateTestResultResult = m_rallyService.create(myTestCaseResult);
        if (hasErrors(myCreateTestResultResult))
        {
            updateStatus("Could not create test result for test case:" + myTestCaseResult.TestCase.Name);
            printWarningsErrors(myCreateTestResultResult);
            return false;
        }
        else
        {
            myTestCaseResult = (TestCaseResult)myCreateTestResultResult.Object;
            myTestCaseResult = (TestCaseResult)m_rallyService.read(myTestCaseResult);
            updateStatus("Created TestCaseResult: " + myTestCaseResult.TestCase.Name + ", ref = " + myTestCaseResult.@ref);
        }
        return true;
    }
.

도움이 되었습니까?

해결책

나는 지금까지 잊어 버린 랠리의 SOAP API로 알려진 버그로 진행된다고 믿습니다.기본적으로 버그는 TestCaseresult에서 유효한 날짜 / 시간 개체를 지정하는 경우에도 SOAP Serializer가 특정 플래그를 사실로 설정하지 않으면이 문제를 인식하지 못합니다. i.e.

mytestcaseresult.datespecified= true;

이 플래그를 설정하고 코드를 다시 실행하십시오. 이제는 작동해야합니다.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top