提交 6391c2a5 编写于 作者: K kohsuke

adding documentation.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20613 71c3de6d-444a-0410-be80-ed276b4c234a
上级 b4c9598a
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Tom Huybrechts
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.tasks.junit;
import hudson.model.Action;
......@@ -12,7 +35,8 @@ import hudson.model.Action;
* </ul>
*
* @author tom
*
* @since 1.320
* @see TestDataPublisher
*/
public abstract class TestAction implements Action {
......
......@@ -22,38 +22,41 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!--
Trend of test execution over time.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:lo="hudson:linkout">
<table class="pane sortable" id="testresult">
<tr>
<td class="pane-header" style="width:10em">${%Build}</td>
<td class="pane-header" style="width:10em">${%Test Description}</td>
<td class="pane-header" style="width:5em">${%Test Duration}</td>
<td class="pane-header" style="width:5em">${%Test Result}</td>
</tr>
<tbody>
<j:forEach var="b" items="${it.owner.parent.builds}">
<j:set var="test" value="${it.getResultInBuild(b)}"/>
<j:if test="${test != null}">
<tr>
<td class="pane">
<a href="${app.rootUrl}${b.url}testReport${p.url}">${b.fullDisplayName}</a>
<st:nbsp/>
<j:forEach var="badge" items="${test.testActions}">
<st:include it="${badge}" page="badge.jelly" optional="true"/>
</j:forEach>
</td>
<td class="pane" style="text-align:left">${test.description}</td>
<td class="pane" style="text-align:left" data="${test.duration}">${test.durationString}</td>
<td class="pane">
<j:set var="pst" value="${test.status}" />
<span class="${pst.cssClass}">
${pst.message}
</span>
</td>
</tr>
</j:if>
</j:forEach>
</tbody>
</table>
<table class="pane sortable" id="testresult">
<tr>
<td class="pane-header" style="width:10em">${%Build}</td>
<td class="pane-header" style="width:10em">${%Test Description}</td>
<td class="pane-header" style="width:5em">${%Test Duration}</td>
<td class="pane-header" style="width:5em">${%Test Result}</td>
</tr>
<tbody>
<j:forEach var="b" items="${it.owner.parent.builds}">
<j:set var="test" value="${it.getResultInBuild(b)}"/>
<j:if test="${test != null}">
<tr>
<td class="pane">
<a href="${app.rootUrl}${b.url}testReport${p.url}">${b.fullDisplayName}</a>
<st:nbsp/>
<j:forEach var="badge" items="${test.testActions}">
<st:include it="${badge}" page="badge.jelly" optional="true"/>
</j:forEach>
</td>
<td class="pane" style="text-align:left">${test.description}</td>
<td class="pane" style="text-align:left" data="${test.duration}">${test.durationString}</td>
<td class="pane">
<j:set var="pst" value="${test.status}" />
<span class="${pst.cssClass}">
${pst.message}
</span>
</td>
</tr>
</j:if>
</j:forEach>
</tbody>
</table>
</j:jelly>
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Tom Huybrechts
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- this is loaded on demand in the failed test results summary -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:lo="hudson:linkout">
......
......@@ -47,6 +47,10 @@ import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
/**
* Augments {@link SurefireReport} by executing {@link TestDataPublisher}s.
* @since 1.320
*/
public class MavenTestDataPublisher extends Recorder {
private final DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers;
......@@ -102,14 +106,9 @@ public class MavenTestDataPublisher extends Recorder {
}
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData)
throws hudson.model.Descriptor.FormException {
DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers = new DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>>(
new Saveable() {
public void save() throws IOException {
// no-op
}
});
public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException {
DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers
= new DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>>(Saveable.NOOP);
testDataPublishers.rebuild(req, formData, TestDataPublisher.all());
return new MavenTestDataPublisher(testDataPublishers);
......
......@@ -23,24 +23,24 @@ THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:invokeStatic var="testDataPublisherDescriptors"
className="hudson.tasks.junit.TestDataPublisher" method="all" />
<j:if test="${testDataPublisherDescriptors.size() > 0}">
<j:set var="testDataPublisherInstances" value="${instance.testDataPublishers}" />
<f:entry title="" field="testDataPublishers">
<table width="100%">
<j:forEach var="tdpd" items="${testDataPublisherDescriptors}">
<f:optionalBlock name="${tdpd.jsonSafeClassName}"
help="${tdpd.helpFile}" title="${tdpd.displayName}"
checked="${testDataPublisherInstances.get(tdpd)!=null}">
<j:set var="descriptor" value="${tdpd}" />
<j:set var="instance" value="${testDataPublisherInstances.get(tdpd)}" />
<st:include from="${tdpd}" page="${tdpd.configPage}"
optional="true" />
</f:optionalBlock>
</j:forEach>
</table>
</f:entry>
</j:if>
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:invokeStatic var="testDataPublisherDescriptors"
className="hudson.tasks.junit.TestDataPublisher" method="all"/>
<j:if test="${testDataPublisherDescriptors.size() > 0}">
<j:set var="testDataPublisherInstances" value="${instance.testDataPublishers}"/>
<f:entry title="" field="testDataPublishers">
<table width="100%">
<j:forEach var="tdpd" items="${testDataPublisherDescriptors}">
<f:optionalBlock name="${tdpd.jsonSafeClassName}"
help="${tdpd.helpFile}" title="${tdpd.displayName}"
checked="${testDataPublisherInstances.get(tdpd)!=null}">
<j:set var="descriptor" value="${tdpd}"/>
<j:set var="instance" value="${testDataPublisherInstances.get(tdpd)}"/>
<st:include from="${tdpd}" page="${tdpd.configPage}"
optional="true"/>
</f:optionalBlock>
</j:forEach>
</table>
</f:entry>
</j:if>
</j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册