simple-xspec-wrapper 0.1.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +11 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +6 -0
  8. data/Gemfile.lock +37 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +49 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/exe/xspec +16 -0
  15. data/lib/xspec/version.rb +3 -0
  16. data/lib/xspec.rb +256 -0
  17. data/simple-xspec-wrapper.gemspec +28 -0
  18. data/spec-test.xml +1125 -0
  19. data/vendor/xspec-1.0.0/.gitignore +7 -0
  20. data/vendor/xspec-1.0.0/.travis.yml +57 -0
  21. data/vendor/xspec-1.0.0/LICENSE +21 -0
  22. data/vendor/xspec-1.0.0/README.md +26 -0
  23. data/vendor/xspec-1.0.0/appveyor.yml +77 -0
  24. data/vendor/xspec-1.0.0/bin/xspec.bat +620 -0
  25. data/vendor/xspec-1.0.0/bin/xspec.sh +403 -0
  26. data/vendor/xspec-1.0.0/build.xml +369 -0
  27. data/vendor/xspec-1.0.0/editors/emacs/README +31 -0
  28. data/vendor/xspec-1.0.0/editors/emacs/schemas.xml +6 -0
  29. data/vendor/xspec-1.0.0/editors/oxygen/.cvsignore +2 -0
  30. data/vendor/xspec-1.0.0/editors/oxygen/README +11 -0
  31. data/vendor/xspec-1.0.0/editors/oxygen/build.xml +38 -0
  32. data/vendor/xspec-1.0.0/editors/oxygen/templates/xspec.xml +17 -0
  33. data/vendor/xspec-1.0.0/editors/oxygen/xspec.framework +175 -0
  34. data/vendor/xspec-1.0.0/find-examples.xml +37 -0
  35. data/vendor/xspec-1.0.0/find-examples.xsl +615 -0
  36. data/vendor/xspec-1.0.0/graphics/3angle-down.gif +0 -0
  37. data/vendor/xspec-1.0.0/graphics/3angle-right.gif +0 -0
  38. data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.class +0 -0
  39. data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.java +209 -0
  40. data/vendor/xspec-1.0.0/src/ant/find-test-failure.xsl +17 -0
  41. data/vendor/xspec-1.0.0/src/ant/get-schematron-phase.xsl +17 -0
  42. data/vendor/xspec-1.0.0/src/ant/locate-schematron.xsl +28 -0
  43. data/vendor/xspec-1.0.0/src/ant/make-path.js +4 -0
  44. data/vendor/xspec-1.0.0/src/compiler/generate-common-tests.xsl +604 -0
  45. data/vendor/xspec-1.0.0/src/compiler/generate-query-helper.xsl +152 -0
  46. data/vendor/xspec-1.0.0/src/compiler/generate-query-tests.xsl +473 -0
  47. data/vendor/xspec-1.0.0/src/compiler/generate-query-utils.xql +263 -0
  48. data/vendor/xspec-1.0.0/src/compiler/generate-tests-helper.xsl +169 -0
  49. data/vendor/xspec-1.0.0/src/compiler/generate-tests-utils.xsl +479 -0
  50. data/vendor/xspec-1.0.0/src/compiler/generate-xspec-tests.xsl +503 -0
  51. data/vendor/xspec-1.0.0/src/harnesses/basex/basex-standalone-xquery-harness.xproc +135 -0
  52. data/vendor/xspec-1.0.0/src/harnesses/basex/basex-xquery-harness.xproc +133 -0
  53. data/vendor/xspec-1.0.0/src/harnesses/exist/exist-xquery-harness.xproc +161 -0
  54. data/vendor/xspec-1.0.0/src/harnesses/harness-lib.xpl +327 -0
  55. data/vendor/xspec-1.0.0/src/harnesses/marklogic/ml-xquery-harness.xproc +143 -0
  56. data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xquery-harness.xproc +108 -0
  57. data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xslt-harness.xproc +85 -0
  58. data/vendor/xspec-1.0.0/src/harnesses/zorba/zorba-xquery-harness.xproc +134 -0
  59. data/vendor/xspec-1.0.0/src/reporter/coverage-report.xsl +378 -0
  60. data/vendor/xspec-1.0.0/src/reporter/format-utils.xsl +220 -0
  61. data/vendor/xspec-1.0.0/src/reporter/format-xspec-report-folding.xsl +164 -0
  62. data/vendor/xspec-1.0.0/src/reporter/format-xspec-report.xsl +410 -0
  63. data/vendor/xspec-1.0.0/src/reporter/junit-report.xsl +93 -0
  64. data/vendor/xspec-1.0.0/src/reporter/test-report.css +469 -0
  65. data/vendor/xspec-1.0.0/src/schemas/find-examples.rnc +90 -0
  66. data/vendor/xspec-1.0.0/src/schemas/xspec.rnc +304 -0
  67. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_abstract_expand.xsl +313 -0
  68. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_dsdl_include.xsl +1519 -0
  69. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message.xsl +64 -0
  70. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message_xslt2.xsl +64 -0
  71. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_saxon.xsl +2306 -0
  72. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_xslt1.xsl +1851 -0
  73. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt1.xsl +614 -0
  74. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt2.xsl +692 -0
  75. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/readme.txt +101 -0
  76. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-cs.xhtml +56 -0
  77. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-de.xhtml +55 -0
  78. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-en.xhtml +57 -0
  79. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-fr.xhtml +54 -0
  80. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-ja.xhtml +53 -0
  81. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-nl.xhtml +58 -0
  82. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/schematron-skeleton-api.htm +723 -0
  83. data/vendor/xspec-1.0.0/src/schematron/sch-location-compare.xsl +139 -0
  84. data/vendor/xspec-1.0.0/src/schematron/schut-to-xspec.xsl +179 -0
  85. data/vendor/xspec-1.0.0/test/Makefile +117 -0
  86. data/vendor/xspec-1.0.0/test/README +5 -0
  87. data/vendor/xspec-1.0.0/test/catalog/xspec-160_catalog.xml +4 -0
  88. data/vendor/xspec-1.0.0/test/catalog/xspec-160_schematron.xspec +6 -0
  89. data/vendor/xspec-1.0.0/test/catalog/xspec-160_xslt.xspec +5 -0
  90. data/vendor/xspec-1.0.0/test/end-to-end/README.md +42 -0
  91. data/vendor/xspec-1.0.0/test/end-to-end/cases/.gitignore +1 -0
  92. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/.gitignore +3 -0
  93. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-50-result-norm.html +74 -0
  94. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-55-result-norm.html +112 -0
  95. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-focus-1-result-norm.html +109 -0
  96. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-function-result-norm.html +118 -0
  97. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-import-result-norm.html +163 -0
  98. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-imported-result-norm.html +95 -0
  99. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-pending-result-norm.html +123 -0
  100. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-rule-result-norm.html +109 -0
  101. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-three-dots-result-norm.html +1237 -0
  102. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xsl +7 -0
  103. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xspec +10 -0
  104. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xsl +2 -0
  105. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xspec +18 -0
  106. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-focus-1.xspec +71 -0
  107. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-function.xspec +50 -0
  108. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-import.xspec +50 -0
  109. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-imported.xspec +48 -0
  110. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-pending.xspec +89 -0
  111. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-rule.xspec +76 -0
  112. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xsl +49 -0
  113. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xspec +527 -0
  114. data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.cmd +51 -0
  115. data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.sh +25 -0
  116. data/vendor/xspec-1.0.0/test/end-to-end/processor/_deserializer.xsl +53 -0
  117. data/vendor/xspec-1.0.0/test/end-to-end/processor/_normalizer.xsl +192 -0
  118. data/vendor/xspec-1.0.0/test/end-to-end/processor/_serializer.xsl +15 -0
  119. data/vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl +35 -0
  120. data/vendor/xspec-1.0.0/test/end-to-end/processor/compare.xsl +88 -0
  121. data/vendor/xspec-1.0.0/test/end-to-end/processor/normalize.xsl +28 -0
  122. data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.cmd +61 -0
  123. data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.sh +28 -0
  124. data/vendor/xspec-1.0.0/test/generate-tests-utils.xspec +636 -0
  125. data/vendor/xspec-1.0.0/test/generate-x-utils.xspec +173 -0
  126. data/vendor/xspec-1.0.0/test/generate-xspec-tests.xspec +64 -0
  127. data/vendor/xspec-1.0.0/test/run-xspec-tests.cmd +83 -0
  128. data/vendor/xspec-1.0.0/test/run-xspec-tests.sh +42 -0
  129. data/vendor/xspec-1.0.0/test/sch-location-compare.xspec +179 -0
  130. data/vendor/xspec-1.0.0/test/schematron/data/standards.xml +7 -0
  131. data/vendor/xspec-1.0.0/test/schematron/schematron-017.sch +9 -0
  132. data/vendor/xspec-1.0.0/test/schematron/schematron-018.sch +17 -0
  133. data/vendor/xspec-1.0.0/test/schematron/schematron-019.sch +13 -0
  134. data/vendor/xspec-1.0.0/test/schematron/schematron-020-01.sch +35 -0
  135. data/vendor/xspec-1.0.0/test/schematron/schematron-020.sch +32 -0
  136. data/vendor/xspec-1.0.0/test/schematron/schematron-021.sch +28 -0
  137. data/vendor/xspec-1.0.0/test/schematron/schematron-022.sch +18 -0
  138. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-compile.xsl +8 -0
  139. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-expand.xsl +8 -0
  140. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-include.xsl +8 -0
  141. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-in.xspec +5 -0
  142. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-out.xspec +7 -0
  143. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-in.xspec +5 -0
  144. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-out.xspec +7 -0
  145. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002.sch +4 -0
  146. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-in.xspec +7 -0
  147. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-out.xspec +9 -0
  148. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-in.xspec +20 -0
  149. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-out.xspec +22 -0
  150. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-in.xspec +6 -0
  151. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-out.xspec +8 -0
  152. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-in.xspec +11 -0
  153. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-out.xspec +13 -0
  154. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-in.xspec +7 -0
  155. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-out.xspec +9 -0
  156. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007.xml +2 -0
  157. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-in.xspec +9 -0
  158. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-out.xspec +9 -0
  159. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-import-in.xspec +5 -0
  160. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-in.xspec +6 -0
  161. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-out.xspec +10 -0
  162. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-import.xspec +5 -0
  163. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-in.xspec +6 -0
  164. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-out.xspec +8 -0
  165. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-in.xspec +6 -0
  166. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-out.xspec +8 -0
  167. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-01.xml +4 -0
  168. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-02.xml +13 -0
  169. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-out.xspec +81 -0
  170. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-in.xspec +6 -0
  171. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-out.xspec +8 -0
  172. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch +4 -0
  173. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch.xsl +4 -0
  174. data/vendor/xspec-1.0.0/test/schematron-01.sch +17 -0
  175. data/vendor/xspec-1.0.0/test/schematron-01.xml +14 -0
  176. data/vendor/xspec-1.0.0/test/schematron-01.xspec +14 -0
  177. data/vendor/xspec-1.0.0/test/schematron-012.xspec +83 -0
  178. data/vendor/xspec-1.0.0/test/schematron-014-01.xml +10 -0
  179. data/vendor/xspec-1.0.0/test/schematron-014.sch +16 -0
  180. data/vendor/xspec-1.0.0/test/schematron-014.xspec +11 -0
  181. data/vendor/xspec-1.0.0/test/schematron-015.sch +16 -0
  182. data/vendor/xspec-1.0.0/test/schematron-015.xspec +11 -0
  183. data/vendor/xspec-1.0.0/test/schematron-016.sch +19 -0
  184. data/vendor/xspec-1.0.0/test/schematron-016.xspec +171 -0
  185. data/vendor/xspec-1.0.0/test/schematron-017.xspec +26 -0
  186. data/vendor/xspec-1.0.0/test/schematron-018.xspec +120 -0
  187. data/vendor/xspec-1.0.0/test/schematron-019.xspec +16 -0
  188. data/vendor/xspec-1.0.0/test/schematron-020.xspec +53 -0
  189. data/vendor/xspec-1.0.0/test/schematron-021.xspec +27 -0
  190. data/vendor/xspec-1.0.0/test/schematron-022.xspec +15 -0
  191. data/vendor/xspec-1.0.0/test/schematron-param-001.xspec +50 -0
  192. data/vendor/xspec-1.0.0/test/schut-to-xspec-012.sch +27 -0
  193. data/vendor/xspec-1.0.0/test/schut-to-xspec.xspec +85 -0
  194. data/vendor/xspec-1.0.0/test/unit-expect-xsl.xspec +28 -0
  195. data/vendor/xspec-1.0.0/test/xspec-26.xsl +19 -0
  196. data/vendor/xspec-1.0.0/test/xspec-26.xspec +17 -0
  197. data/vendor/xspec-1.0.0/test/xspec-30.xml +2 -0
  198. data/vendor/xspec-1.0.0/test/xspec-30.xsl +6 -0
  199. data/vendor/xspec-1.0.0/test/xspec-30.xspec +8 -0
  200. data/vendor/xspec-1.0.0/test/xspec-33.xsl +7 -0
  201. data/vendor/xspec-1.0.0/test/xspec-33.xspec +15 -0
  202. data/vendor/xspec-1.0.0/test/xspec-46.xsl +7 -0
  203. data/vendor/xspec-1.0.0/test/xspec-46.xspec +9 -0
  204. data/vendor/xspec-1.0.0/test/xspec-72.xsl +13 -0
  205. data/vendor/xspec-1.0.0/test/xspec-72.xspec +19 -0
  206. data/vendor/xspec-1.0.0/test/xspec-bat.cmd +757 -0
  207. data/vendor/xspec-1.0.0/test/xspec-focus-2.xspec +91 -0
  208. data/vendor/xspec-1.0.0/test/xspec-junit.xspec +78 -0
  209. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xml +1003 -0
  210. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xslt +10 -0
  211. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xspec +13 -0
  212. data/vendor/xspec-1.0.0/test/xspec-tested.xql +44 -0
  213. data/vendor/xspec-1.0.0/test/xspec-tested.xsl +64 -0
  214. data/vendor/xspec-1.0.0/test/xspec-variable.xml +3 -0
  215. data/vendor/xspec-1.0.0/test/xspec-variable.xspec +58 -0
  216. data/vendor/xspec-1.0.0/test/xspec-xslt3.xsl +13 -0
  217. data/vendor/xspec-1.0.0/test/xspec-xslt3.xspec +12 -0
  218. data/vendor/xspec-1.0.0/test/xspec.bats +420 -0
  219. data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xslt +40 -0
  220. data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xspec +75 -0
  221. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.sch +17 -0
  222. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xml +11 -0
  223. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xspec +14 -0
  224. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseA.xspec +11 -0
  225. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseB.xspec +12 -0
  226. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import1.xspec +10 -0
  227. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import2.xspec +8 -0
  228. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import3.xspec +10 -0
  229. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.sch +58 -0
  230. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.xml +19 -0
  231. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc1.xml +6 -0
  232. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc2.xml +7 -0
  233. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.sch +29 -0
  234. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.xspec +63 -0
  235. data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.sch +20 -0
  236. data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.xspec +33 -0
  237. data/vendor/xspec-1.0.0/tutorial/schematron/quickfix.sch +81 -0
  238. data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xq +8 -0
  239. data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xspec +16 -0
  240. data/vendor/xspec-1.0.0/xproject/project.xml +8 -0
  241. data/vendor/xspec-1.0.0/xproject/release-project.xsl +41 -0
  242. metadata +341 -0
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+ xmlns:xspec-17="https://github.com/xspec/xspec/pull/17" xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ exclude-result-prefixes="xs" version="2.0">
5
+
6
+ <xsl:function name="xspec-17:read-document" as="document-node()?">
7
+ <xsl:sequence select="doc('xspec-result-naming-collision.xml')"/>
8
+ </xsl:function>
9
+
10
+ </xsl:stylesheet>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" xmlns:xspec-17="https://github.com/xspec/xspec/pull/17" stylesheet="xspec-result-naming-collision.xslt">
3
+ <!-- https://github.com/expath/xspec/issues/67
4
+ test result naming collision when a function which reads a document containing more than 1000 node -->
5
+ <x:scenario label="scenario 1">
6
+ <x:call function="xspec-17:read-document"/>
7
+ <x:expect>...</x:expect>
8
+ </x:scenario>
9
+ <x:scenario label="scenario 2">
10
+ <x:call function="xspec-17:read-document"/>
11
+ <x:expect>...</x:expect>
12
+ </x:scenario>
13
+ </x:description>
@@ -0,0 +1,44 @@
1
+ (::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::)
2
+ (: File: test/xspec-tested.xql :)
3
+ (: Author: Jeni Tennsion :)
4
+ (: Tags: :)
5
+ (: Copyright (c) 2010 Jeni Tennsion (see end of file.) :)
6
+ (: ------------------------------------------------------------------------ :)
7
+
8
+
9
+ module namespace my = "http://example.org/ns/my";
10
+
11
+ declare function my:square($n as xs:integer)
12
+ as xs:integer
13
+ {
14
+ $n * $n
15
+ };
16
+
17
+
18
+ (: ------------------------------------------------------------------------ :)
19
+ (: DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. :)
20
+ (: :)
21
+ (: Copyright (c) 2010 Jeni Tennsion :)
22
+ (: :)
23
+ (: The contents of this file are subject to the MIT License (see the URI :)
24
+ (: http://www.opensource.org/licenses/mit-license.php for details). :)
25
+ (: :)
26
+ (: Permission is hereby granted, free of charge, to any person obtaining :)
27
+ (: a copy of this software and associated documentation files (the :)
28
+ (: "Software"), to deal in the Software without restriction, including :)
29
+ (: without limitation the rights to use, copy, modify, merge, publish, :)
30
+ (: distribute, sublicense, and/or sell copies of the Software, and to :)
31
+ (: permit persons to whom the Software is furnished to do so, subject to :)
32
+ (: the following conditions: :)
33
+ (: :)
34
+ (: The above copyright notice and this permission notice shall be :)
35
+ (: included in all copies or substantial portions of the Software. :)
36
+ (: :)
37
+ (: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, :)
38
+ (: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF :)
39
+ (: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. :)
40
+ (: IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY :)
41
+ (: CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, :)
42
+ (: TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE :)
43
+ (: SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. :)
44
+ (: ------------------------------------------------------------------------ :)
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: test/xspec-tested.xsl -->
4
+ <!-- Author: Jeni Tennsion -->
5
+ <!-- Tags: -->
6
+ <!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
7
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
8
+
9
+
10
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
12
+ xmlns:my="http://example.org/ns/my"
13
+ exclude-result-prefixes="xs"
14
+ version="2.0">
15
+
16
+ <xsl:function name="my:square" as="xs:integer">
17
+ <xsl:param name="n" as="xs:integer"/>
18
+ <xsl:sequence select="$n * $n"/>
19
+ </xsl:function>
20
+
21
+ <xsl:template match="rule">
22
+ <xsl:param name="p"/>
23
+ <transformed/>
24
+ </xsl:template>
25
+
26
+ <xsl:template match="foo">
27
+ <xsl:param name="p"/>
28
+ <bar>
29
+ <foobaz>
30
+ <xsl:value-of select="$p"/>
31
+ </foobaz>
32
+ </bar>
33
+ </xsl:template>
34
+
35
+ </xsl:stylesheet>
36
+
37
+
38
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
39
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
40
+ <!-- -->
41
+ <!-- Copyright (c) 2010 Jeni Tennsion -->
42
+ <!-- -->
43
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
44
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
45
+ <!-- -->
46
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
47
+ <!-- a copy of this software and associated documentation files (the -->
48
+ <!-- "Software"), to deal in the Software without restriction, including -->
49
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
50
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
51
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
52
+ <!-- the following conditions: -->
53
+ <!-- -->
54
+ <!-- The above copyright notice and this permission notice shall be -->
55
+ <!-- included in all copies or substantial portions of the Software. -->
56
+ <!-- -->
57
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
58
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
59
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
60
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
61
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
62
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
63
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
64
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -0,0 +1,3 @@
1
+ <test-data>
2
+ <test num="3" value="9"/>
3
+ </test-data>
@@ -0,0 +1,58 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: test/xspec-variable.xspec -->
4
+ <!-- Author: Florent Georges -->
5
+ <!-- Tags: -->
6
+ <!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
7
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
8
+ <t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:my="http://example.org/ns/my" query="http://example.org/ns/my" query-at="xspec-tested.xql" stylesheet="xspec-tested.xsl">
9
+ <t:variable name="test-data" href="xspec-variable.xml"/>
10
+ <t:variable name="test-3" select="$test-data/*/test[xs:integer(@num) eq 3]"/>
11
+ <t:scenario label="call global var">
12
+ <t:call function="my:square">
13
+ <t:param select="$test-3/@num"/>
14
+ </t:call>
15
+ <t:expect label="the result" test="$x:result eq $test-3/xs:integer(@value)"/>
16
+ </t:scenario>
17
+ <!--
18
+ TODO: For now, x:call and x:context are pulled first, then
19
+ templates are applied to other x:scenario/*. So the order is
20
+ not respected, and the variable declaration is compiled after
21
+ the call/appling!
22
+ -->
23
+ <t:scenario label="call local var">
24
+ <t:variable name="param" select="$test-3/@num"/>
25
+ <t:call function="my:square">
26
+ <t:param select="$param"/>
27
+ </t:call>
28
+ <t:variable name="result" select="$test-3/@value"/>
29
+ <t:expect label="the result" test="$x:result eq xs:integer($result)"/>
30
+ </t:scenario>
31
+ </t:description>
32
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
33
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
34
+ <!-- -->
35
+ <!-- Copyright (c) 2010 Jeni Tennsion -->
36
+ <!-- -->
37
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
38
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
39
+ <!-- -->
40
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
41
+ <!-- a copy of this software and associated documentation files (the -->
42
+ <!-- "Software"), to deal in the Software without restriction, including -->
43
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
44
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
45
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
46
+ <!-- the following conditions: -->
47
+ <!-- -->
48
+ <!-- The above copyright notice and this permission notice shall be -->
49
+ <!-- included in all copies or substantial portions of the Software. -->
50
+ <!-- -->
51
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
52
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
53
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
54
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
55
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
56
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
57
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
58
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ exclude-result-prefixes="xs" version="3.0">
5
+
6
+ <xsl:template name="supportXPath3">
7
+ <root>
8
+ <question><xsl:text>Does XSpec support XPath 3.0?</xsl:text></question>
9
+ <answer><xsl:value-of select="let $answer := 'Yes it does' return $answer"/></answer>
10
+ </root>
11
+ </xsl:template>
12
+
13
+ </xsl:stylesheet>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="xspec-xslt3.xsl" xslt-version="3.0">
3
+ <x:scenario label="When testing the string concatenation operator in XPath 3.0">
4
+ <x:call template="supportXPath3"/>
5
+ <x:expect label="concatenate strings">
6
+ <root>
7
+ <question>Does XSpec support XPath 3.0?</question>
8
+ <answer>Yes it does</answer>
9
+ </root>
10
+ </x:expect>
11
+ </x:scenario>
12
+ </x:description>
@@ -0,0 +1,420 @@
1
+ #!/usr/bin/env bats
2
+ #===============================================================================
3
+ #
4
+ # USAGE: bats xspec.bats
5
+ #
6
+ # DESCRIPTION: Unit tests for script bin/xspec.sh
7
+ #
8
+ # INPUT: N/A
9
+ #
10
+ # OUTPUT: Unit tests results
11
+ #
12
+ # DEPENDENCIES: This script requires bats (https://github.com/sstephenson/bats)
13
+ #
14
+ # AUTHOR: Sandro Cirulli, github.com/cirulls
15
+ #
16
+ # LICENSE: MIT License (https://opensource.org/licenses/MIT)
17
+ #
18
+ #===============================================================================
19
+
20
+ setup() {
21
+ mkdir ../tutorial/xspec
22
+ mkdir ../test/xspec
23
+ mkdir ../tutorial/schematron/xspec
24
+ }
25
+
26
+
27
+ teardown() {
28
+ rm -rf ../tutorial/xspec
29
+ rm -rf ../test/xspec
30
+ rm -rf ../tutorial/schematron/xspec
31
+ }
32
+
33
+
34
+ @test "invoking xspec without arguments prints usage" {
35
+ run ../bin/xspec.sh
36
+ echo $output
37
+ [ "$status" -eq 1 ]
38
+ [ "${lines[2]}" = "Usage: xspec [-t|-q|-s|-c|-j|-h] filename [coverage]" ]
39
+ }
40
+
41
+
42
+ @test "invoking xspec with -s and -t prints error message" {
43
+ run ../bin/xspec.sh -s -t
44
+ echo $output
45
+ [ "$status" -eq 1 ]
46
+ [ "${lines[1]}" = "-s and -t are mutually exclusive" ]
47
+ }
48
+
49
+
50
+ @test "invoking xspec with -s and -q prints error message" {
51
+ run ../bin/xspec.sh -s -q
52
+ echo $output
53
+ [ "$status" -eq 1 ]
54
+ [ "${lines[1]}" = "-s and -q are mutually exclusive" ]
55
+ }
56
+
57
+
58
+ @test "invoking xspec with -t and -q prints error message" {
59
+ run ../bin/xspec.sh -t -q
60
+ echo $output
61
+ [ "$status" -eq 1 ]
62
+ [ "${lines[1]}" = "-t and -q are mutually exclusive" ]
63
+ }
64
+
65
+
66
+ @test "invoking code coverage with Saxon9HE returns error message" {
67
+ export SAXON_CP=/path/to/saxon9he.jar
68
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
69
+ echo $output
70
+ [ "$status" -eq 1 ]
71
+ [ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
72
+ }
73
+
74
+
75
+ @test "invoking code coverage with Saxon9SA returns error message" {
76
+ export SAXON_CP=/path/to/saxon9sa.jar
77
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
78
+ echo $output
79
+ [ "$status" -eq 1 ]
80
+ [ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
81
+ }
82
+
83
+
84
+ @test "invoking code coverage with Saxon9 returns error message" {
85
+ export SAXON_CP=/path/to/saxon9.jar
86
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
87
+ echo $output
88
+ [ "$status" -eq 1 ]
89
+ [ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
90
+ }
91
+
92
+
93
+ @test "invoking code coverage with Saxon8SA returns error message" {
94
+ export SAXON_CP=/path/to/saxon8sa.jar
95
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
96
+ echo $output
97
+ [ "$status" -eq 1 ]
98
+ [ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
99
+ }
100
+
101
+
102
+ @test "invoking code coverage with Saxon8 returns error message" {
103
+ export SAXON_CP=/path/to/saxon8.jar
104
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
105
+ echo $output
106
+ [ "$status" -eq 1 ]
107
+ [ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
108
+ }
109
+
110
+
111
+ @test "invoking code coverage with Saxon9EE creates test stylesheet" {
112
+ export SAXON_CP=/path/to/saxon9ee.jar
113
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
114
+ echo $output
115
+ [ "$status" -eq 1 ]
116
+ [ "${lines[1]}" = "Creating Test Stylesheet..." ]
117
+ }
118
+
119
+
120
+ @test "invoking code coverage with Saxon9PE creates test stylesheet" {
121
+ export SAXON_CP=/path/to/saxon9pe.jar
122
+ run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
123
+ echo $output
124
+ [ "$status" -eq 1 ]
125
+ [ "${lines[1]}" = "Creating Test Stylesheet..." ]
126
+ }
127
+
128
+
129
+ @test "invoking xspec generates XML report file" {
130
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
131
+ run stat ../tutorial/xspec/escape-for-regex-result.xml
132
+ echo $output
133
+ [ "$status" -eq 0 ]
134
+ }
135
+
136
+
137
+ @test "invoking xspec generates HTML report file" {
138
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
139
+ run stat ../tutorial/xspec/escape-for-regex-result.html
140
+ echo $output
141
+ [ "$status" -eq 0 ]
142
+ }
143
+
144
+
145
+ @test "invoking xspec with -j option with Saxon8 returns error message" {
146
+ export SAXON_CP=/path/to/saxon8.jar
147
+ run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
148
+ echo $output
149
+ [ "$status" -eq 1 ]
150
+ [ "${lines[1]}" = "Saxon8 detected. JUnit report requires Saxon9." ]
151
+ }
152
+
153
+
154
+ @test "invoking xspec with -j option with Saxon8-SA returns error message" {
155
+ export SAXON_CP=/path/to/saxon8sa.jar
156
+ run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
157
+ echo $output
158
+ [ "$status" -eq 1 ]
159
+ [ "${lines[1]}" = "Saxon8 detected. JUnit report requires Saxon9." ]
160
+ }
161
+
162
+
163
+ @test "invoking xspec with -j option generates message with JUnit report location" {
164
+ run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
165
+ echo $output
166
+ [ "$status" -eq 0 ]
167
+ [ "${lines[18]}" = "Report available at ../tutorial/xspec/escape-for-regex-junit.xml" ]
168
+ }
169
+
170
+
171
+ @test "invoking xspec with -j option generates XML report file" {
172
+ run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
173
+ run stat ../tutorial/xspec/escape-for-regex-result.xml
174
+ echo $output
175
+ [ "$status" -eq 0 ]
176
+ }
177
+
178
+
179
+ @test "invoking xspec with -j option generates JUnit report file" {
180
+ run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
181
+ run stat ../tutorial/xspec/escape-for-regex-junit.xml
182
+ echo $output
183
+ [ "$status" -eq 0 ]
184
+ }
185
+
186
+
187
+ @test "invoking xspec with Saxon-B-9-1-0-8 creates test stylesheet" {
188
+ export SAXON_CP=/path/to/saxonb9-1-0-8.jar
189
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
190
+ echo $output
191
+ [ "$status" -eq 1 ]
192
+ [ "${lines[1]}" = "Creating Test Stylesheet..." ]
193
+ }
194
+
195
+
196
+ @test "invoking xspec.sh with TEST_DIR already set externally generates files inside TEST_DIR" {
197
+ export TEST_DIR=/tmp
198
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
199
+ echo $output
200
+ [ "$status" -eq 0 ]
201
+ [ "${lines[18]}" = "Report available at /tmp/escape-for-regex-result.html" ]
202
+ }
203
+
204
+
205
+ @test "invoking xspec.sh without TEST_DIR generates files in default location" {
206
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
207
+ echo $output
208
+ [ "$status" -eq 0 ]
209
+ [ "${lines[18]}" = "Report available at ../tutorial/xspec/escape-for-regex-result.html" ]
210
+ }
211
+
212
+
213
+ @test "invoking xspec.sh that passes a non xs:boolean does not raise a warning #46" {
214
+ run ../bin/xspec.sh ../test/xspec-46.xspec
215
+ echo $output
216
+ [ "$status" -eq 0 ]
217
+ [[ "${lines[3]}" =~ "Testing with" ]]
218
+ }
219
+
220
+
221
+ @test "executing the Saxon XProc harness generates a report with UTF-8 encoding" {
222
+
223
+ if [ -z ${XMLCALABASH_CP} ]; then
224
+ skip "test for XProc skipped as XMLCalabash uses a higher version of Saxon";
225
+ else
226
+ run java -Xmx1024m -cp ${XMLCALABASH_CP} com.xmlcalabash.drivers.Main -isource=xspec-72.xspec -p xspec-home=file:${PWD}/../ -oresult=xspec/xspec-72-result.html ../src/harnesses/saxon/saxon-xslt-harness.xproc
227
+
228
+ query="declare default element namespace 'http://www.w3.org/1999/xhtml'; concat(/html/head/meta[@http-equiv eq 'Content-Type']/@content = 'text/html; charset=UTF-8', '&#x0A;')";
229
+
230
+ run java -cp ${SAXON_CP} net.sf.saxon.Query -s:xspec/xspec-72-result.html -qs:"$query" !method=text
231
+ fi
232
+
233
+ echo $output
234
+ [ "${lines[0]}" = "true" ]
235
+ }
236
+
237
+
238
+ @test "invoking xspec.sh with path containing an apostrophe runs successfully #119" {
239
+ mkdir some\'path
240
+ cp ../tutorial/escape-for-regex.* some\'path
241
+ run ../bin/xspec.sh some\'path/escape-for-regex.xspec
242
+ echo $output
243
+ [ "$status" -eq 0 ]
244
+ [ "${lines[19]}" = "Report available at some'path/xspec/escape-for-regex-result.html" ]
245
+ rm -rf some\'path
246
+ }
247
+
248
+
249
+ @test "invoking xspec.sh with saxon script uses the saxon script #121 #122" {
250
+ echo "echo 'Saxon script with EXPath Packaging System'" > /tmp/saxon
251
+ chmod +x /tmp/saxon
252
+ export PATH=$PATH:/tmp
253
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
254
+ echo $output
255
+ [ "$status" -eq 0 ]
256
+ [ "${lines[0]}" = "Saxon script found, use it." ]
257
+ rm /tmp/saxon
258
+ }
259
+
260
+
261
+ @test "Schematron phase/parameters are passed to Schematron compile" {
262
+ run ../bin/xspec.sh -s ../test/schematron-param-001.xspec
263
+ echo "${lines[2]}"
264
+ [ "$status" -eq 0 ]
265
+ [ "${lines[2]}" == "Parameters: phase=P1 ?selected=codepoints-to-string((80,49))" ]
266
+ }
267
+
268
+ @test "invoking xspec with Schematron XSLTs provided externally uses provided XSLTs for Schematron compile" {
269
+
270
+ export SCHEMATRON_XSLT_INCLUDE=schematron/schematron-xslt-include.xsl
271
+ export SCHEMATRON_XSLT_EXPAND=schematron/schematron-xslt-expand.xsl
272
+ export SCHEMATRON_XSLT_COMPILE=schematron/schematron-xslt-compile.xsl
273
+
274
+ run ../bin/xspec.sh -s ../tutorial/schematron/demo-01.xspec
275
+ echo $output
276
+ [ "${lines[4]}" = "Schematron XSLT include" ]
277
+ [ "${lines[5]}" = "Schematron XSLT expand" ]
278
+ [ "${lines[6]}" = "Schematron XSLT compile" ]
279
+ }
280
+
281
+
282
+ @test "invoking xspec.sh with the -s option does not display Schematron warnings #129 #131" {
283
+ run ../bin/xspec.sh -s ../tutorial/schematron/demo-01.xspec
284
+ echo "${lines[4]}"
285
+ echo $output
286
+ [ "$status" -eq 0 ]
287
+ [ "${lines[4]}" == "Compiling the Schematron tests..." ]
288
+ }
289
+
290
+
291
+ @test "Cleanup removes temporary files" {
292
+ run ../bin/xspec.sh -s ../tutorial/schematron/demo-03.xspec
293
+ [ "$status" -eq 0 ]
294
+ [ ! -f "../tutorial/schematron/demo-03.xspec-compiled.xspec" ]
295
+ run ls ../tutorial/schematron/xspec
296
+ [ "${#lines[@]}" = "3" ]
297
+ [ "${lines[0]}" = "demo-03-result.html" ]
298
+ [ "${lines[1]}" = "demo-03-result.xml" ]
299
+ [ "${lines[2]}" = "demo-03.xsl" ]
300
+ }
301
+
302
+
303
+ @test "invoking xspec.sh with -q option runs XSpec test for XQuery" {
304
+ run ../bin/xspec.sh -q ../tutorial/xquery-tutorial.xspec
305
+ echo "${lines[5]}"
306
+ [ "$status" -eq 0 ]
307
+ [ "${lines[5]}" = "passed: 1 / pending: 0 / failed: 0 / total: 1" ]
308
+ }
309
+
310
+
311
+ @test "executing the XProc harness for BaseX generates a report" {
312
+
313
+ if [[ -z ${XMLCALABASH_CP} && -z ${BASEX_CP} ]]; then
314
+ skip "test for BaseX skipped as it requires XMLCalabash and a higher version of Saxon";
315
+ else
316
+ run java -Xmx1024m -cp ${XMLCALABASH_CP} com.xmlcalabash.drivers.Main -i source=../tutorial/xquery-tutorial.xspec -p xspec-home=file:${PWD}/../ -p basex-jar=${BASEX_CP} -o result=xspec/xquery-tutorial-result.html ../src/harnesses/basex/basex-standalone-xquery-harness.xproc
317
+ fi
318
+
319
+ echo $output
320
+ [[ "${output}" =~ "src/harnesses/harness-lib.xpl:267:45:passed: 1 / pending: 0 / failed: 0 / total: 1" ]]
321
+ }
322
+
323
+
324
+ @test "HTML report contains CSS inline and not as an external file #135" {
325
+ run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
326
+ grep '<style type="text/css">' ../tutorial/xspec/escape-for-regex-result.html
327
+ grep 'margin-right:' ../tutorial/xspec/escape-for-regex-result.html
328
+ }
329
+
330
+
331
+ @test "Ant for XSLT with default properties fails on test failure" {
332
+ run ant -buildfile ${PWD}/../build.xml -Dxspec.xml=${PWD}/../tutorial/escape-for-regex.xspec -lib ${SAXON_CP}
333
+ echo $output
334
+ [ "$status" -eq 1 ]
335
+ [[ "${output}" =~ "BUILD FAILED" ]]
336
+ }
337
+
338
+
339
+ @test "Ant for XSLT with xspec.fail=false continues on test failure" {
340
+ run ant -buildfile ${PWD}/../build.xml -Dxspec.xml=${PWD}/../tutorial/escape-for-regex.xspec -lib ${SAXON_CP} -Dxspec.fail=false
341
+ echo $output
342
+ [ "$status" -eq 0 ]
343
+ [[ "${output}" =~ "BUILD SUCCESSFUL" ]]
344
+ }
345
+
346
+
347
+ @test "Ant for XSLT with catalog resolves URI" {
348
+ run ant -buildfile ${PWD}/../build.xml -Dxspec.xml=${PWD}/catalog/xspec-160_xslt.xspec -lib ${SAXON_CP} -Dxspec.fail=false -Dcatalog=${PWD}/catalog/xspec-160_catalog.xml -lib ${XML_RESOLVER_CP}
349
+ echo $output
350
+ [ "$status" -eq 0 ]
351
+ [[ "${output}" =~ "BUILD SUCCESSFUL" ]]
352
+ }
353
+
354
+
355
+ @test "Ant for Schematron with minimum properties" {
356
+ run ant -buildfile ${PWD}/../build.xml -Dxspec.xml=${PWD}/../tutorial/schematron/demo-02-PhaseA.xspec -lib ${SAXON_CP} -Dtest.type=s
357
+ echo $output
358
+ [ "$status" -eq 0 ]
359
+ [[ "${output}" =~ "BUILD SUCCESSFUL" ]]
360
+
361
+ # Verify default clean.output.dir is false
362
+ [ -d "../tutorial/schematron/xspec/" ]
363
+ [ -f "../tutorial/schematron/demo-02-PhaseA.xspec-compiled.xspec" ]
364
+ [ -f "../tutorial/schematron/demo-02.sch-compiled.xsl" ]
365
+
366
+ # Delete temp file
367
+ rm -f "../tutorial/schematron/demo-02-PhaseA.xspec-compiled.xspec"
368
+ rm -f "../tutorial/schematron/demo-02.sch-compiled.xsl"
369
+ }
370
+
371
+
372
+ @test "Ant for Schematron with various properties except catalog" {
373
+ # Remove a temp dir created by setup
374
+ rm -r ../tutorial/schematron/xspec
375
+
376
+ # For testing -Dxspec.project.dir
377
+ cp ../build.xml /tmp/
378
+
379
+ run ant -buildfile /tmp/build.xml -Dxspec.xml=${PWD}/../tutorial/schematron/demo-03.xspec -lib ${SAXON_CP} -Dtest.type=s -Dxspec.project.dir=${PWD}/.. -Dxspec.phase=#ALL -Dxspec.dir=${PWD}/xspec-temp -Dclean.output.dir=true
380
+ echo $output
381
+ [ "$status" -eq 0 ]
382
+ [[ "${output}" =~ "BUILD SUCCESSFUL" ]]
383
+
384
+ # Verify that -Dxspec-dir was honered and the default dir was not created
385
+ [ ! -d "../tutorial/schematron/xspec/" ]
386
+
387
+ # Verify clean.output.dir=true
388
+ [ ! -d "xspec-temp/" ]
389
+ [ ! -f "../tutorial/schematron/demo-03.xspec-compiled.xspec" ]
390
+ [ ! -f "../tutorial/schematron/demo-03.sch-compiled.xsl" ]
391
+
392
+ rm /tmp/build.xml
393
+ }
394
+
395
+
396
+ @test "Ant for Schematron with catalog and default xspec.fail fails on test failure" {
397
+ run ant -buildfile ${PWD}/../build.xml -Dxspec.xml=${PWD}/catalog/xspec-160_schematron.xspec -lib ${SAXON_CP} -Dtest.type=s -Dxspec.phase=#ALL -Dclean.output.dir=true -Dcatalog=${PWD}/catalog/xspec-160_catalog.xml -lib ${XML_RESOLVER_CP}
398
+ echo $output
399
+ [ "$status" -eq 1 ]
400
+ [[ "${output}" =~ "BUILD FAILED" ]]
401
+
402
+ # Verify the build fails before cleanup
403
+ [ -d "catalog/xspec/" ]
404
+
405
+ # Verify the build fails after Schematron setup
406
+ [ -f "catalog/xspec-160_schematron.xspec-compiled.xspec" ]
407
+ [ -f "../tutorial/schematron/demo-04.sch-compiled.xsl" ]
408
+
409
+ # Delete temp file
410
+ rm -f "catalog/xspec-160_schematron.xspec-compiled.xspec"
411
+ rm -f "../tutorial/schematron/demo-04.sch-compiled.xsl"
412
+ }
413
+
414
+
415
+ @test "Ant for Schematron with catalog and xspec.fail=false continues on test failure" {
416
+ run ant -buildfile ${PWD}/../build.xml -Dxspec.xml=${PWD}/catalog/xspec-160_schematron.xspec -lib ${SAXON_CP} -Dtest.type=s -Dxspec.phase=#ALL -Dclean.output.dir=true -Dcatalog=${PWD}/catalog/xspec-160_catalog.xml -lib ${XML_RESOLVER_CP} -Dxspec.fail=false
417
+ echo $output
418
+ [ "$status" -eq 0 ]
419
+ [[ "${output}" =~ "BUILD SUCCESSFUL" ]]
420
+ }