kvm 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/.gitignore +3 -0
  2. data/.rvmrc +1 -0
  3. data/AGPL-3.0 +661 -0
  4. data/Gemfile +8 -0
  5. data/Gemfile.lock +32 -0
  6. data/LICENSE +23 -0
  7. data/README.md +73 -0
  8. data/Rakefile +48 -0
  9. data/bin/kvm +6 -0
  10. data/kvm.gemspec +28 -0
  11. data/lib/kvm.rb +286 -0
  12. data/lib/kvm/archive.rb +56 -0
  13. data/lib/kvm/artifact.rb +28 -0
  14. data/lib/kvm/db/jdbc_adapter.rb +71 -0
  15. data/lib/kvm/db/oracle.rb +23 -0
  16. data/lib/kvm/db/types.rb +11 -0
  17. data/lib/kvm/impex.rb +109 -0
  18. data/lib/kvm/log.rb +7 -0
  19. data/lib/kvm/resource.rb +72 -0
  20. data/lib/kvm/rice_release.rb +79 -0
  21. data/lib/kvm/rice_release_generated_dataset.rb +68 -0
  22. data/lib/kvm/source.rb +33 -0
  23. data/lib/kvm/subversion.rb +52 -0
  24. data/lib/kvm/version.rb +3 -0
  25. data/lib/kvm/wallet.rb +64 -0
  26. data/support/ant/INSTALL +2 -0
  27. data/support/ant/KEYS +1398 -0
  28. data/support/ant/LICENSE +272 -0
  29. data/support/ant/NOTICE +6 -0
  30. data/support/ant/README +97 -0
  31. data/support/ant/WHATSNEW +5467 -0
  32. data/support/ant/bin/ant +335 -0
  33. data/support/ant/bin/ant.bat +218 -0
  34. data/support/ant/bin/ant.cmd +93 -0
  35. data/support/ant/bin/antRun +24 -0
  36. data/support/ant/bin/antRun.bat +50 -0
  37. data/support/ant/bin/antRun.pl +66 -0
  38. data/support/ant/bin/antenv.cmd +98 -0
  39. data/support/ant/bin/complete-ant-cmd.pl +114 -0
  40. data/support/ant/bin/envset.cmd +131 -0
  41. data/support/ant/bin/lcp.bat +31 -0
  42. data/support/ant/bin/runant.pl +153 -0
  43. data/support/ant/bin/runant.py +102 -0
  44. data/support/ant/bin/runrc.cmd +60 -0
  45. data/support/ant/etc/ant-bootstrap.jar +0 -0
  46. data/support/ant/etc/changelog.xsl +148 -0
  47. data/support/ant/etc/checkstyle/checkstyle-frames.xsl +299 -0
  48. data/support/ant/etc/checkstyle/checkstyle-text.xsl +34 -0
  49. data/support/ant/etc/checkstyle/checkstyle-xdoc.xsl +130 -0
  50. data/support/ant/etc/coverage-frames.xsl +489 -0
  51. data/support/ant/etc/jdepend-frames.xsl +487 -0
  52. data/support/ant/etc/jdepend.xsl +276 -0
  53. data/support/ant/etc/junit-frames-xalan1.xsl +733 -0
  54. data/support/ant/etc/junit-frames.xsl +902 -0
  55. data/support/ant/etc/junit-noframes.xsl +478 -0
  56. data/support/ant/etc/log.xsl +203 -0
  57. data/support/ant/etc/maudit-frames.xsl +503 -0
  58. data/support/ant/etc/mmetrics-frames.xsl +1026 -0
  59. data/support/ant/etc/tagdiff.xsl +179 -0
  60. data/support/ant/fetch.xml +343 -0
  61. data/support/ant/get-m2.xml +121 -0
  62. data/support/ant/lib/README +3 -0
  63. data/support/ant/lib/ant-antlr.jar +0 -0
  64. data/support/ant/lib/ant-antlr.pom +76 -0
  65. data/support/ant/lib/ant-apache-bcel.jar +0 -0
  66. data/support/ant/lib/ant-apache-bcel.pom +72 -0
  67. data/support/ant/lib/ant-apache-bsf.jar +0 -0
  68. data/support/ant/lib/ant-apache-bsf.pom +75 -0
  69. data/support/ant/lib/ant-apache-log4j.jar +0 -0
  70. data/support/ant/lib/ant-apache-log4j.pom +70 -0
  71. data/support/ant/lib/ant-apache-oro.jar +0 -0
  72. data/support/ant/lib/ant-apache-oro.pom +75 -0
  73. data/support/ant/lib/ant-apache-regexp.jar +0 -0
  74. data/support/ant/lib/ant-apache-regexp.pom +71 -0
  75. data/support/ant/lib/ant-apache-resolver.jar +0 -0
  76. data/support/ant/lib/ant-apache-resolver.pom +70 -0
  77. data/support/ant/lib/ant-apache-xalan2.jar +0 -0
  78. data/support/ant/lib/ant-apache-xalan2.pom +95 -0
  79. data/support/ant/lib/ant-commons-logging.jar +0 -0
  80. data/support/ant/lib/ant-commons-logging.pom +71 -0
  81. data/support/ant/lib/ant-commons-net.jar +0 -0
  82. data/support/ant/lib/ant-commons-net.pom +76 -0
  83. data/support/ant/lib/ant-jai.jar +0 -0
  84. data/support/ant/lib/ant-jai.pom +85 -0
  85. data/support/ant/lib/ant-javamail.jar +0 -0
  86. data/support/ant/lib/ant-javamail.pom +79 -0
  87. data/support/ant/lib/ant-jdepend.jar +0 -0
  88. data/support/ant/lib/ant-jdepend.pom +73 -0
  89. data/support/ant/lib/ant-jmf.jar +0 -0
  90. data/support/ant/lib/ant-jmf.pom +66 -0
  91. data/support/ant/lib/ant-jsch.jar +0 -0
  92. data/support/ant/lib/ant-jsch.pom +75 -0
  93. data/support/ant/lib/ant-junit.jar +0 -0
  94. data/support/ant/lib/ant-junit.pom +101 -0
  95. data/support/ant/lib/ant-junit4.jar +0 -0
  96. data/support/ant/lib/ant-junit4.pom +71 -0
  97. data/support/ant/lib/ant-launcher.jar +0 -0
  98. data/support/ant/lib/ant-launcher.pom +58 -0
  99. data/support/ant/lib/ant-netrexx.jar +0 -0
  100. data/support/ant/lib/ant-netrexx.pom +99 -0
  101. data/support/ant/lib/ant-parent.pom +120 -0
  102. data/support/ant/lib/ant-swing.jar +0 -0
  103. data/support/ant/lib/ant-swing.pom +67 -0
  104. data/support/ant/lib/ant-testutil.jar +0 -0
  105. data/support/ant/lib/ant-testutil.pom +75 -0
  106. data/support/ant/lib/ant.jar +0 -0
  107. data/support/ant/lib/ant.pom +222 -0
  108. data/support/ant/lib/libraries.properties +65 -0
  109. data/test/data/files/rice-0.0.0.0-bin.tar.gz +0 -0
  110. data/test/data/svn/README.txt +5 -0
  111. data/test/data/svn/conf/authz +32 -0
  112. data/test/data/svn/conf/passwd +8 -0
  113. data/test/data/svn/conf/svnserve.conf +47 -0
  114. data/test/data/svn/db/current +1 -0
  115. data/test/data/svn/db/format +2 -0
  116. data/test/data/svn/db/fs-type +1 -0
  117. data/test/data/svn/db/fsfs.conf +37 -0
  118. data/test/data/svn/db/min-unpacked-rev +1 -0
  119. data/test/data/svn/db/rep-cache.db +0 -0
  120. data/test/data/svn/db/revprops/0/0 +5 -0
  121. data/test/data/svn/db/revprops/0/1 +13 -0
  122. data/test/data/svn/db/revs/0/0 +11 -0
  123. data/test/data/svn/db/revs/0/1 +0 -0
  124. data/test/data/svn/db/txn-current +1 -0
  125. data/test/data/svn/db/txn-current-lock +0 -0
  126. data/test/data/svn/db/uuid +1 -0
  127. data/test/data/svn/db/write-lock +0 -0
  128. data/test/data/svn/format +1 -0
  129. data/test/data/svn/hooks/post-commit.tmpl +50 -0
  130. data/test/data/svn/hooks/post-lock.tmpl +44 -0
  131. data/test/data/svn/hooks/post-revprop-change.tmpl +56 -0
  132. data/test/data/svn/hooks/post-unlock.tmpl +42 -0
  133. data/test/data/svn/hooks/pre-commit.tmpl +81 -0
  134. data/test/data/svn/hooks/pre-lock.tmpl +71 -0
  135. data/test/data/svn/hooks/pre-revprop-change.tmpl +66 -0
  136. data/test/data/svn/hooks/pre-unlock.tmpl +63 -0
  137. data/test/data/svn/hooks/start-commit.tmpl +65 -0
  138. data/test/data/svn/locks/db-logs.lock +3 -0
  139. data/test/data/svn/locks/db.lock +3 -0
  140. data/test/helper.rb +146 -0
  141. data/test/int_test_generate_sql.rb +58 -0
  142. data/test/test_archive.rb +35 -0
  143. data/test/test_generate_sql.rb +0 -0
  144. data/test/test_rice_release.rb +61 -0
  145. data/test/test_rice_release_generated_dataset.rb +12 -0
  146. data/test/test_source.rb +31 -0
  147. data/test/test_subversion.rb +20 -0
  148. metadata +298 -0
