1 <?xml version=
"1.0" encoding=
"iso-8859-1"?>
2 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
4 format a number in to display its value in percent
5 @param value the number to format
7 <xsl:template name=
"display-time-second">
8 <xsl:param name=
"value"/>
9 <span class=
"time"><xsl:value-of select=
"format-number($value,'0.00')"/>s
</span>
13 format a number in to display its value in percent
14 @param value the number to format
16 <xsl:template name=
"display-time">
17 <xsl:param name=
"value"/>
18 <span class=
"time"><xsl:value-of select=
"format-number($value*1000,'0.000')"/>ms
</span>
21 format a number in to display its value in percent
22 @param value the number to format
24 <xsl:template name=
"display-percent">
25 <xsl:param name=
"value"/>
26 <xsl:value-of select=
"format-number($value,'0.00 %')"/>
29 format a number in to display its value in Kb
30 @param value the number to format
32 <xsl:template name=
"display-memory">
33 <xsl:param name=
"value"/>
34 <xsl:variable name=
"kbvalue">
35 <xsl:value-of select=
"$value * 0.0001"/>
37 <xsl:value-of select=
"format-number($kbvalue,'0.00 Kb')"/>
40 template that will convert a carriage return into a br tag
41 @param word the text from which to convert CR to BR tag
43 <xsl:template name=
"br-replace">
44 <xsl:param name=
"word"/>
46 <xsl:when test=
"contains($word,'
')">
47 <xsl:value-of select=
"substring-before($word,'
')"/>
49 <xsl:call-template name=
"br-replace">
50 <xsl:with-param name=
"word" select=
"substring-after($word,'
')"/>
54 <xsl:value-of select=
"$word"/>
61 <xsl:template name=
"scale">
62 <xsl:param name=
"origLength"/>
63 <xsl:param name=
"targetLength"/>
64 <xsl:param name=
"value"/>
65 <xsl:value-of select=
"($value div $origLength) * $targetLength"/>
71 <xsl:template name=
"counter-progressbar">
72 <xsl:param name=
"width"/>
73 <xsl:param name=
"height"/>
75 <xsl:attribute name=
"style">position:relative;background-color:#DDDDDD;border-color:black;width:
<xsl:value-of select=
"$width"/>px;height:
<xsl:value-of select=
"$height"/>px;
</xsl:attribute>
77 <xsl:if test=
"@success-count > 0">
79 <xsl:attribute name=
"style">position:absolute;top:
0px;left:
0px;height:
<xsl:value-of select=
"$height"/>px;background-color:lightgreen;font-size:
1px;width:
<xsl:call-template name=
"scale">
80 <xsl:with-param name=
"origLength" select=
"@run-count"/>
81 <xsl:with-param name=
"targetLength" select=
"$width"/>
82 <xsl:with-param name=
"value" select=
"@success-count"/>
83 </xsl:call-template>px;
</xsl:attribute>
87 <xsl:if test=
"@failure-count > 0">
89 <xsl:attribute name=
"style">position:absolute;top:
0px;left:
<xsl:call-template name=
"scale">
90 <xsl:with-param name=
"origLength" select=
"@run-count"/>
91 <xsl:with-param name=
"targetLength" select=
"$width"/>
92 <xsl:with-param name=
"value" select=
"@success-count"/>
93 </xsl:call-template>px;height:
<xsl:value-of select=
"$height"/>px;background-color:red;font-size:
1px;width:
<xsl:call-template name=
"scale">
94 <xsl:with-param name=
"origLength" select=
"@run-count"/>
95 <xsl:with-param name=
"targetLength" select=
"$width"/>
96 <xsl:with-param name=
"value" select=
"@failure-count"/>
97 </xsl:call-template>px;
</xsl:attribute>
101 <xsl:if test=
"@skip-count > 0">
103 <xsl:attribute name=
"style">position:absolute;top:
0px;left:
<xsl:call-template name=
"scale">
104 <xsl:with-param name=
"origLength" select=
"@run-count"/>
105 <xsl:with-param name=
"targetLength" select=
"$width"/>
106 <xsl:with-param name=
"value" select=
"@success-count+@failure-count"/>
107 </xsl:call-template>px;height:
<xsl:value-of select=
"$height"/>px;background-color:blueviolet;font-size:
1px;width:
<xsl:call-template name=
"scale">
108 <xsl:with-param name=
"origLength" select=
"@run-count"/>
109 <xsl:with-param name=
"targetLength" select=
"$width"/>
110 <xsl:with-param name=
"value" select=
"@skip-count"/>
111 </xsl:call-template>px;
</xsl:attribute>
115 <xsl:if test=
"@ignore-count > 0">
117 <xsl:attribute name=
"style">position:absolute;top:
0px;left:
<xsl:call-template name=
"scale">
118 <xsl:with-param name=
"origLength" select=
"@run-count"/>
119 <xsl:with-param name=
"targetLength" select=
"$width"/>
120 <xsl:with-param name=
"value" select=
"@success-count+@failure-count+@skip-count"/>
121 </xsl:call-template>px;height:
<xsl:value-of select=
"$height"/>px;background-color:orange;font-size:
1px;width:
<xsl:call-template name=
"scale">
122 <xsl:with-param name=
"origLength" select=
"@run-count"/>
123 <xsl:with-param name=
"targetLength" select=
"$width"/>
124 <xsl:with-param name=
"value" select=
"@ignore-count"/>
125 </xsl:call-template>px;
</xsl:attribute>
129 <xsl:attribute name=
"style">position:absolute;top:
0px;left:
<xsl:value-of select=
"$width +2"/>px;height:
<xsl:value-of select=
"$height"/>px;font-size:
<xsl:value-of select=
"$height - 2"/>px;font-family:Verdana;
</xsl:attribute><xsl:value-of select=
"@run-count"/>/
<xsl:value-of select=
"@success-count"/>/
<xsl:value-of select=
"@failure-count"/>/
<xsl:value-of select=
"@skip-count"/>/
<xsl:value-of select=
"@ignore-count"/>/
<xsl:value-of select=
"@assert-count"/></div>
133 <xsl:template name=
"counter-literal">
134 <xsl:value-of select=
"@run-count"/> test,
135 <xsl:value-of select=
"@success-count"/> success,
136 <xsl:value-of select=
"@failure-count"/> failures,
137 <xsl:value-of select=
"@skip-count" /> skipped,
138 <xsl:value-of select=
"@ignore-count"/> ignored,
139 <xsl:value-of select=
"@assert-count"/> asserts
143 <xsl:template name=
"icon">
144 <xsl:param name=
"src"/>
145 <img width=
"16" height=
"16" border=
"0">
146 <xsl:attribute name=
"src"><xsl:value-of select=
"$src"/></xsl:attribute>
150 <xsl:template name=
"assembly-icon">
151 <xsl:call-template name=
"icon">
152 <xsl:with-param name=
"src">Populator.png
</xsl:with-param>
156 <xsl:template name=
"fixture-icon">
157 <xsl:call-template name=
"icon">
158 <xsl:with-param name=
"src">Fixture.png
</xsl:with-param>
162 <xsl:template name=
"namespace-icon">
163 <xsl:call-template name=
"icon">
164 <xsl:with-param name=
"src">Category.png
</xsl:with-param>
168 <xsl:template name=
"run-icon">
169 <xsl:call-template name=
"icon">
170 <xsl:with-param name=
"src">Test.png
</xsl:with-param>
174 <xsl:template name=
"assemblyid">
175 <xsl:param name=
"name"/>
176 as
<xsl:value-of select=
"$name"/>
179 <xsl:template name=
"exceptionid">
180 <xsl:param name=
"name"/>
181 ex
<xsl:value-of select=
"$name"/>
187 <xsl:template match=
"/">
189 <script>function ToggleVisible(blockId) {
190 var block = document.all.item(blockId);
191 var plus = document.all.item(blockId + '.plus');
192 if (block.style.display=='none') {
193 block.style.display='block';
196 block.style.display='none';
201 <xsl:apply-templates select=
"//report-result" />
205 <xsl:template match=
"report-result">
206 <table cellpadding=
"2" cellspacing=
"0" border=
"0" width=
"98%">
208 <td class=
"unittests-sectionheader" colspan=
"3">
210 <xsl:value-of select=
"counter/@run-count" /> tests,
211 <xsl:value-of select=
"counter/@success-count" /> success,
212 <xsl:value-of select=
"counter/@failure-count" /> failure,
213 <xsl:value-of select=
"counter/@ignore-count" /> ignored,
214 <xsl:value-of select=
"counter/@skip-count" /> skipped,
215 <xsl:value-of select=
"format-number(counter/@duration,'##.##')" /> s
220 <xsl:call-template name=
"report-summary" />
221 <xsl:if test=
"count(//warnings)>0">
223 <xsl:call-template name=
"warnings" />
226 <xsl:call-template name=
"assemblies" />
232 <xsl:template name=
"report-summary">
233 <table border=
"0" cellpadding=
"1" cellspacing=
"1">
237 <xsl:for-each select=
"counter">
238 <xsl:call-template name=
"counter-progressbar">
239 <xsl:with-param name=
"width">100</xsl:with-param>
240 <xsl:with-param name=
"height">14</xsl:with-param>
245 <xsl:call-template name=
"assembly-summary"/>
249 <xsl:template name=
"assembly-summary">
250 <xsl:for-each select=
"//assemblies/assembly">
254 <xsl:attribute name=
"href">#
<xsl:value-of select=
"@name"/>Assembly
</xsl:attribute>
255 <xsl:call-template name=
"assembly-icon"/>
256 <xsl:value-of select=
"@name"/>
260 <xsl:for-each select=
"counter">
261 <xsl:call-template name=
"counter-progressbar">
262 <xsl:with-param name=
"width">100</xsl:with-param>
263 <xsl:with-param name=
"height">12</xsl:with-param>
268 <xsl:call-template name=
"fixture-summary" />
272 <xsl:template name=
"fixture-id"><xsl:param name=
"name" /><xsl:value-of select=
"$name" /></xsl:template>
274 <xsl:template name=
"fixture-summary">
275 <xsl:for-each select=
"descendant::fixture">
276 <tr class=
"fixtureSummary">
279 <xsl:attribute name=
"href">#
<xsl:call-template name=
"fixture-id"><xsl:with-param name=
"name">
280 <xsl:value-of select=
"@type" />.
<xsl:value-of select=
"@name" />
281 </xsl:with-param></xsl:call-template>
283 <xsl:call-template name=
"fixture-icon"/>
284 <xsl:value-of select=
"@type" />.
<xsl:value-of select=
"@name" />
288 <xsl:for-each select=
"counter">
289 <xsl:call-template name=
"counter-progressbar">
290 <xsl:with-param name=
"width">100</xsl:with-param>
291 <xsl:with-param name=
"height">10</xsl:with-param>
299 <xsl:template name=
"warnings">
301 <xsl:for-each select=
"//warning">
303 <xsl:attribute name=
"class">
305 <xsl:when test=
"position() mod 2 = 1">failureOdd
</xsl:when>
306 <xsl:otherwise>failureEven
</xsl:otherwise>
309 <td><xsl:call-template name=
"run-icon"/>
310 <xsl:value-of select=
"ancestor::run/@name" /></td>
311 <td><xsl:value-of select=
"text()"/></td>
317 <xsl:template name=
"assemblies">
318 <xsl:for-each select=
"assemblies/assembly">
319 <xsl:call-template name=
"assembly-detail" />
323 <xsl:template name=
"assembly-detail">
324 <h2><xsl:attribute name=
"id"><xsl:value-of select=
"@name"/>Assembly
</xsl:attribute>
325 <xsl:call-template name=
"assembly-icon"/>
326 <xsl:value-of select=
"@name"/>
329 <li><strong>Full Name:
</strong> <xsl:value-of select=
"@full-name"/></li>
330 <li><strong>Results:
</strong>
331 <xsl:for-each select=
"counter">
332 <xsl:call-template name=
"counter-literal"/>
335 <li><strong>Duration:
</strong>
336 <xsl:call-template name=
"display-time-second">
337 <xsl:with-param name=
"value" select=
"counter/@duration"/>
341 <xsl:if test=
"set-up|tear-down">
343 <tr class=
"assemblysetupteardown" ><td>Assembly SetUp and TearDown
</td></tr>
344 <xsl:apply-templates select=
"set-up"/>
345 <xsl:apply-templates select=
"tear-down"/>
348 <xsl:call-template name=
"namespaces-table" />
351 <xsl:template name=
"namespaces-table">
352 <xsl:apply-templates select=
"namespaces" />
353 <xsl:apply-templates select=
"namespace" />
356 <xsl:template match=
"namespaces">
357 <xsl:apply-templates select=
"namespace" />
360 <xsl:template match=
"namespace">
361 <xsl:apply-templates select=
"namespaces" />
362 <xsl:apply-templates select=
"fixtures" />
365 <xsl:template match=
"fixtures">
366 <table width=
"800" border=
"0" cellpadding=
"1" cellspacing=
"1">
370 <xsl:apply-templates select=
"fixture" />
374 <xsl:template match=
"fixture">
376 <xsl:attribute name=
"id"><xsl:call-template name=
"fixture-id"><xsl:with-param name=
"name">
377 <xsl:value-of select=
"@type" />.
<xsl:value-of select=
"@name" />
378 </xsl:with-param></xsl:call-template>
381 <xsl:for-each select=
"counter">
382 <xsl:call-template name=
"counter-progressbar">
383 <xsl:with-param name=
"width" select=
"100" />
384 <xsl:with-param name=
"height" select=
"10" />
389 <tr class=
"fixture" >
391 <xsl:call-template name=
"fixture-icon"/>
392 <xsl:value-of select=
"@type" />.
<xsl:value-of select=
"@name"/>
394 (
<xsl:call-template name=
"display-time-second">
395 <xsl:with-param name=
"value" select=
"counter/@duration"/>
396 </xsl:call-template>)
399 <xsl:if test=
"set-up|tear-down">
400 <tr class=
"fixturesetupteardown"><td>Fixture SetUp and TearDown
</td></tr>
401 <xsl:apply-templates select=
"set-up"/>
402 <xsl:apply-templates select=
"tear-down"/>
406 <xsl:apply-templates select=
"runs" />
410 <xsl:template match=
"runs">
411 <table width=
"100%" border=
"0" cellpadding=
"1" cellspacing=
"1">
412 <xsl:apply-templates select=
"*" />
416 <xsl:template match=
"set-up">
417 <xsl:call-template name=
"set-up-or-tear-down" />
419 <xsl:template match=
"tear-down">
420 <xsl:call-template name=
"set-up-or-tear-down" />
422 <xsl:template name=
"set-up-or-tear-down">
424 <!-- Choosing style and alternate -->
425 <xsl:attribute name=
"class">
427 <xsl:when test=
"@result = 'success'">successEven
</xsl:when>
428 <xsl:when test=
"@result = 'failure'">failureEven
</xsl:when>
432 <xsl:value-of select=
"@name"/>
435 <xsl:call-template name=
"display-time">
436 <xsl:with-param name=
"value" select=
"@duration"/>
440 <xsl:call-template name=
"display-memory">
441 <xsl:with-param name=
"value" select=
"@memory"/>
445 <!-- Adding execption log -->
446 <xsl:if test=
"@result = 'failure'">
447 <xsl:call-template name=
"exception-log"/>
449 <!-- Adding console out, error -->
450 <xsl:call-template name=
"console-output" />
458 <xsl:template match=
"run">
460 <!-- Choosing style and alternate -->
461 <xsl:attribute name=
"class">
463 <xsl:when test=
"@result = 'success'">
465 <xsl:when test=
"position() mod 2 = 1">successOdd
</xsl:when>
466 <xsl:otherwise>successEven
</xsl:otherwise>
469 <xsl:when test=
"@result = 'failure'">
471 <xsl:when test=
"position() mod 2 = 1">failureOdd
</xsl:when>
472 <xsl:otherwise>failureEven
</xsl:otherwise>
475 <xsl:when test=
"@result = 'skip'">
477 <xsl:when test=
"position() mod 2 = 1">skippedOdd
</xsl:when>
478 <xsl:otherwise>skippedEven
</xsl:otherwise>
481 <xsl:when test=
"@result = 'ignore'">
483 <xsl:when test=
"position() mod 2 = 1">ignoreOdd
</xsl:when>
484 <xsl:otherwise>ignoreEvent
</xsl:otherwise>
490 <xsl:call-template name=
"run-icon"/>
491 <xsl:value-of select=
"@name"/>
494 <xsl:call-template name=
"display-time">
495 <xsl:with-param name=
"value" select=
"@duration"/>
499 <xsl:call-template name=
"display-memory">
500 <xsl:with-param name=
"value" select=
"@memory"/>
501 </xsl:call-template>,
<xsl:value-of select=
"@assert-count" />
504 <!-- Adding execption log -->
505 <xsl:if test=
"@result = 'failure'">
506 <xsl:call-template name=
"exception-log"/>
508 <!-- Adding console out, error -->
509 <xsl:call-template name=
"console-output" />
511 <xsl:template name=
"exception-log">
512 <tr class=
"failure-exception">
515 <div style=
"display;">
516 <table border=
"0" cellpadding=
"1" cellspacing=
"1" width=
"600">
517 <xsl:apply-templates select=
"exception" />
523 <xsl:template match=
"exception">
524 <tr class=
"exceptionType">
526 <strong>Type:
</strong>
527 <xsl:value-of select=
"@type"/>
532 <strong>Message:
</strong>
533 <xsl:value-of select=
"message"/>
538 <strong>Source:
</strong>
539 <xsl:value-of select=
"source"/>
542 <xsl:for-each select=
"properties/property">
545 <bold><xsl:value-of select=
"@name"/>:
</bold>
546 <xsl:value-of select=
"@value"/>
552 <strong>StackTrace:
</strong>
554 <pre class=
"stackTrace" width=
"80">
555 <xsl:value-of select=
"stack-trace"/>
559 <xsl:apply-templates select=
"exception" />
561 <xsl:template name=
"console-output">
562 <xsl:apply-templates select=
"console-out"/>
563 <xsl:apply-templates select=
"console-error"/>
565 <xsl:template match=
"console-out">
566 <xsl:call-template name=
"console">
567 <xsl:with-param name=
"name">Console Output
</xsl:with-param>
570 <xsl:template match=
"console-error">
571 <xsl:call-template name=
"console">
572 <xsl:with-param name=
"name">Console Error
</xsl:with-param>
575 <xsl:template name=
"console">
576 <xsl:param name=
"name" />
577 <xsl:if test=
"string-length( text() ) != 0">
581 <tr><td><strong><xsl:value-of select=
"$name"/></strong></td></tr>
584 <pre class=
"console"><xsl:value-of select=
"text()"/></pre>