tetra 0.46.0 → 0.48.0

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