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,496 @@
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:string="xalan://java.lang.String">
5
+ <xsl:output method="html" indent="yes" encoding="UTF-8"
6
+ doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
7
+ <xsl:decimal-format decimal-separator="." grouping-separator="," />
8
+ <!--
9
+ Licensed to the Apache Software Foundation (ASF) under one or more
10
+ contributor license agreements. See the NOTICE file distributed with
11
+ this work for additional information regarding copyright ownership.
12
+ The ASF licenses this file to You under the Apache License, Version 2.0
13
+ (the "License"); you may not use this file except in compliance with
14
+ the License. You may obtain a copy of the License at
15
+
16
+ http://www.apache.org/licenses/LICENSE-2.0
17
+
18
+ Unless required by applicable law or agreed to in writing, software
19
+ distributed under the License is distributed on an "AS IS" BASIS,
20
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ See the License for the specific language governing permissions and
22
+ limitations under the License.
23
+ -->
24
+
25
+ <xsl:param name="TITLE">Unit Test Results.</xsl:param>
26
+
27
+ <!--
28
+
29
+ Sample stylesheet to be used with Ant JUnitReport output.
30
+
31
+ It creates a non-framed report that can be useful to send via
32
+ e-mail or such.
33
+
34
+ -->
35
+ <xsl:template match="testsuites">
36
+ <html>
37
+ <head>
38
+ <title><xsl:value-of select="$TITLE"/></title>
39
+ <style type="text/css">
40
+ body {
41
+ font:normal 68% verdana,arial,helvetica;
42
+ color:#000000;
43
+ }
44
+ table tr td, table tr th {
45
+ font-size: 68%;
46
+ }
47
+ table.details tr th{
48
+ font-weight: bold;
49
+ text-align:left;
50
+ background:#a6caf0;
51
+ }
52
+ table.details tr td{
53
+ background:#eeeee0;
54
+ }
55
+
56
+ p {
57
+ line-height:1.5em;
58
+ margin-top:0.5em; margin-bottom:1.0em;
59
+ }
60
+ h1 {
61
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
62
+ }
63
+ h2 {
64
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
65
+ }
66
+ h3 {
67
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
68
+ }
69
+ h4 {
70
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
71
+ }
72
+ h5 {
73
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
74
+ }
75
+ h6 {
76
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
77
+ }
78
+ .Error {
79
+ font-weight:bold; color:red;
80
+ }
81
+ .Failure {
82
+ font-weight:bold; color:purple;
83
+ }
84
+ .Properties {
85
+ text-align:right;
86
+ }
87
+ </style>
88
+ <script type="text/javascript" language="JavaScript">
89
+ var TestCases = new Array();
90
+ var cur;
91
+ <xsl:for-each select="./testsuite">
92
+ <xsl:apply-templates select="properties"/>
93
+ </xsl:for-each>
94
+
95
+ </script>
96
+ <script type="text/javascript" language="JavaScript"><![CDATA[
97
+ function displayProperties (name) {
98
+ var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
99
+ var doc = win.document;
100
+ doc.open();
101
+ doc.write("<html><head><title>Properties of " + name + "</title>");
102
+ doc.write("<style>")
103
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
104
+ doc.write("table tr td, table tr th { font-size: 68%; }");
105
+ doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
106
+ doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
107
+ doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
108
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
109
+ doc.write("</style>");
110
+ doc.write("</head><body>");
111
+ doc.write("<h3>Properties of " + name + "</h3>");
112
+ doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
113
+ doc.write("<table class='properties'>");
114
+ doc.write("<tr><th>Name</th><th>Value</th></tr>");
115
+ for (prop in TestCases[name]) {
116
+ doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
117
+ }
118
+ doc.write("</table>");
119
+ doc.write("</body></html>");
120
+ doc.close();
121
+ win.focus();
122
+ }
123
+ ]]>
124
+ </script>
125
+ </head>
126
+ <body>
127
+ <a name="top"></a>
128
+ <xsl:call-template name="pageHeader"/>
129
+
130
+ <!-- Summary part -->
131
+ <xsl:call-template name="summary"/>
132
+ <hr size="1" width="95%" align="left"/>
133
+
134
+ <!-- Package List part -->
135
+ <xsl:call-template name="packagelist"/>
136
+ <hr size="1" width="95%" align="left"/>
137
+
138
+ <!-- For each package create its part -->
139
+ <xsl:call-template name="packages"/>
140
+ <hr size="1" width="95%" align="left"/>
141
+
142
+ <!-- For each class create the part -->
143
+ <xsl:call-template name="classes"/>
144
+
145
+ </body>
146
+ </html>
147
+ </xsl:template>
148
+
149
+
150
+
151
+ <!-- ================================================================== -->
152
+ <!-- Write a list of all packages with an hyperlink to the anchor of -->
153
+ <!-- of the package name. -->
154
+ <!-- ================================================================== -->
155
+ <xsl:template name="packagelist">
156
+ <h2>Packages</h2>
157
+ Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
158
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
159
+ <xsl:call-template name="testsuite.test.header"/>
160
+ <!-- list all packages recursively -->
161
+ <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
162
+ <xsl:sort select="@package"/>
163
+ <xsl:variable name="testsuites-in-package" select="/testsuites/testsuite[./@package = current()/@package]"/>
164
+ <xsl:variable name="testCount" select="sum($testsuites-in-package/@tests)"/>
165
+ <xsl:variable name="errorCount" select="sum($testsuites-in-package/@errors)"/>
166
+ <xsl:variable name="failureCount" select="sum($testsuites-in-package/@failures)"/>
167
+ <xsl:variable name="skippedCount" select="sum($testsuites-in-package/@skipped)" />
168
+ <xsl:variable name="timeCount" select="sum($testsuites-in-package/@time)"/>
169
+
170
+ <!-- write a summary for the package -->
171
+ <tr valign="top">
172
+ <!-- set a nice color depending if there is an error/failure -->
173
+ <xsl:attribute name="class">
174
+ <xsl:choose>
175
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
176
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
177
+ </xsl:choose>
178
+ </xsl:attribute>
179
+ <td><a href="#{@package}"><xsl:value-of select="@package"/></a></td>
180
+ <td><xsl:value-of select="$testCount"/></td>
181
+ <td><xsl:value-of select="$errorCount"/></td>
182
+ <td><xsl:value-of select="$failureCount"/></td>
183
+ <td><xsl:value-of select="$skippedCount" /></td>
184
+ <td>
185
+ <xsl:call-template name="display-time">
186
+ <xsl:with-param name="value" select="$timeCount"/>
187
+ </xsl:call-template>
188
+ </td>
189
+ <td><xsl:value-of select="$testsuites-in-package/@timestamp"/></td>
190
+ <td><xsl:value-of select="$testsuites-in-package/@hostname"/></td>
191
+ </tr>
192
+ </xsl:for-each>
193
+ </table>
194
+ </xsl:template>
195
+
196
+
197
+ <!-- ================================================================== -->
198
+ <!-- Write a package level report -->
199
+ <!-- It creates a table with values from the document: -->
200
+ <!-- Name | Tests | Errors | Failures | Time -->
201
+ <!-- ================================================================== -->
202
+ <xsl:template name="packages">
203
+ <!-- create an anchor to this package name -->
204
+ <xsl:for-each select="/testsuites/testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
205
+ <xsl:sort select="@package"/>
206
+ <a name="{@package}"></a>
207
+ <h3>Package <xsl:value-of select="@package"/></h3>
208
+
209
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
210
+ <xsl:call-template name="testsuite.test.header"/>
211
+
212
+ <!-- match the testsuites of this package -->
213
+ <xsl:apply-templates select="/testsuites/testsuite[./@package = current()/@package]" mode="print.test"/>
214
+ </table>
215
+ <a href="#top">Back to top</a>
216
+ <p/>
217
+ <p/>
218
+ </xsl:for-each>
219
+ </xsl:template>
220
+
221
+ <xsl:template name="classes">
222
+ <xsl:for-each select="testsuite">
223
+ <xsl:sort select="@name"/>
224
+ <!-- create an anchor to this class name -->
225
+ <a name="{@name}"></a>
226
+ <h3>TestCase <xsl:value-of select="@name"/></h3>
227
+
228
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
229
+ <xsl:call-template name="testcase.test.header"/>
230
+ <!--
231
+ test can even not be started at all (failure to load the class)
232
+ so report the error directly
233
+ -->
234
+ <xsl:if test="./error">
235
+ <tr class="Error">
236
+ <td colspan="4"><xsl:apply-templates select="./error"/></td>
237
+ </tr>
238
+ </xsl:if>
239
+ <xsl:apply-templates select="./testcase" mode="print.test"/>
240
+ </table>
241
+ <div class="Properties">
242
+ <a>
243
+ <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
244
+ Properties &#187;
245
+ </a>
246
+ </div>
247
+ <p/>
248
+
249
+ <a href="#top">Back to top</a>
250
+ </xsl:for-each>
251
+ </xsl:template>
252
+
253
+ <xsl:template name="summary">
254
+ <h2>Summary</h2>
255
+ <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
256
+ <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
257
+ <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
258
+ <xsl:variable name="skippedCount" select="sum(testsuite/@skipped)" />
259
+ <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
260
+ <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
261
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
262
+ <tr valign="top">
263
+ <th>Tests</th>
264
+ <th>Failures</th>
265
+ <th>Errors</th>
266
+ <th>Skipped</th>
267
+ <th>Success rate</th>
268
+ <th>Time</th>
269
+ </tr>
270
+ <tr valign="top">
271
+ <xsl:attribute name="class">
272
+ <xsl:choose>
273
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
274
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
275
+ </xsl:choose>
276
+ </xsl:attribute>
277
+ <td><xsl:value-of select="$testCount"/></td>
278
+ <td><xsl:value-of select="$failureCount"/></td>
279
+ <td><xsl:value-of select="$errorCount"/></td>
280
+ <td><xsl:value-of select="$skippedCount" /></td>
281
+ <td>
282
+ <xsl:call-template name="display-percent">
283
+ <xsl:with-param name="value" select="$successRate"/>
284
+ </xsl:call-template>
285
+ </td>
286
+ <td>
287
+ <xsl:call-template name="display-time">
288
+ <xsl:with-param name="value" select="$timeCount"/>
289
+ </xsl:call-template>
290
+ </td>
291
+
292
+ </tr>
293
+ </table>
294
+ <table border="0" width="95%">
295
+ <tr>
296
+ <td style="text-align: justify;">
297
+ Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.
298
+ </td>
299
+ </tr>
300
+ </table>
301
+ </xsl:template>
302
+
303
+ <!--
304
+ Write properties into a JavaScript data structure.
305
+ This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
306
+ -->
307
+ <xsl:template match="properties">
308
+ cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
309
+ <xsl:for-each select="property">
310
+ <xsl:sort select="@name"/>
311
+ cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
312
+ </xsl:for-each>
313
+ </xsl:template>
314
+
315
+ <!-- Page HEADER -->
316
+ <xsl:template name="pageHeader">
317
+ <h1><xsl:value-of select="$TITLE"/></h1>
318
+ <table width="100%">
319
+ <tr>
320
+ <td align="left"></td>
321
+ <td align="right">Designed for use with <a href='http://www.junit.org'>JUnit</a> and <a href='http://ant.apache.org/ant'>Ant</a>.</td>
322
+ </tr>
323
+ </table>
324
+ <hr size="1"/>
325
+ </xsl:template>
326
+
327
+ <xsl:template match="testsuite" mode="header">
328
+ <tr valign="top">
329
+ <th width="80%">Name</th>
330
+ <th>Tests</th>
331
+ <th>Errors</th>
332
+ <th>Failures</th>
333
+ <th>Skipped</th>
334
+ <th nowrap="nowrap">Time(s)</th>
335
+ </tr>
336
+ </xsl:template>
337
+
338
+ <!-- class header -->
339
+ <xsl:template name="testsuite.test.header">
340
+ <tr valign="top">
341
+ <th width="80%">Name</th>
342
+ <th>Tests</th>
343
+ <th>Errors</th>
344
+ <th>Failures</th>
345
+ <th>Skipped</th>
346
+ <th nowrap="nowrap">Time(s)</th>
347
+ <th nowrap="nowrap">Time Stamp</th>
348
+ <th>Host</th>
349
+ </tr>
350
+ </xsl:template>
351
+
352
+ <!-- method header -->
353
+ <xsl:template name="testcase.test.header">
354
+ <tr valign="top">
355
+ <th>Name</th>
356
+ <th>Status</th>
357
+ <th width="80%">Type</th>
358
+ <th nowrap="nowrap">Time(s)</th>
359
+ </tr>
360
+ </xsl:template>
361
+
362
+
363
+ <!-- class information -->
364
+ <xsl:template match="testsuite" mode="print.test">
365
+ <tr valign="top">
366
+ <!-- set a nice color depending if there is an error/failure -->
367
+ <xsl:attribute name="class">
368
+ <xsl:choose>
369
+ <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
370
+ <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
371
+ </xsl:choose>
372
+ </xsl:attribute>
373
+
374
+ <!-- print testsuite information -->
375
+ <td><a href="#{@name}"><xsl:value-of select="@name"/></a></td>
376
+ <td><xsl:value-of select="@tests"/></td>
377
+ <td><xsl:value-of select="@errors"/></td>
378
+ <td><xsl:value-of select="@failures"/></td>
379
+ <td><xsl:value-of select="@skipped" /></td>
380
+ <td>
381
+ <xsl:call-template name="display-time">
382
+ <xsl:with-param name="value" select="@time"/>
383
+ </xsl:call-template>
384
+ </td>
385
+ <td><xsl:apply-templates select="@timestamp"/></td>
386
+ <td><xsl:apply-templates select="@hostname"/></td>
387
+ </tr>
388
+ </xsl:template>
389
+
390
+ <xsl:template match="testcase" mode="print.test">
391
+ <tr valign="top">
392
+ <xsl:attribute name="class">
393
+ <xsl:choose>
394
+ <xsl:when test="failure | error">Error</xsl:when>
395
+ </xsl:choose>
396
+ </xsl:attribute>
397
+ <td><xsl:value-of select="@name"/></td>
398
+ <xsl:choose>
399
+ <xsl:when test="failure">
400
+ <td>Failure</td>
401
+ <td><xsl:apply-templates select="failure"/></td>
402
+ </xsl:when>
403
+ <xsl:when test="error">
404
+ <td>Error</td>
405
+ <td><xsl:apply-templates select="error"/></td>
406
+ </xsl:when>
407
+ <xsl:when test="skipped">
408
+ <td>Skipped</td>
409
+ <td><xsl:apply-templates select="skipped"/></td>
410
+ </xsl:when>
411
+ <xsl:otherwise>
412
+ <td>Success</td>
413
+ <td></td>
414
+ </xsl:otherwise>
415
+ </xsl:choose>
416
+ <td>
417
+ <xsl:call-template name="display-time">
418
+ <xsl:with-param name="value" select="@time"/>
419
+ </xsl:call-template>
420
+ </td>
421
+ </tr>
422
+ </xsl:template>
423
+
424
+
425
+ <xsl:template match="failure">
426
+ <xsl:call-template name="display-failures"/>
427
+ </xsl:template>
428
+
429
+ <xsl:template match="error">
430
+ <xsl:call-template name="display-failures"/>
431
+ </xsl:template>
432
+
433
+ <xsl:template match="skipped">
434
+ <xsl:call-template name="display-failures"/>
435
+ </xsl:template>
436
+
437
+ <!-- Style for the error, failure and skipped in the testcase template -->
438
+ <xsl:template name="display-failures">
439
+ <xsl:choose>
440
+ <xsl:when test="not(@message)">N/A</xsl:when>
441
+ <xsl:otherwise>
442
+ <xsl:value-of select="@message"/>
443
+ </xsl:otherwise>
444
+ </xsl:choose>
445
+ <!-- display the stacktrace -->
446
+ <code>
447
+ <br/><br/>
448
+ <xsl:call-template name="br-replace">
449
+ <xsl:with-param name="word" select="."/>
450
+ </xsl:call-template>
451
+ </code>
452
+ <!-- the later is better but might be problematic for non-21" monitors... -->
453
+ <!--pre><xsl:value-of select="."/></pre-->
454
+ </xsl:template>
455
+
456
+ <xsl:template name="JS-escape">
457
+ <xsl:param name="string"/>
458
+ <xsl:param name="tmp1" select="string:replaceAll(string:new(string($string)),'\\','\\\\')"/>
459
+ <xsl:param name="tmp2" select="string:replaceAll(string:new(string($tmp1)),&quot;'&quot;,&quot;\\&apos;&quot;)"/>
460
+ <xsl:param name="tmp3" select="string:replaceAll(string:new(string($tmp2)),&quot;&#10;&quot;,'\\n')"/>
461
+ <xsl:param name="tmp4" select="string:replaceAll(string:new(string($tmp3)),&quot;&#13;&quot;,'\\r')"/>
462
+ <xsl:value-of select="$tmp4"/>
463
+ </xsl:template>
464
+
465
+
466
+ <!--
467
+ template that will convert a carriage return into a br tag
468
+ @param word the text from which to convert CR to BR tag
469
+ -->
470
+ <xsl:template name="br-replace">
471
+ <xsl:param name="word"/>
472
+ <xsl:choose>
473
+ <xsl:when test="contains($word, '&#xa;')">
474
+ <xsl:value-of select="substring-before($word, '&#xa;')"/>
475
+ <br/>
476
+ <xsl:call-template name="br-replace">
477
+ <xsl:with-param name="word" select="substring-after($word, '&#xa;')"/>
478
+ </xsl:call-template>
479
+ </xsl:when>
480
+ <xsl:otherwise>
481
+ <xsl:value-of select="$word"/>
482
+ </xsl:otherwise>
483
+ </xsl:choose>
484
+ </xsl:template>
485
+
486
+ <xsl:template name="display-time">
487
+ <xsl:param name="value"/>
488
+ <xsl:value-of select="format-number($value,'0.000')"/>
489
+ </xsl:template>
490
+
491
+ <xsl:template name="display-percent">
492
+ <xsl:param name="value"/>
493
+ <xsl:value-of select="format-number($value,'0.00%')"/>
494
+ </xsl:template>
495
+
496
+ </xsl:stylesheet>