kvm 0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.rvmrc +1 -0
- data/AGPL-3.0 +661 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +32 -0
- data/LICENSE +23 -0
- data/README.md +73 -0
- data/Rakefile +48 -0
- data/bin/kvm +6 -0
- data/kvm.gemspec +28 -0
- data/lib/kvm.rb +286 -0
- data/lib/kvm/archive.rb +56 -0
- data/lib/kvm/artifact.rb +28 -0
- data/lib/kvm/db/jdbc_adapter.rb +71 -0
- data/lib/kvm/db/oracle.rb +23 -0
- data/lib/kvm/db/types.rb +11 -0
- data/lib/kvm/impex.rb +109 -0
- data/lib/kvm/log.rb +7 -0
- data/lib/kvm/resource.rb +72 -0
- data/lib/kvm/rice_release.rb +79 -0
- data/lib/kvm/rice_release_generated_dataset.rb +68 -0
- data/lib/kvm/source.rb +33 -0
- data/lib/kvm/subversion.rb +52 -0
- data/lib/kvm/version.rb +3 -0
- data/lib/kvm/wallet.rb +64 -0
- data/support/ant/INSTALL +2 -0
- data/support/ant/KEYS +1398 -0
- data/support/ant/LICENSE +272 -0
- data/support/ant/NOTICE +6 -0
- data/support/ant/README +97 -0
- data/support/ant/WHATSNEW +5467 -0
- data/support/ant/bin/ant +335 -0
- data/support/ant/bin/ant.bat +218 -0
- data/support/ant/bin/ant.cmd +93 -0
- data/support/ant/bin/antRun +24 -0
- data/support/ant/bin/antRun.bat +50 -0
- data/support/ant/bin/antRun.pl +66 -0
- data/support/ant/bin/antenv.cmd +98 -0
- data/support/ant/bin/complete-ant-cmd.pl +114 -0
- data/support/ant/bin/envset.cmd +131 -0
- data/support/ant/bin/lcp.bat +31 -0
- data/support/ant/bin/runant.pl +153 -0
- data/support/ant/bin/runant.py +102 -0
- data/support/ant/bin/runrc.cmd +60 -0
- data/support/ant/etc/ant-bootstrap.jar +0 -0
- data/support/ant/etc/changelog.xsl +148 -0
- data/support/ant/etc/checkstyle/checkstyle-frames.xsl +299 -0
- data/support/ant/etc/checkstyle/checkstyle-text.xsl +34 -0
- data/support/ant/etc/checkstyle/checkstyle-xdoc.xsl +130 -0
- data/support/ant/etc/coverage-frames.xsl +489 -0
- data/support/ant/etc/jdepend-frames.xsl +487 -0
- data/support/ant/etc/jdepend.xsl +276 -0
- data/support/ant/etc/junit-frames-xalan1.xsl +733 -0
- data/support/ant/etc/junit-frames.xsl +902 -0
- data/support/ant/etc/junit-noframes.xsl +478 -0
- data/support/ant/etc/log.xsl +203 -0
- data/support/ant/etc/maudit-frames.xsl +503 -0
- data/support/ant/etc/mmetrics-frames.xsl +1026 -0
- data/support/ant/etc/tagdiff.xsl +179 -0
- data/support/ant/fetch.xml +343 -0
- data/support/ant/get-m2.xml +121 -0
- data/support/ant/lib/README +3 -0
- data/support/ant/lib/ant-antlr.jar +0 -0
- data/support/ant/lib/ant-antlr.pom +76 -0
- data/support/ant/lib/ant-apache-bcel.jar +0 -0
- data/support/ant/lib/ant-apache-bcel.pom +72 -0
- data/support/ant/lib/ant-apache-bsf.jar +0 -0
- data/support/ant/lib/ant-apache-bsf.pom +75 -0
- data/support/ant/lib/ant-apache-log4j.jar +0 -0
- data/support/ant/lib/ant-apache-log4j.pom +70 -0
- data/support/ant/lib/ant-apache-oro.jar +0 -0
- data/support/ant/lib/ant-apache-oro.pom +75 -0
- data/support/ant/lib/ant-apache-regexp.jar +0 -0
- data/support/ant/lib/ant-apache-regexp.pom +71 -0
- data/support/ant/lib/ant-apache-resolver.jar +0 -0
- data/support/ant/lib/ant-apache-resolver.pom +70 -0
- data/support/ant/lib/ant-apache-xalan2.jar +0 -0
- data/support/ant/lib/ant-apache-xalan2.pom +95 -0
- data/support/ant/lib/ant-commons-logging.jar +0 -0
- data/support/ant/lib/ant-commons-logging.pom +71 -0
- data/support/ant/lib/ant-commons-net.jar +0 -0
- data/support/ant/lib/ant-commons-net.pom +76 -0
- data/support/ant/lib/ant-jai.jar +0 -0
- data/support/ant/lib/ant-jai.pom +85 -0
- data/support/ant/lib/ant-javamail.jar +0 -0
- data/support/ant/lib/ant-javamail.pom +79 -0
- data/support/ant/lib/ant-jdepend.jar +0 -0
- data/support/ant/lib/ant-jdepend.pom +73 -0
- data/support/ant/lib/ant-jmf.jar +0 -0
- data/support/ant/lib/ant-jmf.pom +66 -0
- data/support/ant/lib/ant-jsch.jar +0 -0
- data/support/ant/lib/ant-jsch.pom +75 -0
- data/support/ant/lib/ant-junit.jar +0 -0
- data/support/ant/lib/ant-junit.pom +101 -0
- data/support/ant/lib/ant-junit4.jar +0 -0
- data/support/ant/lib/ant-junit4.pom +71 -0
- data/support/ant/lib/ant-launcher.jar +0 -0
- data/support/ant/lib/ant-launcher.pom +58 -0
- data/support/ant/lib/ant-netrexx.jar +0 -0
- data/support/ant/lib/ant-netrexx.pom +99 -0
- data/support/ant/lib/ant-parent.pom +120 -0
- data/support/ant/lib/ant-swing.jar +0 -0
- data/support/ant/lib/ant-swing.pom +67 -0
- data/support/ant/lib/ant-testutil.jar +0 -0
- data/support/ant/lib/ant-testutil.pom +75 -0
- data/support/ant/lib/ant.jar +0 -0
- data/support/ant/lib/ant.pom +222 -0
- data/support/ant/lib/libraries.properties +65 -0
- data/test/data/files/rice-0.0.0.0-bin.tar.gz +0 -0
- data/test/data/svn/README.txt +5 -0
- data/test/data/svn/conf/authz +32 -0
- data/test/data/svn/conf/passwd +8 -0
- data/test/data/svn/conf/svnserve.conf +47 -0
- data/test/data/svn/db/current +1 -0
- data/test/data/svn/db/format +2 -0
- data/test/data/svn/db/fs-type +1 -0
- data/test/data/svn/db/fsfs.conf +37 -0
- data/test/data/svn/db/min-unpacked-rev +1 -0
- data/test/data/svn/db/rep-cache.db +0 -0
- data/test/data/svn/db/revprops/0/0 +5 -0
- data/test/data/svn/db/revprops/0/1 +13 -0
- data/test/data/svn/db/revs/0/0 +11 -0
- data/test/data/svn/db/revs/0/1 +0 -0
- data/test/data/svn/db/txn-current +1 -0
- data/test/data/svn/db/txn-current-lock +0 -0
- data/test/data/svn/db/uuid +1 -0
- data/test/data/svn/db/write-lock +0 -0
- data/test/data/svn/format +1 -0
- data/test/data/svn/hooks/post-commit.tmpl +50 -0
- data/test/data/svn/hooks/post-lock.tmpl +44 -0
- data/test/data/svn/hooks/post-revprop-change.tmpl +56 -0
- data/test/data/svn/hooks/post-unlock.tmpl +42 -0
- data/test/data/svn/hooks/pre-commit.tmpl +81 -0
- data/test/data/svn/hooks/pre-lock.tmpl +71 -0
- data/test/data/svn/hooks/pre-revprop-change.tmpl +66 -0
- data/test/data/svn/hooks/pre-unlock.tmpl +63 -0
- data/test/data/svn/hooks/start-commit.tmpl +65 -0
- data/test/data/svn/locks/db-logs.lock +3 -0
- data/test/data/svn/locks/db.lock +3 -0
- data/test/helper.rb +146 -0
- data/test/int_test_generate_sql.rb +58 -0
- data/test/test_archive.rb +35 -0
- data/test/test_generate_sql.rb +0 -0
- data/test/test_rice_release.rb +61 -0
- data/test/test_rice_release_generated_dataset.rb +12 -0
- data/test/test_source.rb +31 -0
- data/test/test_subversion.rb +20 -0
- metadata +298 -0
@@ -0,0 +1,902 @@
|
|
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="http://xml.apache.org/xalan/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
|
+
<xsl:param name="TITLE">Unit Test Results.</xsl:param>
|
36
|
+
|
37
|
+
|
38
|
+
<xsl:template match="testsuites">
|
39
|
+
<!-- create the index.html -->
|
40
|
+
<redirect:write file="{$output.dir}/index.html">
|
41
|
+
<xsl:call-template name="index.html"/>
|
42
|
+
</redirect:write>
|
43
|
+
|
44
|
+
<!-- create the stylesheet.css -->
|
45
|
+
<redirect:write file="{$output.dir}/stylesheet.css">
|
46
|
+
<xsl:call-template name="stylesheet.css"/>
|
47
|
+
</redirect:write>
|
48
|
+
|
49
|
+
<!-- create the overview-packages.html at the root -->
|
50
|
+
<redirect:write file="{$output.dir}/overview-summary.html">
|
51
|
+
<xsl:apply-templates select="." mode="overview.packages"/>
|
52
|
+
</redirect:write>
|
53
|
+
|
54
|
+
<!-- create the all-packages.html at the root -->
|
55
|
+
<redirect:write file="{$output.dir}/overview-frame.html">
|
56
|
+
<xsl:apply-templates select="." mode="all.packages"/>
|
57
|
+
</redirect:write>
|
58
|
+
|
59
|
+
<!-- create the all-classes.html at the root -->
|
60
|
+
<redirect:write file="{$output.dir}/allclasses-frame.html">
|
61
|
+
<xsl:apply-templates select="." mode="all.classes"/>
|
62
|
+
</redirect:write>
|
63
|
+
|
64
|
+
<!-- create the all-tests.html at the root -->
|
65
|
+
<redirect:write file="{$output.dir}/all-tests.html">
|
66
|
+
<xsl:apply-templates select="." mode="all.tests"/>
|
67
|
+
</redirect:write>
|
68
|
+
|
69
|
+
<!-- create the alltests-fails.html at the root -->
|
70
|
+
<redirect:write file="{$output.dir}/alltests-fails.html">
|
71
|
+
<xsl:apply-templates select="." mode="all.tests">
|
72
|
+
<xsl:with-param name="type" select="'fails'"/>
|
73
|
+
</xsl:apply-templates>
|
74
|
+
</redirect:write>
|
75
|
+
|
76
|
+
<!-- create the alltests-errors.html at the root -->
|
77
|
+
<redirect:write file="{$output.dir}/alltests-errors.html">
|
78
|
+
<xsl:apply-templates select="." mode="all.tests">
|
79
|
+
<xsl:with-param name="type" select="'errors'"/>
|
80
|
+
</xsl:apply-templates>
|
81
|
+
</redirect:write>
|
82
|
+
|
83
|
+
<!-- process all packages -->
|
84
|
+
<xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
|
85
|
+
<xsl:call-template name="package">
|
86
|
+
<xsl:with-param name="name" select="@package"/>
|
87
|
+
</xsl:call-template>
|
88
|
+
</xsl:for-each>
|
89
|
+
</xsl:template>
|
90
|
+
|
91
|
+
|
92
|
+
<xsl:template name="package">
|
93
|
+
<xsl:param name="name"/>
|
94
|
+
<xsl:variable name="package.dir">
|
95
|
+
<xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
|
96
|
+
<xsl:if test="$name = ''">.</xsl:if>
|
97
|
+
</xsl:variable>
|
98
|
+
<!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
|
99
|
+
<!-- create a classes-list.html in the package directory -->
|
100
|
+
<redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
|
101
|
+
<xsl:call-template name="classes.list">
|
102
|
+
<xsl:with-param name="name" select="$name"/>
|
103
|
+
</xsl:call-template>
|
104
|
+
</redirect:write>
|
105
|
+
|
106
|
+
<!-- create a package-summary.html in the package directory -->
|
107
|
+
<redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
|
108
|
+
<xsl:call-template name="package.summary">
|
109
|
+
<xsl:with-param name="name" select="$name"/>
|
110
|
+
</xsl:call-template>
|
111
|
+
</redirect:write>
|
112
|
+
|
113
|
+
<!-- for each class, creates a @name.html -->
|
114
|
+
<!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
|
115
|
+
<xsl:for-each select="/testsuites/testsuite[@package = $name]">
|
116
|
+
<redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}.html">
|
117
|
+
<xsl:apply-templates select="." mode="class.details"/>
|
118
|
+
</redirect:write>
|
119
|
+
<xsl:if test="string-length(./system-out)!=0">
|
120
|
+
<redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-out.html">
|
121
|
+
<html>
|
122
|
+
<head>
|
123
|
+
<title>Standard Output from <xsl:value-of select="@name"/></title>
|
124
|
+
</head>
|
125
|
+
<body>
|
126
|
+
<pre><xsl:value-of select="./system-out"/></pre>
|
127
|
+
</body>
|
128
|
+
</html>
|
129
|
+
</redirect:write>
|
130
|
+
</xsl:if>
|
131
|
+
<xsl:if test="string-length(./system-err)!=0">
|
132
|
+
<redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-err.html">
|
133
|
+
<html>
|
134
|
+
<head>
|
135
|
+
<title>Standard Error from <xsl:value-of select="@name"/></title>
|
136
|
+
</head>
|
137
|
+
<body>
|
138
|
+
<pre><xsl:value-of select="./system-err"/></pre>
|
139
|
+
</body>
|
140
|
+
</html>
|
141
|
+
</redirect:write>
|
142
|
+
</xsl:if>
|
143
|
+
<xsl:if test="@failures != 0">
|
144
|
+
<redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-fails.html">
|
145
|
+
<xsl:apply-templates select="." mode="class.details">
|
146
|
+
<xsl:with-param name="type" select="'fails'"/>
|
147
|
+
</xsl:apply-templates>
|
148
|
+
</redirect:write>
|
149
|
+
</xsl:if>
|
150
|
+
<xsl:if test="@errors != 0">
|
151
|
+
<redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-errors.html">
|
152
|
+
<xsl:apply-templates select="." mode="class.details">
|
153
|
+
<xsl:with-param name="type" select="'errors'"/>
|
154
|
+
</xsl:apply-templates>
|
155
|
+
</redirect:write>
|
156
|
+
</xsl:if>
|
157
|
+
</xsl:for-each>
|
158
|
+
</xsl:template>
|
159
|
+
|
160
|
+
<xsl:template name="index.html">
|
161
|
+
<html>
|
162
|
+
<head>
|
163
|
+
<title><xsl:value-of select="$TITLE"/></title>
|
164
|
+
</head>
|
165
|
+
<frameset cols="20%,80%">
|
166
|
+
<frameset rows="30%,70%">
|
167
|
+
<frame src="overview-frame.html" name="packageListFrame"/>
|
168
|
+
<frame src="allclasses-frame.html" name="classListFrame"/>
|
169
|
+
</frameset>
|
170
|
+
<frame src="overview-summary.html" name="classFrame"/>
|
171
|
+
<noframes>
|
172
|
+
<h2>Frame Alert</h2>
|
173
|
+
<p>
|
174
|
+
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.
|
175
|
+
</p>
|
176
|
+
</noframes>
|
177
|
+
</frameset>
|
178
|
+
</html>
|
179
|
+
</xsl:template>
|
180
|
+
|
181
|
+
<!-- this is the stylesheet css to use for nearly everything -->
|
182
|
+
<xsl:template name="stylesheet.css">
|
183
|
+
body {
|
184
|
+
font:normal 68% verdana,arial,helvetica;
|
185
|
+
color:#000000;
|
186
|
+
}
|
187
|
+
table tr td, table tr th {
|
188
|
+
font-size: 68%;
|
189
|
+
}
|
190
|
+
table.details tr th{
|
191
|
+
font-weight: bold;
|
192
|
+
text-align:left;
|
193
|
+
background:#a6caf0;
|
194
|
+
}
|
195
|
+
table.details tr td{
|
196
|
+
background:#eeeee0;
|
197
|
+
}
|
198
|
+
|
199
|
+
p {
|
200
|
+
line-height:1.5em;
|
201
|
+
margin-top:0.5em; margin-bottom:1.0em;
|
202
|
+
}
|
203
|
+
h1 {
|
204
|
+
margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
|
205
|
+
}
|
206
|
+
h2 {
|
207
|
+
margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
|
208
|
+
}
|
209
|
+
h3 {
|
210
|
+
margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
|
211
|
+
}
|
212
|
+
h4 {
|
213
|
+
margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
|
214
|
+
}
|
215
|
+
h5 {
|
216
|
+
margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
|
217
|
+
}
|
218
|
+
h6 {
|
219
|
+
margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
|
220
|
+
}
|
221
|
+
.Error {
|
222
|
+
font-weight:bold; color:red;
|
223
|
+
}
|
224
|
+
.Failure {
|
225
|
+
font-weight:bold; color:purple;
|
226
|
+
}
|
227
|
+
.Properties {
|
228
|
+
text-align:right;
|
229
|
+
}
|
230
|
+
</xsl:template>
|
231
|
+
|
232
|
+
<!-- Create list of all/failed/errored tests -->
|
233
|
+
<xsl:template match="testsuites" mode="all.tests">
|
234
|
+
<xsl:param name="type" select="'all'"/>
|
235
|
+
<html>
|
236
|
+
<xsl:variable name="title">
|
237
|
+
<xsl:choose>
|
238
|
+
<xsl:when test="$type = 'fails'">
|
239
|
+
<xsl:text>All Failures</xsl:text>
|
240
|
+
</xsl:when>
|
241
|
+
<xsl:when test="$type = 'errors'">
|
242
|
+
<xsl:text>All Errors</xsl:text>
|
243
|
+
</xsl:when>
|
244
|
+
<xsl:otherwise>
|
245
|
+
<xsl:text>All Tests</xsl:text>
|
246
|
+
</xsl:otherwise>
|
247
|
+
</xsl:choose>
|
248
|
+
</xsl:variable>
|
249
|
+
<head>
|
250
|
+
<title>Unit Test Results: <xsl:value-of select="$title"/></title>
|
251
|
+
<xsl:call-template name="create.stylesheet.link">
|
252
|
+
<xsl:with-param name="package.name"/>
|
253
|
+
</xsl:call-template>
|
254
|
+
</head>
|
255
|
+
<body>
|
256
|
+
<xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
|
257
|
+
<xsl:call-template name="pageHeader"/>
|
258
|
+
<h2><xsl:value-of select="$title"/></h2>
|
259
|
+
|
260
|
+
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
|
261
|
+
<xsl:call-template name="testcase.test.header">
|
262
|
+
<xsl:with-param name="show.class" select="'yes'"/>
|
263
|
+
</xsl:call-template>
|
264
|
+
<!--
|
265
|
+
test can even not be started at all (failure to load the class)
|
266
|
+
so report the error directly
|
267
|
+
-->
|
268
|
+
<xsl:if test="./error">
|
269
|
+
<tr class="Error">
|
270
|
+
<td colspan="4">
|
271
|
+
<xsl:apply-templates select="./error"/>
|
272
|
+
</td>
|
273
|
+
</tr>
|
274
|
+
</xsl:if>
|
275
|
+
<xsl:choose>
|
276
|
+
<xsl:when test="$type = 'fails'">
|
277
|
+
<xsl:apply-templates select=".//testcase[failure]" mode="print.test">
|
278
|
+
<xsl:with-param name="show.class" select="'yes'"/>
|
279
|
+
</xsl:apply-templates>
|
280
|
+
</xsl:when>
|
281
|
+
<xsl:when test="$type = 'errors'">
|
282
|
+
<xsl:apply-templates select=".//testcase[error]" mode="print.test">
|
283
|
+
<xsl:with-param name="show.class" select="'yes'"/>
|
284
|
+
</xsl:apply-templates>
|
285
|
+
</xsl:when>
|
286
|
+
<xsl:otherwise>
|
287
|
+
<xsl:apply-templates select=".//testcase" mode="print.test">
|
288
|
+
<xsl:with-param name="show.class" select="'yes'"/>
|
289
|
+
</xsl:apply-templates>
|
290
|
+
</xsl:otherwise>
|
291
|
+
</xsl:choose>
|
292
|
+
</table>
|
293
|
+
</body>
|
294
|
+
</html>
|
295
|
+
</xsl:template>
|
296
|
+
|
297
|
+
|
298
|
+
<!-- ======================================================================
|
299
|
+
This page is created for every testsuite class.
|
300
|
+
It prints a summary of the testsuite and detailed information about
|
301
|
+
testcase methods.
|
302
|
+
====================================================================== -->
|
303
|
+
<xsl:template match="testsuite" mode="class.details">
|
304
|
+
<xsl:param name="type" select="'all'"/>
|
305
|
+
<xsl:variable name="package.name" select="@package"/>
|
306
|
+
<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>
|
307
|
+
<html>
|
308
|
+
<head>
|
309
|
+
<title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
|
310
|
+
<xsl:call-template name="create.stylesheet.link">
|
311
|
+
<xsl:with-param name="package.name" select="$package.name"/>
|
312
|
+
</xsl:call-template>
|
313
|
+
<script type="text/javascript" language="JavaScript">
|
314
|
+
var TestCases = new Array();
|
315
|
+
var cur;
|
316
|
+
<xsl:apply-templates select="properties"/>
|
317
|
+
</script>
|
318
|
+
<script type="text/javascript" language="JavaScript"><![CDATA[
|
319
|
+
function displayProperties (name) {
|
320
|
+
var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
|
321
|
+
var doc = win.document;
|
322
|
+
doc.open();
|
323
|
+
doc.write("<html><head><title>Properties of " + name + "</title>");
|
324
|
+
doc.write("<style type=\"text/css\">");
|
325
|
+
doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
|
326
|
+
doc.write("table tr td, table tr th { font-size: 68%; }");
|
327
|
+
doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
|
328
|
+
doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
|
329
|
+
doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
|
330
|
+
doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
|
331
|
+
doc.write("</style>");
|
332
|
+
doc.write("</head><body>");
|
333
|
+
doc.write("<h3>Properties of " + name + "</h3>");
|
334
|
+
doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
|
335
|
+
doc.write("<table class='properties'>");
|
336
|
+
doc.write("<tr><th>Name</th><th>Value</th></tr>");
|
337
|
+
for (prop in TestCases[name]) {
|
338
|
+
doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
|
339
|
+
}
|
340
|
+
doc.write("</table>");
|
341
|
+
doc.write("</body></html>");
|
342
|
+
doc.close();
|
343
|
+
win.focus();
|
344
|
+
}
|
345
|
+
]]>
|
346
|
+
</script>
|
347
|
+
</head>
|
348
|
+
<body>
|
349
|
+
<xsl:call-template name="pageHeader"/>
|
350
|
+
<h3>Class <xsl:value-of select="$class.name"/></h3>
|
351
|
+
|
352
|
+
|
353
|
+
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
|
354
|
+
<xsl:call-template name="testsuite.test.header"/>
|
355
|
+
<xsl:apply-templates select="." mode="print.test"/>
|
356
|
+
</table>
|
357
|
+
|
358
|
+
<xsl:choose>
|
359
|
+
<xsl:when test="$type = 'fails'">
|
360
|
+
<h2>Failures</h2>
|
361
|
+
</xsl:when>
|
362
|
+
<xsl:when test="$type = 'errors'">
|
363
|
+
<h2>Errors</h2>
|
364
|
+
</xsl:when>
|
365
|
+
<xsl:otherwise>
|
366
|
+
<h2>Tests</h2>
|
367
|
+
</xsl:otherwise>
|
368
|
+
</xsl:choose>
|
369
|
+
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
|
370
|
+
<xsl:call-template name="testcase.test.header"/>
|
371
|
+
<!--
|
372
|
+
test can even not be started at all (failure to load the class)
|
373
|
+
so report the error directly
|
374
|
+
-->
|
375
|
+
<xsl:if test="./error">
|
376
|
+
<tr class="Error">
|
377
|
+
<td colspan="4"><xsl:apply-templates select="./error"/></td>
|
378
|
+
</tr>
|
379
|
+
</xsl:if>
|
380
|
+
<xsl:choose>
|
381
|
+
<xsl:when test="$type = 'fails'">
|
382
|
+
<xsl:apply-templates select="./testcase[failure]" mode="print.test"/>
|
383
|
+
</xsl:when>
|
384
|
+
<xsl:when test="$type = 'errors'">
|
385
|
+
<xsl:apply-templates select="./testcase[error]" mode="print.test"/>
|
386
|
+
</xsl:when>
|
387
|
+
<xsl:otherwise>
|
388
|
+
<xsl:apply-templates select="./testcase" mode="print.test"/>
|
389
|
+
</xsl:otherwise>
|
390
|
+
</xsl:choose>
|
391
|
+
</table>
|
392
|
+
<div class="Properties">
|
393
|
+
<a>
|
394
|
+
<xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
|
395
|
+
Properties »
|
396
|
+
</a>
|
397
|
+
</div>
|
398
|
+
<xsl:if test="string-length(./system-out)!=0">
|
399
|
+
<div class="Properties">
|
400
|
+
<a>
|
401
|
+
<xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-out.html</xsl:attribute>
|
402
|
+
System.out »
|
403
|
+
</a>
|
404
|
+
</div>
|
405
|
+
</xsl:if>
|
406
|
+
<xsl:if test="string-length(./system-err)!=0">
|
407
|
+
<div class="Properties">
|
408
|
+
<a>
|
409
|
+
<xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-err.html</xsl:attribute>
|
410
|
+
System.err »
|
411
|
+
</a>
|
412
|
+
</div>
|
413
|
+
</xsl:if>
|
414
|
+
</body>
|
415
|
+
</html>
|
416
|
+
</xsl:template>
|
417
|
+
|
418
|
+
<!--
|
419
|
+
Write properties into a JavaScript data structure.
|
420
|
+
This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
|
421
|
+
-->
|
422
|
+
<xsl:template match="properties">
|
423
|
+
cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
|
424
|
+
<xsl:for-each select="property">
|
425
|
+
<xsl:sort select="@name"/>
|
426
|
+
cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
|
427
|
+
</xsl:for-each>
|
428
|
+
</xsl:template>
|
429
|
+
|
430
|
+
|
431
|
+
<!-- ======================================================================
|
432
|
+
This page is created for every package.
|
433
|
+
It prints the name of all classes that belongs to this package.
|
434
|
+
@param name the package name to print classes.
|
435
|
+
====================================================================== -->
|
436
|
+
<!-- list of classes in a package -->
|
437
|
+
<xsl:template name="classes.list">
|
438
|
+
<xsl:param name="name"/>
|
439
|
+
<html>
|
440
|
+
<head>
|
441
|
+
<title>Unit Test Classes: <xsl:value-of select="$name"/></title>
|
442
|
+
<xsl:call-template name="create.stylesheet.link">
|
443
|
+
<xsl:with-param name="package.name" select="$name"/>
|
444
|
+
</xsl:call-template>
|
445
|
+
</head>
|
446
|
+
<body>
|
447
|
+
<table width="100%">
|
448
|
+
<tr>
|
449
|
+
<td nowrap="nowrap">
|
450
|
+
<h2><a href="package-summary.html" target="classFrame">
|
451
|
+
<xsl:value-of select="$name"/>
|
452
|
+
<xsl:if test="$name = ''"><none></xsl:if>
|
453
|
+
</a></h2>
|
454
|
+
</td>
|
455
|
+
</tr>
|
456
|
+
</table>
|
457
|
+
|
458
|
+
<h2>Classes</h2>
|
459
|
+
<table width="100%">
|
460
|
+
<xsl:for-each select="/testsuites/testsuite[./@package = $name]">
|
461
|
+
<xsl:sort select="@name"/>
|
462
|
+
<tr>
|
463
|
+
<td nowrap="nowrap">
|
464
|
+
<a href="{@id}_{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
|
465
|
+
</td>
|
466
|
+
</tr>
|
467
|
+
</xsl:for-each>
|
468
|
+
</table>
|
469
|
+
</body>
|
470
|
+
</html>
|
471
|
+
</xsl:template>
|
472
|
+
|
473
|
+
|
474
|
+
<!--
|
475
|
+
Creates an all-classes.html file that contains a link to all package-summary.html
|
476
|
+
on each class.
|
477
|
+
-->
|
478
|
+
<xsl:template match="testsuites" mode="all.classes">
|
479
|
+
<html>
|
480
|
+
<head>
|
481
|
+
<title>All Unit Test Classes</title>
|
482
|
+
<xsl:call-template name="create.stylesheet.link">
|
483
|
+
<xsl:with-param name="package.name"/>
|
484
|
+
</xsl:call-template>
|
485
|
+
</head>
|
486
|
+
<body>
|
487
|
+
<h2>Classes</h2>
|
488
|
+
<table width="100%">
|
489
|
+
<xsl:apply-templates select="testsuite" mode="all.classes">
|
490
|
+
<xsl:sort select="@name"/>
|
491
|
+
</xsl:apply-templates>
|
492
|
+
</table>
|
493
|
+
</body>
|
494
|
+
</html>
|
495
|
+
</xsl:template>
|
496
|
+
|
497
|
+
<xsl:template match="testsuite" mode="all.classes">
|
498
|
+
<xsl:variable name="package.name" select="@package"/>
|
499
|
+
<tr>
|
500
|
+
<td nowrap="nowrap">
|
501
|
+
<a target="classFrame">
|
502
|
+
<xsl:attribute name="href">
|
503
|
+
<xsl:if test="not($package.name='')">
|
504
|
+
<xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
|
505
|
+
</xsl:if><xsl:value-of select="@id"/>_<xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
|
506
|
+
</xsl:attribute>
|
507
|
+
<xsl:value-of select="@name"/>
|
508
|
+
</a>
|
509
|
+
</td>
|
510
|
+
</tr>
|
511
|
+
</xsl:template>
|
512
|
+
|
513
|
+
|
514
|
+
<!--
|
515
|
+
Creates an html file that contains a link to all package-summary.html files on
|
516
|
+
each package existing on testsuites.
|
517
|
+
@bug there will be a problem here, I don't know yet how to handle unnamed package :(
|
518
|
+
-->
|
519
|
+
<xsl:template match="testsuites" mode="all.packages">
|
520
|
+
<html>
|
521
|
+
<head>
|
522
|
+
<title>All Unit Test Packages</title>
|
523
|
+
<xsl:call-template name="create.stylesheet.link">
|
524
|
+
<xsl:with-param name="package.name"/>
|
525
|
+
</xsl:call-template>
|
526
|
+
</head>
|
527
|
+
<body>
|
528
|
+
<h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
|
529
|
+
<h2>Packages</h2>
|
530
|
+
<table width="100%">
|
531
|
+
<xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
|
532
|
+
<xsl:sort select="@package"/>
|
533
|
+
</xsl:apply-templates>
|
534
|
+
</table>
|
535
|
+
</body>
|
536
|
+
</html>
|
537
|
+
</xsl:template>
|
538
|
+
|
539
|
+
<xsl:template match="testsuite" mode="all.packages">
|
540
|
+
<tr>
|
541
|
+
<td nowrap="nowrap">
|
542
|
+
<a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
|
543
|
+
<xsl:value-of select="@package"/>
|
544
|
+
<xsl:if test="@package = ''"><none></xsl:if>
|
545
|
+
</a>
|
546
|
+
</td>
|
547
|
+
</tr>
|
548
|
+
</xsl:template>
|
549
|
+
|
550
|
+
|
551
|
+
<xsl:template match="testsuites" mode="overview.packages">
|
552
|
+
<html>
|
553
|
+
<head>
|
554
|
+
<title>Unit Test Results: Summary</title>
|
555
|
+
<xsl:call-template name="create.stylesheet.link">
|
556
|
+
<xsl:with-param name="package.name"/>
|
557
|
+
</xsl:call-template>
|
558
|
+
</head>
|
559
|
+
<body>
|
560
|
+
<xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
|
561
|
+
<xsl:call-template name="pageHeader"/>
|
562
|
+
<h2>Summary</h2>
|
563
|
+
<xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
|
564
|
+
<xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
|
565
|
+
<xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
|
566
|
+
<xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
|
567
|
+
<xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
|
568
|
+
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
|
569
|
+
<tr valign="top">
|
570
|
+
<th>Tests</th>
|
571
|
+
<th>Failures</th>
|
572
|
+
<th>Errors</th>
|
573
|
+
<th>Success rate</th>
|
574
|
+
<th>Time</th>
|
575
|
+
</tr>
|
576
|
+
<tr valign="top">
|
577
|
+
<xsl:attribute name="class">
|
578
|
+
<xsl:choose>
|
579
|
+
<xsl:when test="$errorCount > 0">Error</xsl:when>
|
580
|
+
<xsl:when test="$failureCount > 0">Failure</xsl:when>
|
581
|
+
<xsl:otherwise>Pass</xsl:otherwise>
|
582
|
+
</xsl:choose>
|
583
|
+
</xsl:attribute>
|
584
|
+
<td><a title="Display all tests" href="all-tests.html"><xsl:value-of select="$testCount"/></a></td>
|
585
|
+
<td><a title="Display all failures" href="alltests-fails.html"><xsl:value-of select="$failureCount"/></a></td>
|
586
|
+
<td><a title="Display all errors" href="alltests-errors.html"><xsl:value-of select="$errorCount"/></a></td>
|
587
|
+
<td>
|
588
|
+
<xsl:call-template name="display-percent">
|
589
|
+
<xsl:with-param name="value" select="$successRate"/>
|
590
|
+
</xsl:call-template>
|
591
|
+
</td>
|
592
|
+
<td>
|
593
|
+
<xsl:call-template name="display-time">
|
594
|
+
<xsl:with-param name="value" select="$timeCount"/>
|
595
|
+
</xsl:call-template>
|
596
|
+
</td>
|
597
|
+
</tr>
|
598
|
+
</table>
|
599
|
+
<table border="0" width="95%">
|
600
|
+
<tr>
|
601
|
+
<td style="text-align: justify;">
|
602
|
+
Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
|
603
|
+
</td>
|
604
|
+
</tr>
|
605
|
+
</table>
|
606
|
+
|
607
|
+
<h2>Packages</h2>
|
608
|
+
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
|
609
|
+
<xsl:call-template name="testsuite.test.header"/>
|
610
|
+
<xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
|
611
|
+
<xsl:sort select="@package" order="ascending"/>
|
612
|
+
<!-- get the node set containing all testsuites that have the same package -->
|
613
|
+
<xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
|
614
|
+
<tr valign="top">
|
615
|
+
<!-- display a failure if there is any failure/error in the package -->
|
616
|
+
<xsl:attribute name="class">
|
617
|
+
<xsl:choose>
|
618
|
+
<xsl:when test="sum($insamepackage/@errors) > 0">Error</xsl:when>
|
619
|
+
<xsl:when test="sum($insamepackage/@failures) > 0">Failure</xsl:when>
|
620
|
+
<xsl:otherwise>Pass</xsl:otherwise>
|
621
|
+
</xsl:choose>
|
622
|
+
</xsl:attribute>
|
623
|
+
<td><a href="./{translate(@package,'.','/')}/package-summary.html">
|
624
|
+
<xsl:value-of select="@package"/>
|
625
|
+
<xsl:if test="@package = ''"><none></xsl:if>
|
626
|
+
</a></td>
|
627
|
+
<td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
|
628
|
+
<td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
|
629
|
+
<td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
|
630
|
+
<td>
|
631
|
+
<xsl:call-template name="display-time">
|
632
|
+
<xsl:with-param name="value" select="sum($insamepackage/@time)"/>
|
633
|
+
</xsl:call-template>
|
634
|
+
</td>
|
635
|
+
<td><xsl:value-of select="$insamepackage/@timestamp"/></td>
|
636
|
+
<td><xsl:value-of select="$insamepackage/@hostname"/></td>
|
637
|
+
</tr>
|
638
|
+
</xsl:for-each>
|
639
|
+
</table>
|
640
|
+
</body>
|
641
|
+
</html>
|
642
|
+
</xsl:template>
|
643
|
+
|
644
|
+
|
645
|
+
<xsl:template name="package.summary">
|
646
|
+
<xsl:param name="name"/>
|
647
|
+
<html>
|
648
|
+
<head>
|
649
|
+
<xsl:call-template name="create.stylesheet.link">
|
650
|
+
<xsl:with-param name="package.name" select="$name"/>
|
651
|
+
</xsl:call-template>
|
652
|
+
</head>
|
653
|
+
<body>
|
654
|
+
<xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
|
655
|
+
<xsl:call-template name="pageHeader"/>
|
656
|
+
<h3>Package <xsl:value-of select="$name"/></h3>
|
657
|
+
|
658
|
+
<!--table border="0" cellpadding="5" cellspacing="2" width="95%">
|
659
|
+
<xsl:call-template name="class.metrics.header"/>
|
660
|
+
<xsl:apply-templates select="." mode="print.metrics"/>
|
661
|
+
</table-->
|
662
|
+
|
663
|
+
<xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
|
664
|
+
<xsl:if test="count($insamepackage) > 0">
|
665
|
+
<h2>Classes</h2>
|
666
|
+
<p>
|
667
|
+
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
|
668
|
+
<xsl:call-template name="testsuite.test.header"/>
|
669
|
+
<xsl:apply-templates select="$insamepackage" mode="print.test">
|
670
|
+
<xsl:sort select="@name"/>
|
671
|
+
</xsl:apply-templates>
|
672
|
+
</table>
|
673
|
+
</p>
|
674
|
+
</xsl:if>
|
675
|
+
</body>
|
676
|
+
</html>
|
677
|
+
</xsl:template>
|
678
|
+
|
679
|
+
|
680
|
+
<!--
|
681
|
+
transform string like a.b.c to ../../../
|
682
|
+
@param path the path to transform into a descending directory path
|
683
|
+
-->
|
684
|
+
<xsl:template name="path">
|
685
|
+
<xsl:param name="path"/>
|
686
|
+
<xsl:if test="contains($path,'.')">
|
687
|
+
<xsl:text>../</xsl:text>
|
688
|
+
<xsl:call-template name="path">
|
689
|
+
<xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
|
690
|
+
</xsl:call-template>
|
691
|
+
</xsl:if>
|
692
|
+
<xsl:if test="not(contains($path,'.')) and not($path = '')">
|
693
|
+
<xsl:text>../</xsl:text>
|
694
|
+
</xsl:if>
|
695
|
+
</xsl:template>
|
696
|
+
|
697
|
+
|
698
|
+
<!-- create the link to the stylesheet based on the package name -->
|
699
|
+
<xsl:template name="create.stylesheet.link">
|
700
|
+
<xsl:param name="package.name"/>
|
701
|
+
<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>
|
702
|
+
</xsl:template>
|
703
|
+
|
704
|
+
|
705
|
+
<!-- Page HEADER -->
|
706
|
+
<xsl:template name="pageHeader">
|
707
|
+
<h1><xsl:value-of select="$TITLE"/></h1>
|
708
|
+
<table width="100%">
|
709
|
+
<tr>
|
710
|
+
<td align="left"></td>
|
711
|
+
<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>
|
712
|
+
</tr>
|
713
|
+
</table>
|
714
|
+
<hr size="1"/>
|
715
|
+
</xsl:template>
|
716
|
+
|
717
|
+
<!-- class header -->
|
718
|
+
<xsl:template name="testsuite.test.header">
|
719
|
+
<tr valign="top">
|
720
|
+
<th width="80%">Name</th>
|
721
|
+
<th>Tests</th>
|
722
|
+
<th>Errors</th>
|
723
|
+
<th>Failures</th>
|
724
|
+
<th nowrap="nowrap">Time(s)</th>
|
725
|
+
<th nowrap="nowrap">Time Stamp</th>
|
726
|
+
<th>Host</th>
|
727
|
+
</tr>
|
728
|
+
</xsl:template>
|
729
|
+
|
730
|
+
<!-- method header -->
|
731
|
+
<xsl:template name="testcase.test.header">
|
732
|
+
<xsl:param name="show.class" select="''"/>
|
733
|
+
<tr valign="top">
|
734
|
+
<xsl:if test="boolean($show.class)">
|
735
|
+
<th>Class</th>
|
736
|
+
</xsl:if>
|
737
|
+
<th>Name</th>
|
738
|
+
<th>Status</th>
|
739
|
+
<th width="80%">Type</th>
|
740
|
+
<th nowrap="nowrap">Time(s)</th>
|
741
|
+
</tr>
|
742
|
+
</xsl:template>
|
743
|
+
|
744
|
+
|
745
|
+
<!-- class information -->
|
746
|
+
<xsl:template match="testsuite" mode="print.test">
|
747
|
+
<tr valign="top">
|
748
|
+
<xsl:attribute name="class">
|
749
|
+
<xsl:choose>
|
750
|
+
<xsl:when test="@errors[.> 0]">Error</xsl:when>
|
751
|
+
<xsl:when test="@failures[.> 0]">Failure</xsl:when>
|
752
|
+
<xsl:otherwise>Pass</xsl:otherwise>
|
753
|
+
</xsl:choose>
|
754
|
+
</xsl:attribute>
|
755
|
+
<td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:value-of select="@name"/></a></td>
|
756
|
+
<td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:apply-templates select="@tests"/></a></td>
|
757
|
+
<td>
|
758
|
+
<xsl:choose>
|
759
|
+
<xsl:when test="@errors != 0">
|
760
|
+
<a title="Display only errors" href="{@id}_{@name}-errors.html"><xsl:apply-templates select="@errors"/></a>
|
761
|
+
</xsl:when>
|
762
|
+
<xsl:otherwise>
|
763
|
+
<xsl:apply-templates select="@errors"/>
|
764
|
+
</xsl:otherwise>
|
765
|
+
</xsl:choose>
|
766
|
+
</td>
|
767
|
+
<td>
|
768
|
+
<xsl:choose>
|
769
|
+
<xsl:when test="@failures != 0">
|
770
|
+
<a title="Display only failures" href="{@id}_{@name}-fails.html"><xsl:apply-templates select="@failures"/></a>
|
771
|
+
</xsl:when>
|
772
|
+
<xsl:otherwise>
|
773
|
+
<xsl:apply-templates select="@failures"/>
|
774
|
+
</xsl:otherwise>
|
775
|
+
</xsl:choose>
|
776
|
+
</td>
|
777
|
+
<td><xsl:call-template name="display-time">
|
778
|
+
<xsl:with-param name="value" select="@time"/>
|
779
|
+
</xsl:call-template>
|
780
|
+
</td>
|
781
|
+
<td><xsl:apply-templates select="@timestamp"/></td>
|
782
|
+
<td><xsl:apply-templates select="@hostname"/></td>
|
783
|
+
</tr>
|
784
|
+
</xsl:template>
|
785
|
+
|
786
|
+
<xsl:template match="testcase" mode="print.test">
|
787
|
+
<xsl:param name="show.class" select="''"/>
|
788
|
+
<tr valign="top">
|
789
|
+
<xsl:attribute name="class">
|
790
|
+
<xsl:choose>
|
791
|
+
<xsl:when test="error">Error</xsl:when>
|
792
|
+
<xsl:when test="failure">Failure</xsl:when>
|
793
|
+
<xsl:otherwise>TableRowColor</xsl:otherwise>
|
794
|
+
</xsl:choose>
|
795
|
+
</xsl:attribute>
|
796
|
+
<xsl:variable name="class.href">
|
797
|
+
<xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/>
|
798
|
+
</xsl:variable>
|
799
|
+
<xsl:if test="boolean($show.class)">
|
800
|
+
<td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td>
|
801
|
+
</xsl:if>
|
802
|
+
<td>
|
803
|
+
<a name="{@name}"/>
|
804
|
+
<xsl:choose>
|
805
|
+
<xsl:when test="boolean($show.class)">
|
806
|
+
<a href="{concat($class.href, '#', @name)}"><xsl:value-of select="@name"/></a>
|
807
|
+
</xsl:when>
|
808
|
+
<xsl:otherwise>
|
809
|
+
<xsl:value-of select="@name"/>
|
810
|
+
</xsl:otherwise>
|
811
|
+
</xsl:choose>
|
812
|
+
</td>
|
813
|
+
<xsl:choose>
|
814
|
+
<xsl:when test="failure">
|
815
|
+
<td>Failure</td>
|
816
|
+
<td><xsl:apply-templates select="failure"/></td>
|
817
|
+
</xsl:when>
|
818
|
+
<xsl:when test="error">
|
819
|
+
<td>Error</td>
|
820
|
+
<td><xsl:apply-templates select="error"/></td>
|
821
|
+
</xsl:when>
|
822
|
+
<xsl:otherwise>
|
823
|
+
<td>Success</td>
|
824
|
+
<td></td>
|
825
|
+
</xsl:otherwise>
|
826
|
+
</xsl:choose>
|
827
|
+
<td>
|
828
|
+
<xsl:call-template name="display-time">
|
829
|
+
<xsl:with-param name="value" select="@time"/>
|
830
|
+
</xsl:call-template>
|
831
|
+
</td>
|
832
|
+
</tr>
|
833
|
+
</xsl:template>
|
834
|
+
|
835
|
+
|
836
|
+
<!-- Note : the below template error and failure are the same style
|
837
|
+
so just call the same style store in the toolkit template -->
|
838
|
+
<xsl:template match="failure">
|
839
|
+
<xsl:call-template name="display-failures"/>
|
840
|
+
</xsl:template>
|
841
|
+
|
842
|
+
<xsl:template match="error">
|
843
|
+
<xsl:call-template name="display-failures"/>
|
844
|
+
</xsl:template>
|
845
|
+
|
846
|
+
<!-- Style for the error and failure in the testcase template -->
|
847
|
+
<xsl:template name="display-failures">
|
848
|
+
<xsl:choose>
|
849
|
+
<xsl:when test="not(@message)">N/A</xsl:when>
|
850
|
+
<xsl:otherwise>
|
851
|
+
<xsl:value-of select="@message"/>
|
852
|
+
</xsl:otherwise>
|
853
|
+
</xsl:choose>
|
854
|
+
<!-- display the stacktrace -->
|
855
|
+
<br/><br/>
|
856
|
+
<code>
|
857
|
+
<xsl:call-template name="br-replace">
|
858
|
+
<xsl:with-param name="word" select="."/>
|
859
|
+
</xsl:call-template>
|
860
|
+
</code>
|
861
|
+
<!-- the latter is better but might be problematic for non-21" monitors... -->
|
862
|
+
<!--pre><xsl:value-of select="."/></pre-->
|
863
|
+
</xsl:template>
|
864
|
+
|
865
|
+
<xsl:template name="JS-escape">
|
866
|
+
<xsl:param name="string"/>
|
867
|
+
<xsl:param name="tmp1" select="stringutils:replace(string($string),'\','\\')"/>
|
868
|
+
<xsl:param name="tmp2" select="stringutils:replace(string($tmp1),"'","\'")"/>
|
869
|
+
<xsl:value-of select="$tmp2"/>
|
870
|
+
</xsl:template>
|
871
|
+
|
872
|
+
|
873
|
+
<!--
|
874
|
+
template that will convert a carriage return into a br tag
|
875
|
+
@param word the text from which to convert CR to BR tag
|
876
|
+
-->
|
877
|
+
<xsl:template name="br-replace">
|
878
|
+
<xsl:param name="word"/>
|
879
|
+
<xsl:choose>
|
880
|
+
<xsl:when test="contains($word, '
')">
|
881
|
+
<xsl:value-of select="substring-before($word, '
')"/>
|
882
|
+
<br/>
|
883
|
+
<xsl:call-template name="br-replace">
|
884
|
+
<xsl:with-param name="word" select="substring-after($word, '
')"/>
|
885
|
+
</xsl:call-template>
|
886
|
+
</xsl:when>
|
887
|
+
<xsl:otherwise>
|
888
|
+
<xsl:value-of select="$word"/>
|
889
|
+
</xsl:otherwise>
|
890
|
+
</xsl:choose>
|
891
|
+
</xsl:template>
|
892
|
+
|
893
|
+
<xsl:template name="display-time">
|
894
|
+
<xsl:param name="value"/>
|
895
|
+
<xsl:value-of select="format-number($value,'0.000')"/>
|
896
|
+
</xsl:template>
|
897
|
+
|
898
|
+
<xsl:template name="display-percent">
|
899
|
+
<xsl:param name="value"/>
|
900
|
+
<xsl:value-of select="format-number($value,'0.00%')"/>
|
901
|
+
</xsl:template>
|
902
|
+
</xsl:stylesheet>
|