PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/hudson-core/src/main/resources/lib/test/bar.jelly

http://github.com/hudson/hudson
Unknown | 72 lines | 64 code | 8 blank | 0 comment | 0 complexity | 0e1ea673dc0ab4b9fc0b69455faef909 MD5 | raw file
 1<!--
 2The MIT License
 3
 4Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Daniel Dyer, id:cactusman
 5
 6Permission is hereby granted, free of charge, to any person obtaining a copy
 7of this software and associated documentation files (the "Software"), to deal
 8in the Software without restriction, including without limitation the rights
 9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22THE SOFTWARE.
23-->
24
25<!--
26  Show a long bar that shows how many tests have failed and succeeded.
27
28  Attributes
29  ==========
30
31  @it     current test result
32  @prev   previous test result
33
34  both objects need to have .failCount and .totalCount properties
35-->
36<?jelly escape-by-default='true'?>
37<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">
38  <div>
39    <j:choose>
40      <j:when test="${it.totalCount==0}">
41        ${%No tests}
42      </j:when>
43      <j:otherwise>
44        <div>
45          ${%failures(it.failCount)}
46          <j:if test="${prev!=null}">
47            (${h.getDiffString(it.failCount-prev.failCount)})
48          </j:if>
49          <!-- Only show skips if there are some since they don't make sense for JUnit, only for TestNG. -->
50          <j:if test="${it.skipCount > 0}">
51            , ${%skipped(it.skipCount)}
52            <j:if test="${prev!=null}">
53              (${h.getDiffString(it.skipCount-prev.skipCount)})
54            </j:if>
55          </j:if>
56        </div>
57        <div style="width:100%; height:1em; background-color: #729FCF">
58          <!-- Failed tests part of the bar. -->
59          <div style="width:${it.failCount*100/it.totalCount}%; height: 1em; background-color: #EF2929; float: left"></div>
60          <!-- Skipped tests part of the bar. -->
61          <div style="width:${it.skipCount*100/it.totalCount}%; height: 1em; background-color: #FCE94F; float: left"></div>
62        </div>
63        <div align="right">
64          ${%tests(it.totalCount)}
65          <j:if test="${prev!=null}">
66            (${h.getDiffString(it.totalCount-prev.totalCount)})
67          </j:if>
68        </div>
69      </j:otherwise>
70    </j:choose>
71  </div>
72</j:jelly>