Access Fitnesse结果显示在java中的jenkins中

时间:2016-07-05 15:02:09

标签: java api jenkins fitnesse

我已经在詹金斯安排了一份合适的工作。现在,当作业完成后,我们可以在Fitnesse Results链接中看到作业的结果。我想通过java访问这些结果。是否有任何API可以帮助我访问这些结果?

2 个答案:

答案 0 :(得分:1)

你可以使用jenkis的rest api。 https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API。此外,来自工作的每个数据都存储在jenkis工作场所。

答案 1 :(得分:0)

我们可以调用direct fitnesse测试如果你想运行测试,请将测试页附加到?test& format = xml和?suite& format = xml

for ex:- http://localhost:8086/QaTestPage?test&format=xml 
it will return the results something like below

<testResults>
<FitNesseVersion>v20140418</FitNesseVersion>
<rootPath>QaTestPage</rootPath>
<result>
<counts>
<right>0</right>
<wrong>1</wrong>
<ignores>0</ignores>
<exceptions>2</exceptions>
</counts>
<runTimeInMillis>50220</runTimeInMillis>
<content>
{{{ this will have content in HTML format
}}}
</content>
<relativePageName>QaTestPage</relativePageName>
</result>
<finalCounts>
<right>0</right>
<wrong>1</wrong>
<ignores>0</ignores>
<exceptions>0</exceptions>
</finalCounts>
<totalRunTimeInMillis>52985</totalRunTimeInMillis>
</testResults>

当我们调用fitNesse服务器将返回如上所示的结果时,您可以在java文件中解析此XML