@@ -0,0 +1,276 @@
1
+ <?xml version="1.0"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
+
4
+ <!--
5
+ Licensed to the Apache Software Foundation (ASF) under one or more
6
+ contributor license agreements. See the NOTICE file distributed with
7
+ this work for additional information regarding copyright ownership.
8
+ The ASF licenses this file to You under the Apache License, Version 2.0
9
+ (the "License"); you may not use this file except in compliance with
10
+ the License. You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+ -->
20
+
21
+ <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
22
+
23
+ <xsl:template match="JDepend">
24
+ <html>
25
+ <head>
26
+ <title>JDepend Analysis</title>
27
+
28
+ <style type="text/css">
29
+ body {
30
+ font:normal 68% verdana,arial,helvetica;
31
+ color:#000000;
32
+ }
33
+ table tr td, tr th {
34
+ font-size: 68%;
35
+ }
36
+ table.details tr th{
37
+ font-weight: bold;
38
+ text-align:left;
39
+ background:#a6caf0;
40
+ }
41
+ table.details tr td{
42
+ background:#eeeee0;
43
+ }
44
+
45
+ p {
46
+ line-height:1.5em;
47
+ margin-top:0.5em; margin-bottom:1.0em;
48
+ margin-left:2em;
49
+ margin-right:2em;
50
+ }
51
+ h1 {
52
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
53
+ }
54
+ h2 {
55
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
56
+ }
57
+ h3 {
58
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
59
+ }
60
+ h4 {
61
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
62
+ }
63
+ h5 {
64
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
65
+ }
66
+ h6 {
67
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
68
+ }
69
+ .Error {
70
+ font-weight:bold; color:red;
71
+ }
72
+ .Failure {
73
+ font-weight:bold; color:purple;
74
+ }
75
+ .Properties {
76
+ text-align:right;
77
+ }
78
+ </style>
79
+
80
+
81
+ </head>
82
+ <body>
83
+ <!--h1>JDepend Report</h1>
84
+ <ul>
85
+ <xsl:for-each select="./Packages/Package">
86
+ <xsl:sort select="@name"/>
87
+ <li><xsl:value-of select="@name"/></li>
88
+ </xsl:for-each>
89
+ </ul-->
90
+
91
+ <h1><a name="top">JDepend Analysis</a></h1>
92
+ <p align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</p>
93
+ <hr size="2" />
94
+
95
+ <table width="100%"><tr><td>
96
+ <a name="NVsummary"><h2>Summary</h2></a>
97
+ </td><td align="right">
98
+ [<a href="#NVsummary">summary</a>]
99
+ [<a href="#NVpackages">packages</a>]
100
+ [<a href="#NVcycles">cycles</a>]
101
+ [<a href="#NVexplanations">explanations</a>]
102
+ </td></tr></table>
103
+
104
+ <table width="100%" class="details">
105
+ <tr>
106
+ <th>Package</th>
107
+ <th>Total Classes</th>
108
+ <th><a href="#EXnumber">Abstract Classes</a></th>
109
+ <th><a href="#EXnumber">Concrete Classes</a></th>
110
+ <th><a href="#EXafferent">Afferent Couplings</a></th>
111
+ <th><a href="#EXefferent">Efferent Couplings</a></th>
112
+ <th><a href="#EXabstractness">Abstractness</a></th>
113
+ <th><a href="#EXinstability">Instability</a></th>
114
+ <th><a href="#EXdistance">Distance</a></th>
115
+
116
+ </tr>
117
+ <xsl:for-each select="./Packages/Package">
118
+ <xsl:if test="count(error) = 0">
119
+ <tr>
120
+ <td align="left">
121
+ <a>
122
+ <xsl:attribute name="href">#PK<xsl:value-of select="@name"/>
123
+ </xsl:attribute>
124
+ <xsl:value-of select="@name"/>
125
+ </a>
126
+ </td>
127
+ <td align="right"><xsl:value-of select="Stats/TotalClasses"/></td>
128
+ <td align="right"><xsl:value-of select="Stats/AbstractClasses"/></td>
129
+ <td align="right"><xsl:value-of select="Stats/ConcreteClasses"/></td>
130
+ <td align="right"><xsl:value-of select="Stats/Ca"/></td>
131
+ <td align="right"><xsl:value-of select="Stats/Ce"/></td>
132
+ <td align="right"><xsl:value-of select="Stats/A"/></td>
133
+ <td align="right"><xsl:value-of select="Stats/I"/></td>
134
+ <td align="right"><xsl:value-of select="Stats/D"/></td>
135
+
136
+
137
+ </tr>
138
+ </xsl:if>
139
+ </xsl:for-each>
140
+ <xsl:for-each select="./Packages/Package">
141
+ <xsl:if test="count(error) &gt; 0">
142
+ <tr>
143
+ <td align="left">
144
+ <xsl:value-of select="@name"/>
145
+ </td>
146
+ <td align="left" colspan="8"><xsl:value-of select="error"/></td>
147
+ </tr>
148
+ </xsl:if>
149
+ </xsl:for-each>
150
+ </table>
151
+
152
+ <table width="100%"><tr><td>
153
+ <a name="NVpackages"><h2>Packages</h2></a>
154
+ </td><td align="right">
155
+ [<a href="#NVsummary">summary</a>]
156
+ [<a href="#NVpackages">packages</a>]
157
+ [<a href="#NVcycles">cycles</a>]
158
+ [<a href="#NVexplanations">explanations</a>]
159
+ </td></tr></table>
160
+
161
+ <xsl:for-each select="./Packages/Package">
162
+ <xsl:if test="count(error) = 0">
163
+ <h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
164
+ <xsl:value-of select="@name"/></a></h3>
165
+
166
+ <table width="100%"><tr>
167
+ <td><a href="#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
168
+ <td><a href="#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
169
+ <td><a href="#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
170
+ <td><a href="#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
171
+ <td><a href="#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
172
+ </tr></table>
173
+
174
+ <table width="100%" class="details">
175
+ <tr>
176
+ <th>Abstract Classes</th>
177
+ <th>Concrete Classes</th>
178
+ <th>Used by Packages</th>
179
+ <th>Uses Packages</th>
180
+ </tr>
181
+ <tr>
182
+ <td valign="top" width="25%">
183
+ <xsl:if test="count(AbstractClasses/Class)=0">
184
+ <i>None</i>
185
+ </xsl:if>
186
+ <xsl:for-each select="AbstractClasses/Class">
187
+ <xsl:value-of select="node()"/><br/>
188
+ </xsl:for-each>
189
+ </td>
190
+ <td valign="top" width="25%">
191
+ <xsl:if test="count(ConcreteClasses/Class)=0">
192
+ <i>None</i>
193
+ </xsl:if>
194
+ <xsl:for-each select="ConcreteClasses/Class">
195
+ <xsl:value-of select="node()"/><br/>
196
+ </xsl:for-each>
197
+ </td>
198
+ <td valign="top" width="25%">
199
+ <xsl:if test="count(UsedBy/Package)=0">
200
+ <i>None</i>
201
+ </xsl:if>
202
+ <xsl:for-each select="UsedBy/Package">
203
+ <a>
204
+ <xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
205
+ <xsl:value-of select="node()"/>
206
+ </a><br/>
207
+ </xsl:for-each>
208
+ </td>
209
+ <td valign="top" width="25%">
210
+ <xsl:if test="count(DependsUpon/Package)=0">
211
+ <i>None</i>
212
+ </xsl:if>
213
+ <xsl:for-each select="DependsUpon/Package">
214
+ <a>
215
+ <xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
216
+ <xsl:value-of select="node()"/>
217
+ </a><br/>
218
+ </xsl:for-each>
219
+ </td>
220
+ </tr>
221
+ </table>
222
+ </xsl:if>
223
+ </xsl:for-each>
224
+
225
+ <table width="100%"><tr><td>
226
+ <a name="NVcycles"><h2>Cycles</h2></a>
227
+ </td><td align="right">
228
+ [<a href="#NVsummary">summary</a>]
229
+ [<a href="#NVpackages">packages</a>]
230
+ [<a href="#NVcycles">cycles</a>]
231
+ [<a href="#NVexplanations">explanations</a>]
232
+ </td></tr></table>
233
+
234
+ <xsl:if test="count(Cycles/Package) = 0">
235
+ <p>There are no cyclic dependancies.</p>
236
+ </xsl:if>
237
+ <xsl:for-each select="Cycles/Package">
238
+ <h3><xsl:value-of select="@Name"/></h3><p>
239
+ <xsl:for-each select="Package">
240
+ <xsl:value-of select="."/><br/>
241
+ </xsl:for-each></p>
242
+ </xsl:for-each>
243
+
244
+ <table width="100%"><tr><td>
245
+ <a name="NVexplanations"><h2>Explanations</h2></a>
246
+ </td><td align="right">
247
+ [<a href="#NVsummary">summary</a>]
248
+ [<a href="#NVpackages">packages</a>]
249
+ [<a href="#NVcycles">cycles</a>]
250
+ [<a href="#NVexplanations">explanations</a>]
251
+ </td></tr></table>
252
+
253
+ <p>The following explanations are for quick reference and are lifted directly from the original <a href="http://www.clarkware.com/software/JDepend.html">JDepend documentation</a>.</p>
254
+
255
+ <h3><a name="EXnumber">Number of Classes</a></h3>
256
+ <p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
257
+ <h3><a name="EXafferent">Afferent Couplings</a></h3>
258
+ <p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
259
+ <h3><a name="EXefferent">Efferent Couplings</a></h3>
260
+ <p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
261
+ <h3><a name="EXabstractness">Abstractness</a></h3>
262
+ <p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>
263
+ <p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>
264
+ <h3><a name="EXinstability">Instability</a></h3>
265
+ <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>
266
+ <p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>
267
+ <h3><a name="EXdistance">Distance</a></h3>
268
+ <p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>
269
+ <p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
270
+ <p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>
271
+
272
+ </body>
273
+ </html>
274
+ </xsl:template>
275
+
276
+ </xsl:stylesheet>
@@ -0,0 +1,733 @@
1
+ <?xml version="1.0"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3
+ xmlns:lxslt="http://xml.apache.org/xslt"
4
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
5
+ xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
6
+ extension-element-prefixes="redirect">
7
+ <xsl:output method="html" indent="yes" encoding="UTF-8"/>
8
+ <xsl:decimal-format decimal-separator="." grouping-separator=","/>
9
+ <!--
10
+ Licensed to the Apache Software Foundation (ASF) under one or more
11
+ contributor license agreements. See the NOTICE file distributed with
12
+ this work for additional information regarding copyright ownership.
13
+ The ASF licenses this file to You under the Apache License, Version 2.0
14
+ (the "License"); you may not use this file except in compliance with
15
+ the License. You may obtain a copy of the License at
16
+
17
+ http://www.apache.org/licenses/LICENSE-2.0
18
+
19
+ Unless required by applicable law or agreed to in writing, software
20
+ distributed under the License is distributed on an "AS IS" BASIS,
21
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ See the License for the specific language governing permissions and
23
+ limitations under the License.
24
+ -->
25
+
26
+ <!--
27
+
28
+ Sample stylesheet to be used with Ant JUnitReport output.
29
+
30
+ It creates a set of HTML files a la javadoc where you can browse easily
31
+ through all packages and classes.
32
+
33
+ -->
34
+ <xsl:param name="output.dir" select="'.'"/>
35
+
36
+
37
+ <xsl:template match="testsuites">
38
+ <!-- create the index.html -->
39
+ <redirect:write file="{$output.dir}/index.html">
40
+ <xsl:call-template name="index.html"/>
41
+ </redirect:write>
42
+
43
+ <!-- create the stylesheet.css -->
44
+ <redirect:write file="{$output.dir}/stylesheet.css">
45
+ <xsl:call-template name="stylesheet.css"/>
46
+ </redirect:write>
47
+
48
+ <!-- create the overview-packages.html at the root -->
49
+ <redirect:write file="{$output.dir}/overview-summary.html">
50
+ <xsl:apply-templates select="." mode="overview.packages"/>
51
+ </redirect:write>
52
+
53
+ <!-- create the all-packages.html at the root -->
54
+ <redirect:write file="{$output.dir}/overview-frame.html">
55
+ <xsl:apply-templates select="." mode="all.packages"/>
56
+ </redirect:write>
57
+
58
+ <!-- create the all-classes.html at the root -->
59
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
60
+ <xsl:apply-templates select="." mode="all.classes"/>
61
+ </redirect:write>
62
+
63
+ <!-- process all packages -->
64
+ <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
65
+ <xsl:call-template name="package">
66
+ <xsl:with-param name="name" select="@package"/>
67
+ </xsl:call-template>
68
+ </xsl:for-each>
69
+ </xsl:template>
70
+
71
+
72
+ <xsl:template name="package">
73
+ <xsl:param name="name"/>
74
+ <xsl:variable name="package.dir">
75
+ <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
76
+ <xsl:if test="$name = ''">.</xsl:if>
77
+ </xsl:variable>
78
+ <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
79
+ <!-- create a classes-list.html in the package directory -->
80
+ <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
81
+ <xsl:call-template name="classes.list">
82
+ <xsl:with-param name="name" select="$name"/>
83
+ </xsl:call-template>
84
+ </redirect:write>
85
+
86
+ <!-- create a package-summary.html in the package directory -->
87
+ <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
88
+ <xsl:call-template name="package.summary">
89
+ <xsl:with-param name="name" select="$name"/>
90
+ </xsl:call-template>
91
+ </redirect:write>
92
+
93
+ <!-- for each class, creates a @name.html -->
94
+ <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
95
+ <xsl:for-each select="/testsuites/testsuite[@package = $name]">
96
+ <redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
97
+ <xsl:apply-templates select="." mode="class.details"/>
98
+ </redirect:write>
99
+ <xsl:if test="string-length(./system-out)!=0">
100
+ <redirect:write file="{$output.dir}/{$package.dir}/{@name}-out.html">
101
+ <html>
102
+ <head>
103
+ <title>Standard Output from <xsl:value-of select="@name"/></title>
104
+ </head>
105
+ <body>
106
+ <pre><xsl:value-of select="./system-out"/></pre>
107
+ </body>
108
+ </html>
109
+ </redirect:write>
110
+ </xsl:if>
111
+ <xsl:if test="string-length(./system-err)!=0">
112
+ <redirect:write file="{$output.dir}/{$package.dir}/{@name}-err.html">
113
+ <html>
114
+ <head>
115
+ <title>Standard Error from <xsl:value-of select="@name"/></title>
116
+ </head>
117
+ <body>
118
+ <pre><xsl:value-of select="./system-err"/></pre>
119
+ </body>
120
+ </html>
121
+ </redirect:write>
122
+ </xsl:if>
123
+ </xsl:for-each>
124
+ </xsl:template>
125
+
126
+ <xsl:template name="index.html">
127
+ <html>
128
+ <head>
129
+ <title>Unit Test Results.</title>
130
+ </head>
131
+ <frameset cols="20%,80%">
132
+ <frameset rows="30%,70%">
133
+ <frame src="overview-frame.html" name="packageListFrame"/>
134
+ <frame src="allclasses-frame.html" name="classListFrame"/>
135
+ </frameset>
136
+ <frame src="overview-summary.html" name="classFrame"/>
137
+ <noframes>
138
+ <h2>Frame Alert</h2>
139
+ <p>
140
+ This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
141
+ </p>
142
+ </noframes>
143
+ </frameset>
144
+ </html>
145
+ </xsl:template>
146
+
147
+ <!-- this is the stylesheet css to use for nearly everything -->
148
+ <xsl:template name="stylesheet.css">
149
+ body {
150
+ font:normal 68% verdana,arial,helvetica;
151
+ color:#000000;
152
+ }
153
+ table tr td, table tr th {
154
+ font-size: 68%;
155
+ }
156
+ table.details tr th{
157
+ font-weight: bold;
158
+ text-align:left;
159
+ background:#a6caf0;
160
+ }
161
+ table.details tr td{
162
+ background:#eeeee0;
163
+ }
164
+
165
+ p {
166
+ line-height:1.5em;
167
+ margin-top:0.5em; margin-bottom:1.0em;
168
+ }
169
+ h1 {
170
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
171
+ }
172
+ h2 {
173
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
174
+ }
175
+ h3 {
176
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
177
+ }
178
+ h4 {
179
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
180
+ }
181
+ h5 {
182
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
183
+ }
184
+ h6 {
185
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
186
+ }
187
+ .Error {
188
+ font-weight:bold; color:red;
189
+ }
190
+ .Failure {
191
+ font-weight:bold; color:purple;
192
+ }
193
+ .Properties {
194
+ text-align:right;
195
+ }
196
+ </xsl:template>
197
+
198
+
199
+ <!-- ======================================================================
200
+ This page is created for every testsuite class.
201
+ It prints a summary of the testsuite and detailed information about
202
+ testcase methods.
203
+ ====================================================================== -->
204
+ <xsl:template match="testsuite" mode="class.details">
205
+ <xsl:variable name="package.name" select="@package"/>
206
+ <xsl:variable name="class.name"><xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></xsl:variable>
207
+ <html>
208
+ <head>
209
+ <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
210
+ <xsl:call-template name="create.stylesheet.link">
211
+ <xsl:with-param name="package.name" select="$package.name"/>
212
+ </xsl:call-template>
213
+ <script type="text/javascript" language="JavaScript">
214
+ var TestCases = new Array();
215
+ var cur;
216
+ <xsl:apply-templates select="properties"/>
217
+ </script>
218
+ <script type="text/javascript" language="JavaScript"><![CDATA[
219
+ function displayProperties (name) {
220
+ var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
221
+ var doc = win.document;
222
+ doc.open();
223
+ doc.write("<html><head><title>Properties of " + name + "</title>");
224
+ doc.write("<style type=\"text/css\">");
225
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
226
+ doc.write("table tr td, table tr th { font-size: 68%; }");
227
+ doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
228
+ doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
229
+ doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
230
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
231
+ doc.write("</style>");
232
+ doc.write("</head><body>");
233
+ doc.write("<h3>Properties of " + name + "</h3>");
234
+ doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
235
+ doc.write("<table class='properties'>");
236
+ doc.write("<tr><th>Name</th><th>Value</th></tr>");
237
+ for (prop in TestCases[name]) {
238
+ doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
239
+ }
240
+ doc.write("</table>");
241
+ doc.write("</body></html>");
242
+ doc.close();
243
+ win.focus();
244
+ }
245
+ ]]>
246
+ </script>
247
+ </head>
248
+ <body>
249
+ <xsl:call-template name="pageHeader"/>
250
+ <h3>Class <xsl:value-of select="$class.name"/></h3>
251
+
252
+
253
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
254
+ <xsl:call-template name="testsuite.test.header"/>
255
+ <xsl:apply-templates select="." mode="print.test"/>
256
+ </table>
257
+
258
+ <h2>Tests</h2>
259
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
260
+ <xsl:call-template name="testcase.test.header"/>
261
+ <!--
262
+ test can even not be started at all (failure to load the class)
263
+ so report the error directly
264
+ -->
265
+ <xsl:if test="./error">
266
+ <tr class="Error">
267
+ <td colspan="4"><xsl:apply-templates select="./error"/></td>
268
+ </tr>
269
+ </xsl:if>
270
+ <xsl:apply-templates select="./testcase" mode="print.test"/>
271
+ </table>
272
+ <div class="Properties">
273
+ <a>
274
+ <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
275
+ Properties &#187;
276
+ </a>
277
+ </div>
278
+ <xsl:if test="string-length(./system-out)!=0">
279
+ <div class="Properties">
280
+ <a>
281
+ <xsl:attribute name="href">./<xsl:value-of select="@name"/>-out.html</xsl:attribute>
282
+ System.out &#187;
283
+ </a>
284
+ </div>
285
+ </xsl:if>
286
+ <xsl:if test="string-length(./system-err)!=0">
287
+ <div class="Properties">
288
+ <a>
289
+ <xsl:attribute name="href">./<xsl:value-of select="@name"/>-err.html</xsl:attribute>
290
+ System.err &#187;
291
+ </a>
292
+ </div>
293
+ </xsl:if>
294
+ </body>
295
+ </html>
296
+ </xsl:template>
297
+
298
+ <!--
299
+ Write properties into a JavaScript data structure.
300
+ This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
301
+ -->
302
+ <xsl:template match="properties">
303
+ cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
304
+ <xsl:for-each select="property">
305
+ <xsl:sort select="@name"/>
306
+ cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
307
+ </xsl:for-each>
308
+ </xsl:template>
309
+
310
+
311
+ <!-- ======================================================================
312
+ This page is created for every package.
313
+ It prints the name of all classes that belongs to this package.
314
+ @param name the package name to print classes.
315
+ ====================================================================== -->
316
+ <!-- list of classes in a package -->
317
+ <xsl:template name="classes.list">
318
+ <xsl:param name="name"/>
319
+ <html>
320
+ <head>
321
+ <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
322
+ <xsl:call-template name="create.stylesheet.link">
323
+ <xsl:with-param name="package.name" select="$name"/>
324
+ </xsl:call-template>
325
+ </head>
326
+ <body>
327
+ <table width="100%">
328
+ <tr>
329
+ <td nowrap="nowrap">
330
+ <h2><a href="package-summary.html" target="classFrame">
331
+ <xsl:value-of select="$name"/>
332
+ <xsl:if test="$name = ''">&lt;none&gt;</xsl:if>
333
+ </a></h2>
334
+ </td>
335
+ </tr>
336
+ </table>
337
+
338
+ <h2>Classes</h2>
339
+ <table width="100%">
340
+ <xsl:for-each select="/testsuites/testsuite[./@package = $name]">
341
+ <xsl:sort select="@name"/>
342
+ <tr>
343
+ <td nowrap="nowrap">
344
+ <a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
345
+ </td>
346
+ </tr>
347
+ </xsl:for-each>
348
+ </table>
349
+ </body>
350
+ </html>
351
+ </xsl:template>
352
+
353
+
354
+ <!--
355
+ Creates an all-classes.html file that contains a link to all package-summary.html
356
+ on each class.
357
+ -->
358
+ <xsl:template match="testsuites" mode="all.classes">
359
+ <html>
360
+ <head>
361
+ <title>All Unit Test Classes</title>
362
+ <xsl:call-template name="create.stylesheet.link">
363
+ <xsl:with-param name="package.name"/>
364
+ </xsl:call-template>
365
+ </head>
366
+ <body>
367
+ <h2>Classes</h2>
368
+ <table width="100%">
369
+ <xsl:apply-templates select="testsuite" mode="all.classes">
370
+ <xsl:sort select="@name"/>
371
+ </xsl:apply-templates>
372
+ </table>
373
+ </body>
374
+ </html>
375
+ </xsl:template>
376
+
377
+ <xsl:template match="testsuite" mode="all.classes">
378
+ <xsl:variable name="package.name" select="@package"/>
379
+ <tr>
380
+ <td nowrap="nowrap">
381
+ <a target="classFrame">
382
+ <xsl:attribute name="href">
383
+ <xsl:if test="not($package.name='')">
384
+ <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
385
+ </xsl:if><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
386
+ </xsl:attribute>
387
+ <xsl:value-of select="@name"/>
388
+ </a>
389
+ </td>
390
+ </tr>
391
+ </xsl:template>
392
+
393
+
394
+ <!--
395
+ Creates an html file that contains a link to all package-summary.html files on
396
+ each package existing on testsuites.
397
+ @bug there will be a problem here, I don't know yet how to handle unnamed package :(
398
+ -->
399
+ <xsl:template match="testsuites" mode="all.packages">
400
+ <html>
401
+ <head>
402
+ <title>All Unit Test Packages</title>
403
+ <xsl:call-template name="create.stylesheet.link">
404
+ <xsl:with-param name="package.name"/>
405
+ </xsl:call-template>
406
+ </head>
407
+ <body>
408
+ <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
409
+ <h2>Packages</h2>
410
+ <table width="100%">
411
+ <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
412
+ <xsl:sort select="@package"/>
413
+ </xsl:apply-templates>
414
+ </table>
415
+ </body>
416
+ </html>
417
+ </xsl:template>
418
+
419
+ <xsl:template match="testsuite" mode="all.packages">
420
+ <tr>
421
+ <td nowrap="nowrap">
422
+ <a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
423
+ <xsl:value-of select="@package"/>
424
+ <xsl:if test="@package = ''">&lt;none&gt;</xsl:if>
425
+ </a>
426
+ </td>
427
+ </tr>
428
+ </xsl:template>
429
+
430
+
431
+ <xsl:template match="testsuites" mode="overview.packages">
432
+ <html>
433
+ <head>
434
+ <title>Unit Test Results: Summary</title>
435
+ <xsl:call-template name="create.stylesheet.link">
436
+ <xsl:with-param name="package.name"/>
437
+ </xsl:call-template>
438
+ </head>
439
+ <body>
440
+ <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
441
+ <xsl:call-template name="pageHeader"/>
442
+ <h2>Summary</h2>
443
+ <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
444
+ <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
445
+ <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
446
+ <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
447
+ <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
448
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
449
+ <tr valign="top">
450
+ <th>Tests</th>
451
+ <th>Failures</th>
452
+ <th>Errors</th>
453
+ <th>Success rate</th>
454
+ <th>Time</th>
455
+ </tr>
456
+ <tr valign="top">
457
+ <xsl:attribute name="class">
458
+ <xsl:choose>
459
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
460
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
461
+ <xsl:otherwise>Pass</xsl:otherwise>
462
+ </xsl:choose>
463
+ </xsl:attribute>
464
+ <td><xsl:value-of select="$testCount"/></td>
465
+ <td><xsl:value-of select="$failureCount"/></td>
466
+ <td><xsl:value-of select="$errorCount"/></td>
467
+ <td>
468
+ <xsl:call-template name="display-percent">
469
+ <xsl:with-param name="value" select="$successRate"/>
470
+ </xsl:call-template>
471
+ </td>
472
+ <td>
473
+ <xsl:call-template name="display-time">
474
+ <xsl:with-param name="value" select="$timeCount"/>
475
+ </xsl:call-template>
476
+ </td>
477
+ </tr>
478
+ </table>
479
+ <table border="0" width="95%">
480
+ <tr>
481
+ <td style="text-align: justify;">
482
+ Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
483
+ </td>
484
+ </tr>
485
+ </table>
486
+
487
+ <h2>Packages</h2>
488
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
489
+ <xsl:call-template name="testsuite.test.header"/>
490
+ <xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
491
+ <xsl:sort select="@package" order="ascending"/>
492
+ <!-- get the node set containing all testsuites that have the same package -->
493
+ <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
494
+ <tr valign="top">
495
+ <!-- display a failure if there is any failure/error in the package -->
496
+ <xsl:attribute name="class">
497
+ <xsl:choose>
498
+ <xsl:when test="sum($insamepackage/@errors) &gt; 0">Error</xsl:when>
499
+ <xsl:when test="sum($insamepackage/@failures) &gt; 0">Failure</xsl:when>
500
+ <xsl:otherwise>Pass</xsl:otherwise>
501
+ </xsl:choose>
502
+ </xsl:attribute>
503
+ <td><a href="./{translate(@package,'.','/')}/package-summary.html">
504
+ <xsl:value-of select="@package"/>
505
+ <xsl:if test="@package = ''">&lt;none&gt;</xsl:if>
506
+ </a></td>
507
+ <td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
508
+ <td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
509
+ <td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
510
+ <td>
511
+ <xsl:call-template name="display-time">
512
+ <xsl:with-param name="value" select="sum($insamepackage/@time)"/>
513
+ </xsl:call-template>
514
+ </td>
515
+ <td><xsl:value-of select="$insamepackage/@timestamp"/></td>
516
+ <td><xsl:value-of select="$insamepackage/@hostname"/></td>
517
+ </tr>
518
+ </xsl:for-each>
519
+ </table>
520
+ </body>
521
+ </html>
522
+ </xsl:template>
523
+
524
+
525
+ <xsl:template name="package.summary">
526
+ <xsl:param name="name"/>
527
+ <html>
528
+ <head>
529
+ <xsl:call-template name="create.stylesheet.link">
530
+ <xsl:with-param name="package.name" select="$name"/>
531
+ </xsl:call-template>
532
+ </head>
533
+ <body>
534
+ <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
535
+ <xsl:call-template name="pageHeader"/>
536
+ <h3>Package <xsl:value-of select="$name"/></h3>
537
+
538
+ <!--table border="0" cellpadding="5" cellspacing="2" width="95%">
539
+ <xsl:call-template name="class.metrics.header"/>
540
+ <xsl:apply-templates select="." mode="print.metrics"/>
541
+ </table-->
542
+
543
+ <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
544
+ <xsl:if test="count($insamepackage) &gt; 0">
545
+ <h2>Classes</h2>
546
+ <p>
547
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
548
+ <xsl:call-template name="testsuite.test.header"/>
549
+ <xsl:apply-templates select="$insamepackage" mode="print.test">
550
+ <xsl:sort select="@name"/>
551
+ </xsl:apply-templates>
552
+ </table>
553
+ </p>
554
+ </xsl:if>
555
+ </body>
556
+ </html>
557
+ </xsl:template>
558
+
559
+
560
+ <!--
561
+ transform string like a.b.c to ../../../
562
+ @param path the path to transform into a descending directory path
563
+ -->
564
+ <xsl:template name="path">
565
+ <xsl:param name="path"/>
566
+ <xsl:if test="contains($path,'.')">
567
+ <xsl:text>../</xsl:text>
568
+ <xsl:call-template name="path">
569
+ <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
570
+ </xsl:call-template>
571
+ </xsl:if>
572
+ <xsl:if test="not(contains($path,'.')) and not($path = '')">
573
+ <xsl:text>../</xsl:text>
574
+ </xsl:if>
575
+ </xsl:template>
576
+
577
+
578
+ <!-- create the link to the stylesheet based on the package name -->
579
+ <xsl:template name="create.stylesheet.link">
580
+ <xsl:param name="package.name"/>
581
+ <link rel="stylesheet" type="text/css" title="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></link>
582
+ </xsl:template>
583
+
584
+
585
+ <!-- Page HEADER -->
586
+ <xsl:template name="pageHeader">
587
+ <h1>Unit Test Results</h1>
588
+ <table width="100%">
589
+ <tr>
590
+ <td align="left"></td>
591
+ <td align="right">Designed for use with <a href="http://www.junit.org/">JUnit</a> and <a href="http://ant.apache.org/">Ant</a>.</td>
592
+ </tr>
593
+ </table>
594
+ <hr size="1"/>
595
+ </xsl:template>
596
+
597
+ <!-- class header -->
598
+ <xsl:template name="testsuite.test.header">
599
+ <tr valign="top">
600
+ <th width="80%">Name</th>
601
+ <th>Tests</th>
602
+ <th>Errors</th>
603
+ <th>Failures</th>
604
+ <th nowrap="nowrap">Time(s)</th>
605
+ <th nowrap="nowrap">Time Stamp</th>
606
+ <th>Host</th>
607
+ </tr>
608
+ </xsl:template>
609
+
610
+ <!-- method header -->
611
+ <xsl:template name="testcase.test.header">
612
+ <tr valign="top">
613
+ <th>Name</th>
614
+ <th>Status</th>
615
+ <th width="80%">Type</th>
616
+ <th nowrap="nowrap">Time(s)</th>
617
+ </tr>
618
+ </xsl:template>
619
+
620
+
621
+ <!-- class information -->
622
+ <xsl:template match="testsuite" mode="print.test">
623
+ <tr valign="top">
624
+ <xsl:attribute name="class">
625
+ <xsl:choose>
626
+ <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
627
+ <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
628
+ <xsl:otherwise>Pass</xsl:otherwise>
629
+ </xsl:choose>
630
+ </xsl:attribute>
631
+ <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
632
+ <td><xsl:apply-templates select="@tests"/></td>
633
+ <td><xsl:apply-templates select="@errors"/></td>
634
+ <td><xsl:apply-templates select="@failures"/></td>
635
+ <td><xsl:call-template name="display-time">
636
+ <xsl:with-param name="value" select="@time"/>
637
+ </xsl:call-template>
638
+ </td>
639
+ <td><xsl:apply-templates select="@timestamp"/></td>
640
+ <td><xsl:apply-templates select="@hostname"/></td>
641
+ </tr>
642
+ </xsl:template>
643
+
644
+ <xsl:template match="testcase" mode="print.test">
645
+ <tr valign="top">
646
+ <xsl:attribute name="class">
647
+ <xsl:choose>
648
+ <xsl:when test="error">Error</xsl:when>
649
+ <xsl:when test="failure">Failure</xsl:when>
650
+ <xsl:otherwise>TableRowColor</xsl:otherwise>
651
+ </xsl:choose>
652
+ </xsl:attribute>
653
+ <td><xsl:value-of select="@name"/></td>
654
+ <xsl:choose>
655
+ <xsl:when test="failure">
656
+ <td>Failure</td>
657
+ <td><xsl:apply-templates select="failure"/></td>
658
+ </xsl:when>
659
+ <xsl:when test="error">
660
+ <td>Error</td>
661
+ <td><xsl:apply-templates select="error"/></td>
662
+ </xsl:when>
663
+ <xsl:otherwise>
664
+ <td>Success</td>
665
+ <td></td>
666
+ </xsl:otherwise>
667
+ </xsl:choose>
668
+ <td>
669
+ <xsl:call-template name="display-time">
670
+ <xsl:with-param name="value" select="@time"/>
671
+ </xsl:call-template>
672
+ </td>
673
+ </tr>
674
+ </xsl:template>
675
+
676
+
677
+ <!-- Note : the below template error and failure are the same style
678
+ so just call the same style store in the toolkit template -->
679
+ <xsl:template match="failure">
680
+ <xsl:call-template name="display-failures"/>
681
+ </xsl:template>
682
+
683
+ <xsl:template match="error">
684
+ <xsl:call-template name="display-failures"/>
685
+ </xsl:template>
686
+
687
+ <!-- Style for the error and failure in the testcase template -->
688
+ <xsl:template name="display-failures">
689
+ <xsl:choose>
690
+ <xsl:when test="not(@message)">N/A</xsl:when>
691
+ <xsl:otherwise>
692
+ <xsl:value-of select="@message"/>
693
+ </xsl:otherwise>
694
+ </xsl:choose>
695
+ <!-- display the stacktrace -->
696
+ <br/><br/>
697
+ <code>
698
+ <xsl:call-template name="br-replace">
699
+ <xsl:with-param name="word" select="."/>
700
+ </xsl:call-template>
701
+ </code>
702
+ <!-- the latter is better but might be problematic for non-21" monitors... -->
703
+ <!--pre><xsl:value-of select="."/></pre-->
704
+ </xsl:template>
705
+
706
+ <xsl:template name="JS-escape">
707
+ <xsl:param name="string"/>
708
+ <xsl:param name="tmp1" select="stringutils:replace(string($string),'\','\\')"/>
709
+ <xsl:param name="tmp2" select="stringutils:replace(string($tmp1),&quot;'&quot;,&quot;\&apos;&quot;)"/>
710
+ <xsl:value-of select="$tmp2"/>
711
+ </xsl:template>
712
+
713
+
714
+ <!--
715
+ template that will convert a carriage return into a br tag
716
+ @param word the text from which to convert CR to BR tag
717
+ -->
718
+ <xsl:template name="br-replace">
719
+ <xsl:param name="word"/>
720
+ <xsl:param name="br"><br/></xsl:param>
721
+ <xsl:value-of select='stringutils:replace(string($word),"&#xA;",$br)'/>
722
+ </xsl:template>
723
+
724
+ <xsl:template name="display-time">
725
+ <xsl:param name="value"/>
726
+ <xsl:value-of select="format-number($value,'0.000')"/>
727
+ </xsl:template>
728
+
729
+ <xsl:template name="display-percent">
730
+ <xsl:param name="value"/>
731
+ <xsl:value-of select="format-number($value,'0.00%')"/>
732
+ </xsl:template>
733
+ </xsl:stylesheet>