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