Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init

  • Loading branch information...
commit 1a5924718e9061b6f5c1bce9cbfa4d73560a99d0 0 parents
bill shelton authored
Showing with 21,310 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +1 −0  HEAD
  3. +21 −0 MIT-License.txt
  4. +65 −0 PluginDemoTests/CompareDialogTest.cfc
  5. +18 −0 PluginDemoTests/ComplexExceptionTypeErrorTest.cfc
  6. +41 −0 PluginDemoTests/DoubleMethodTest.cfc
  7. +9 −0 PluginDemoTests/EmptyTest.cfc
  8. +9 −0 PluginDemoTests/ExpectedExceptionTest.cfc
  9. +8 −0 PluginDemoTests/FiveSecondTest.cfc
  10. +132 −0 PluginDemoTests/HodgePodgeTest.cfc
  11. +13 −0 PluginDemoTests/InvalidMarkupTest.cfc
  12. +34 −0 PluginDemoTests/PrivateMethodTest.cfc
  13. +43 −0 PluginDemoTests/README.txt
  14. +9 −0 PluginDemoTests/SingleFailureTest.cfc
  15. +21 −0 PluginDemoTests/SingleMethodTest.cfc
  16. +23 −0 PluginDemoTests/SomeObject.cfc
  17. +19 −0 PluginDemoTests/SubDir/AnotherSubDir/AnotherTest.cfc
  18. +19 −0 PluginDemoTests/SubDir/AnotherSubDir/SomeOtherTest.cfc
  19. +6 −0 PluginDemoTests/SubDir/AnotherSubDir/TestSomething.cfc
  20. +26 −0 PluginDemoTests/SubDir/CFUnitStyleTest.cfc
  21. +14 −0 PluginDemoTests/ThrowsAnErrorTest.cfc
  22. +37 −0 PluginDemoTests/build.xml
  23. +11 −0 PluginDemoTests/inheritance/BaseTest.cfc
  24. +11 −0 PluginDemoTests/inheritance/SomeDoublyExtendingTest.cfc
  25. +7 −0 PluginDemoTests/inheritance/SomeExtendingTest.cfc
  26. +34 −0 PluginDemoTests/run.cfm
  27. +5 −0 README
  28. +56 −0 ant/README.txt
  29. BIN  ant/lib/mxunit-ant-java5.jar
  30. BIN  ant/lib/mxunit-ant.jar
  31. +418 −0 ant/mxunit-ant-doc.html
  32. +104 −0 ant/sample-build.xml
  33. +20 −0 ant/stylesheets/antmanual.css
  34. +53 −0 ant/stylesheets/style.css
  35. +875 −0 ant/xsl/junit-frames.xsl
  36. +464 −0 ant/xsl/junit-noframes.xsl
  37. +564 −0 build.xml
  38. +4 −0 buildprops/antrunner_sample.properties
  39. +6 −0 buildprops/statsvn.properties
  40. +11 −0 buildprops/testresultsmail.html
  41. +8 −0 buildprops/unames_example.properties
  42. +8 −0 buildprops/version.properties
  43. +110 −0 cfeclipse/copy.xml
  44. +132 −0 cfeclipse/copysnippets.xml
  45. +424 −0 cfeclipse/dictionary/mxunit.xml
  46. +13 −0 cfeclipse/dictionary/readme.txt
  47. +31 −0 cfeclipse/snippets/keyCombos.properties
  48. +48 −0 cfeclipse/snippets/mxunit/ant/mxunitAntTaskExample.xml
  49. +7 −0 cfeclipse/snippets/mxunit/assert/addAssertDecorator.xml
  50. +7 −0 cfeclipse/snippets/mxunit/assert/assertEquals.xml
  51. +7 −0 cfeclipse/snippets/mxunit/assert/assertFalse.xml
  52. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsArray.xml
  53. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsDefined.xml
  54. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsEmpty.xml
  55. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsQuery.xml
  56. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsStruct.xml
  57. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsTypeOf.xml
  58. +7 −0 cfeclipse/snippets/mxunit/assert/assertIsXMLDoc.xml
  59. +7 −0 cfeclipse/snippets/mxunit/assert/assertNotEquals.xml
  60. +7 −0 cfeclipse/snippets/mxunit/assert/assertNotSame.xml
  61. +7 −0 cfeclipse/snippets/mxunit/assert/assertSame.xml
  62. +7 −0 cfeclipse/snippets/mxunit/assert/assertTrue.xml
  63. +7 −0 cfeclipse/snippets/mxunit/assert/fail.xml
  64. +18 −0 cfeclipse/snippets/mxunit/assert/try catch error path.xml
  65. +7 −0 cfeclipse/snippets/mxunit/helpers/debug.xml
  66. +7 −0 cfeclipse/snippets/mxunit/helpers/injectMethod.xml
  67. +7 −0 cfeclipse/snippets/mxunit/helpers/injectProperty.xml
  68. +7 −0 cfeclipse/snippets/mxunit/helpers/makepublic.xml
  69. +17 −0 cfeclipse/snippets/mxunit/helpers/querysim.xml
  70. +10 −0 cfeclipse/snippets/mxunit/helpers/test-time override function.xml
  71. +28 −0 cfeclipse/snippets/mxunit/new MXUnit TestCase.xml
  72. +10 −0 cfeclipse/snippets/mxunit/new test error path function.xml
  73. +11 −0 cfeclipse/snippets/mxunit/new test function.xml
  74. +9 −0 cfeclipse/snippets/mxunit/setUp.xml
  75. +9 −0 cfeclipse/snippets/mxunit/tearDown.xml
  76. +23 −0 cfeclipse/snippets/mxunit/testrunner/Directory Test Suite Skeleton.xml
  77. +43 −0 cfeclipse/snippets/mxunit/testrunner/Simple Scheduled Test Run Template.xml
  78. +10 −0 cfeclipse/snippets/readme.txt
  79. +4 −0 config
  80. +1 −0  description
  81. +157 −0 doc/api/Application.cfm
  82. +270 −0 doc/api/components/CFCParser.cfc
  83. +151 −0 doc/api/components/FileSystemObject.cfc
  84. +352 −0 doc/api/components/Util.cfc
  85. +67 −0 doc/api/config/config.xml
  86. +489 −0 doc/api/css/style.css
  87. BIN  doc/api/images/blank.gif
  88. BIN  doc/api/images/cfcdoclogo.jpg
  89. BIN  doc/api/images/close.jpg
  90. BIN  doc/api/images/detailHeaderRule.jpg
  91. BIN  doc/api/images/detailSectionHeader.jpg
  92. BIN  doc/api/images/exclamation.jpg
  93. BIN  doc/api/images/information.jpg
  94. BIN  doc/api/images/inherit.jpg
  95. BIN  doc/api/images/inheritedSummary.gif
  96. BIN  doc/api/images/lightbulb.jpg
  97. BIN  doc/api/images/link_break.jpg
  98. BIN  doc/api/images/open.jpg
  99. BIN  doc/api/images/resultset_next.png
  100. BIN  doc/api/images/titleTableBottom.jpg
  101. BIN  doc/api/images/titleTableMiddle.jpg
  102. BIN  doc/api/images/titleTableTop.jpg
  103. +20 −0 doc/api/index.cfm
  104. +53 −0 doc/api/js/cfcdoc.js
  105. +3 −0  doc/api/js/mootools.js
  106. +89 −0 doc/api/license.txt
  107. +4 −0 doc/api/mxunit-home.cfm
  108. BIN  doc/api/mxunit_class.jpg
  109. +79 −0 doc/api/readme.cfm
  110. +9 −0 doc/api/templates/blank.htm
  111. +58 −0 doc/api/templates/components.cfm
  112. +39 −0 doc/api/templates/content.cfm
  113. +16 −0 doc/api/templates/default.cfm
  114. +528 −0 doc/api/templates/doctemplate.cfm
  115. +14 −0 doc/api/templates/leftbar.cfm
  116. +92 −0 doc/api/templates/nativetypes.cfm
  117. +86 −0 doc/api/templates/package-detail.cfm
  118. +68 −0 doc/api/templates/packages.cfm
  119. +44 −0 doc/api/templates/titleBar.cfm
  120. +22 −0 doc/api/templates/unknowncomponent.cfm
  121. +2 −0  experimental_ant/copydictionary.properties
  122. +72 −0 experimental_ant/copydictionary.xml
  123. +113 −0 experimental_ant/refactor.xml
  124. +404 −0 framework/Assert.cfc
  125. +63 −0 framework/CSVUtility.cfc
  126. +71 −0 framework/ComponentBlender.cfc
  127. +163 −0 framework/ComponentUtils.cfc
  128. +67 −0 framework/ConfigManager.cfc
  129. +304 −0 framework/DataproviderHandler.cfc
  130. +54 −0 framework/Formatters.cfc
  131. +34 −0 framework/HamcrestAssert.cfc
  132. +82 −0 framework/HamcrestMatcher.cfc
  133. +151 −0 framework/HtmlTestResult.cfc
  134. +124 −0 framework/JUnitXMLTestResult.cfc
  135. +223 −0 framework/JavaLoader.cfc
  136. +354 −0 framework/JavaProxy.cfc
  137. +123 −0 framework/MXUnitAssertionExtensions.cfc
  138. +64 −0 framework/MockFactoryFactory.cfc
  139. +1,957 −0 framework/POIUtility.cfc
  140. +129 −0 framework/PublicProxyMaker.cfc
  141. +37 −0 framework/QueryTestResult.cfc
  142. +178 −0 framework/RemoteFacade.cfc
  143. +104 −0 framework/RemoteFacadeObjectCache.cfc
  144. +17 −0 framework/Test.cfc
  145. +427 −0 framework/TestCase.cfc
  146. +373 −0 framework/TestResult.cfc
  147. +366 −0 framework/TestSuite.cfc
  148. +143 −0 framework/TextTestResult.cfc
  149. +23 −0 framework/VersionReader.cfc
  150. +372 −0 framework/XMLTestResult.cfc
  151. +97 −0 framework/XPathAssert.cfc
  152. +49 −0 framework/ext/AssertionExtensionTemplate.cfc
  153. +223 −0 framework/javaloader/JavaLoader.cfc
  154. +354 −0 framework/javaloader/JavaProxy.cfc
  155. +63 −0 framework/javaloader/example/example.cfm
  156. BIN  framework/javaloader/example/helloworld.jar
  157. +213 −0 framework/javaloader/example/licence.txt
  158. +69 −0 framework/javaloader/example/readme.txt
  159. BIN  framework/javaloader/lib/classloader-20070406174551.jar
  160. BIN  framework/javaloader/lib/classloader-src.zip
  161. BIN  framework/lib/tagsoup-1.2.jar
  162. BIN  framework/lib/xom-1.1.jar
  163. +100 −0 framework/mail.cfc
  164. +1 −0  framework/mightymock/AbstractMock.cfc
  165. +128 −0 framework/mightymock/ArgumentMatcher.cfc
  166. +415 −0 framework/mightymock/MightyMock.cfc
  167. +32 −0 framework/mightymock/MightyMockFactory.cfc
  168. +58 −0 framework/mightymock/MockDebug.cfc
  169. +25 −0 framework/mightymock/MockFactory.cfc
  170. +11 −0 framework/mightymock/MockLogger.cfc
  171. +277 −0 framework/mightymock/MockRegistry.cfc
  172. +159 −0 framework/mightymock/OrderedExpectation.cfc
  173. +149 −0 framework/mightymock/Verifier.cfc
  174. +48 −0 framework/mightymock/todo
  175. +105 −0 framework/mxunit-config.xml
  176. +98 −0 generator/Application.cfm
  177. BIN  generator/MXUnit_Parameter_Types_for_Automatic_Test_Generation.doc
  178. +146 −0 generator/generate.cfm
  179. +17 −0 generator/generator.js
  180. +167 −0 generator/index.cfm
  181. +162 −0 generator/lib_cfscript.cfm
  182. +126 −0 generator/listFiles.cfm
  183. +72 −0 generator/main.css
  184. BIN  generator/no-bugs.gif
  185. +40 −0 generator/templates/FailNew.xslt
  186. +40 −0 generator/templates/FailNewTagStyle.xslt
  187. +40 −0 generator/templates/SucceedNew.xslt
  188. +15 −0 hooks/applypatch-msg.sample
  189. +24 −0 hooks/commit-msg.sample
  190. +8 −0 hooks/post-commit.sample
  191. +15 −0 hooks/post-receive.sample
  192. +8 −0 hooks/post-update.sample
  193. +14 −0 hooks/pre-applypatch.sample
  194. +18 −0 hooks/pre-commit.sample
  195. +169 −0 hooks/pre-rebase.sample
  196. +36 −0 hooks/prepare-commit-msg.sample
  197. +118 −0 hooks/update.sample
  198. BIN  images/MXUnit-Small.png
  199. BIN  images/copyleft.png
  200. +116 −0 index.cfm
  201. +6 −0 info/exclude
  202. BIN  lib/activation.jar
  203. BIN  lib/ant-contrib-1.0b3.jar
  204. BIN  lib/ant-googlecode.jar
  205. BIN  lib/commons-net-1.4.1.jar
  206. BIN  lib/jakarta-oro-2.0.8.jar
  207. BIN  lib/mail.jar
  208. BIN  lib/statsvn-0.5.0.jar
  209. BIN  lib/svnClientAdapter.jar
  210. BIN  lib/svnant.jar
  211. BIN  lib/svnjavahl.jar
  212. BIN  lib/svnkit.jar
  213. BIN  lib/varscoper.jar
  214. +36 −0 mxunit-TestCase-Template.cfc
  215. +19 −0 mxunit-TestSuiteTemplate.cfm
  216. +66 −0 resources/ExtStart.css
  217. +2 −0  resources/jquery/jqgrid/css/ui.jqgrid.css
  218. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-bg.js
  219. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-bg1251.js
  220. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-cat.js
  221. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-cn.js
  222. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-cs.js
  223. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-de.js
  224. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-dk.js
  225. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-el.js
  226. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-en.js
  227. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-fa.js
  228. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-fi.js
  229. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-fr.js
  230. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-he.js
  231. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-is.js
  232. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-it.js
  233. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-jp.js
  234. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-nl.js
  235. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-no.js
  236. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-pl.js
  237. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-pt-br.js
  238. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-pt.js
  239. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-ro.js
  240. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-ru.js
  241. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-sp.js
  242. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-sv.js
  243. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-tr.js
  244. +1 −0  resources/jquery/jqgrid/js/i18n/grid.locale-ua.js
  245. +118 −0 resources/jquery/jqgrid/js/jquery.jqgrid.min.js
  246. +75 −0 resources/jquery/jquery.runner.js
  247. BIN  resources/jquery/tablesorter/blue/asc.gif
  248. BIN  resources/jquery/tablesorter/blue/bg.gif
  249. BIN  resources/jquery/tablesorter/blue/blue.zip
  250. BIN  resources/jquery/tablesorter/blue/desc.gif
  251. +34 −0 resources/jquery/tablesorter/blue/style.css
  252. +852 −0 resources/jquery/tablesorter/jquery.tablesorter.js
  253. +2 −0  resources/jquery/vtip/css/vtip.css
  254. +30 −0 resources/jquery/vtip/example.html
  255. BIN  resources/jquery/vtip/images/vtip_arrow.png
  256. +5 −0 resources/jquery/vtip/vtip-min.js
  257. +491 −0 resources/theme/960.css
  258. +28 −0 resources/theme/footer.cfm
  259. +54 −0 resources/theme/header.cfm
  260. +48 −0 resources/theme/results.css
  261. +115 −0 resources/theme/styles.css
  262. +179 −0 runner/DirectoryTestSuite.cfc
  263. +32 −0 runner/HtmlRunner.cfc
  264. +92 −0 runner/HttpAntRunner.cfc
  265. +65 −0 runner/RunnerUtils.cfc
  266. +51 −0 runner/index.cfm
  267. +32 −0 runner/runner.js
  268. +36 −0 samples/DirectoryTestSuiteSample.cfm
  269. +20 −0 samples/MyComponent.cfc
  270. +51 −0 samples/MyComponentTest.cfc
  271. +65 −0 samples/MyOtherComponentTest.cfc
  272. +27 −0 samples/MyTestSuite.cfm
  273. +29 −0 samples/PluginSimulator.cfm
  274. +44 −0 samples/RemoteFacadeTester.cfm
  275. +42 −0 samples/ScheduledRun.cfm
  276. +22 −0 samples/SimpleRunSkeleton.cfm
  277. +16 −0 samples/TestCaseSkeleton.cfc
  278. +44 −0 samples/ant_JUnitReportSample.xml
  279. +33 −0 samples/mocking/TheCollaborator.cfc
  280. +34 −0 samples/mocking/TheComponent.cfc
  281. +55 −0 samples/mocking/TheMockTest.cfc
  282. +50 −0 samples/mocking/TheStubTest.cfc
  283. +88 −0 samples/mocking/querysim.cfm
  284. +33 −0 samples/samples.cfm
  285. +31 −0 samples/tests/MyComponentTest.cfc
  286. +37 −0 samples/tests/TestCaseSkeletonTest.cfc
  287. +15 −0 samples/tests/myTestSuite.cfm
  288. +25 −0 tests/ant/build.xml
  289. +30 −0 tests/ant/commitSvnTest.xml
  290. +29 −0 tests/ant/mxunit-test.log
  291. +46 −0 tests/ant/svnUpdateTest.xml
  292. +19 −0 tests/bugs/105.cfc
  293. +16 −0 tests/bugs/105ExtendedTest.cfc
  294. +29 −0 tests/bugs/149Test.cfc
  295. +67 −0 tests/bugs/80.cfc
  296. +11 −0 tests/bugs/90.cfc
  297. +24 −0 tests/bugs/93.cfc
  298. +43 −0 tests/bugs/Bug115.cfc
  299. +50 −0 tests/bugs/ExpectedExceptionBug147Test.cfc
  300. +46 −0 tests/bugs/bug126.cfc
Sorry, we could not display the entire diff because too many files (411) changed.
4 .gitignore
@@ -0,0 +1,4 @@
+.project
+MXUnitInstallTest.cfc
+*.svn
+**/.svn
1  HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master
21 MIT-License.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2010 MXUnit.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
65 PluginDemoTests/CompareDialogTest.cfc
@@ -0,0 +1,65 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+
+ </cffunction>
+
+ <cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test">
+
+ </cffunction>
+
+ <cffunction name="simpleCompareDifferences">
+ <cfset assertEquals("aaaaaaa b aaaaaa","aaaaaaa d aaaaaa")>
+ </cffunction>
+
+ <cffunction name="queryCompareDifferences">
+ <cfset var s = makeQueries()>
+ <cfset assertEquals(s.one,s.two)>
+ </cffunction>
+
+ <cffunction name="structCompareDifferences">
+ <cfset var s = makeStructures()>
+ <cfset assertEquals(s.one,s.two)>
+ </cffunction>
+
+
+ <cffunction name="makeQueries" access="private">
+ <cfset var q = "">
+ <cfset var q2 = "">
+ <cfset var s = structnew()>
+ <cfoutput>
+ <cf_querysim>
+ q
+ one,two,three,four
+ 1|2|3|4
+ 11|22|33|44
+ </cf_querysim>
+ <cf_querysim>
+ q2
+ one,two,three,four
+ 1|2|3.1|4
+ 11|22|33|4.4
+ </cf_querysim>
+ </cfoutput>
+ <cfset s.one = q>
+ <cfset s.two = q2>
+ <cfreturn s>
+ </cffunction>
+
+ <cffunction name="makeStructures" access="private">
+ <cfset var s = StructNew()>
+ <cfset var s2 = StructNew()>
+ <cfset var combo = StructNew()>
+ <cfset s.one = "one">
+ <cfset s.two = StructNew()>
+ <cfset s2 = duplicate(s)>
+ <cfset s2.one = "ona">
+ <cfset combo.one = s>
+ <cfset combo.two = s2>
+ <cfreturn combo>
+ </cffunction>
+
+
+
+</cfcomponent>
18 PluginDemoTests/ComplexExceptionTypeErrorTest.cfc
@@ -0,0 +1,18 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+
+ </cffunction>
+
+ <cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test">
+
+ </cffunction>
+
+ <cffunction name="willThrowFunkyNonArrayException" returntype="void" access="public">
+ <!--- hit "b" key in eclipse to see the cfcatch dump. funky, huh?--->
+ <cfset s = structnew()>
+ <cfset arrayAppend(s,"one")>
+ </cffunction>
+
+</cfcomponent>
41 PluginDemoTests/DoubleMethodTest.cfc
@@ -0,0 +1,41 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+ <cfset blah = "hi mom">
+ <cffunction name="setUp" output="false" access="public" returntype="void" hint="">
+
+
+ </cffunction>
+
+ <cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="testOne" access="public" returntype="void" hint="">
+ <cfset var scopes = getpagecontext().getCFScopes()>
+
+ <cfdump var="#scopes#">
+ <cfset assertTrue(true,"true")>
+ </cffunction>
+ <cffunction name="testTwo" returntype="void" hint="">
+ <cfset var q = QueryNew("one,two")>
+ <cfset debug("#StructNew()#")>
+ <cfset assertTrue(true,"true")>
+ <cfoutput>#blah#</cfoutput>
+ <cfset assertTrue(true,"true")>
+ <cfoutput>doublemethodtest </cfoutput>
+ <cfdump var="#structnew()#">
+
+ <cfset QueryAddRow(q)>
+ <cfset QuerySetCell(q,"one","one")>
+ <cfset QuerySetCell(q,"two","two")>
+ <cfdump var="#q#">
+ </cffunction>
+
+
+ <cffunction name="testPrivate" output="false" access="private" returntype="any" hint="">
+
+ </cffunction>
+
+ <cffunction name="testPackage" output="false" access="package" returntype="any" hint="">
+
+ </cffunction>
+</cfcomponent>
9 PluginDemoTests/EmptyTest.cfc
@@ -0,0 +1,9 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+ <cffunction name="setUp" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+</cfcomponent>
9 PluginDemoTests/ExpectedExceptionTest.cfc
@@ -0,0 +1,9 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+
+ <cffunction name="thisShouldFail_BecauseExpectedExceptionIsNotThrown" returntype="void" mxunit:expectedexception="Database">
+ <cfthrow type="MyCustomException" message="hi mom!">
+ </cffunction>
+
+
+</cfcomponent>
8 PluginDemoTests/FiveSecondTest.cfc
@@ -0,0 +1,8 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="testThatWillTake5Seconds">
+ <cfset var obj = createObject("java","java.lang.Thread")>
+ <cfset obj.sleep(5000)>
+ </cffunction>
+
+</cfcomponent>
132 PluginDemoTests/HodgePodgeTest.cfc
@@ -0,0 +1,132 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+ <cfset MyStruct = StructNew()>
+ <cfset MyStruct.SomeData = "blahhhhhhh wahahahaha">
+
+
+ <cffunction name="setUp" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
+ <!--- to be safe, since i know i'm monkeying with abandon up in this mofo --->
+ <cfset setTestStyle("default")>
+ </cffunction>
+
+
+ <cffunction name="testOK">
+ <cfset var q = QueryNew("one,two")>
+ <cfset assertTrue(true,"true")>
+ <cfoutput>Hi mommmmm is< valid? what about & </cfoutput>
+ <cfdump var="#MyStruct#">
+ <cfset QueryAddRow(q)>
+ <cfset QuerySetCell(q,"one","one")>
+ <cfset QuerySetCell(q,"two","two")>
+ <cfdump var="#q#">
+ <cfset addTrace("Hi mom")>
+
+ </cffunction>
+
+ <cffunction name="testDoSomething">
+ <cfset debug("inside testDoSomething")>
+ <cfset obj = createObject("component","SomeObject")>
+ <cfset obj.doSomething()>
+ </cffunction>
+
+ <cffunction name="testRequestDotDebug">
+ <cfset obj = createObject("component","SomeObject")>
+ <cfset debug("before the object calls request.debug")>
+ <cfset obj.thisWillOnlyWorkInThePlugin()>
+ <cfset debug("after a function that called request.debug")>
+ </cffunction>
+
+ <cffunction name="testRequestDotDebug_WillShowUpWithoutDebugBeingCalledFirst">
+ <cfset obj = createObject("component","SomeObject")>
+ <cfset obj.thisWillOnlyWorkInThePlugin()>
+ </cffunction>
+
+ <cffunction name="testRequestDotDebug_WillPassInBothPluginAndWeb">
+ <cfset createRequestScopeDebug()>
+ <cfset obj = createObject("component","SomeObject")>
+ <cfset debug("before the object calls request.debug")>
+ <cfset obj.thisWillOnlyWorkInThePlugin()><!--- only work in plugin.... unless we explictly enable it in the test!!! --->
+ <cfset debug("after a function that called request.debug")>
+ <cfset stopRequestScopeDebug()>
+ </cffunction>
+
+ <cffunction name="testDoSomethingThenExitToGetDump">
+ <cfset obj = createObject("component","SomeObject")>
+ <cfset obj.doSomethingThenExitToGetDump()>
+ </cffunction>
+
+
+
+ <cffunction name="testFail" returntype="void" hint="">
+ <cfoutput>wooopity doo!</cfoutput>
+ <cfset debug("blah")>
+ <cfset fail("failing intentionally")>
+ </cffunction>
+
+ <cffunction name="testNotEquals" returntype="void">
+ <cfset assertEquals("#repeatString('hey nonny ',10)#", "#repeatString('hey ninny ',10)#")>
+ </cffunction>
+
+ <cffunction name="testError" returntype="void" hint="">
+ <cfset debug(arraynew(1))>
+ <cfset debug("throwing error from inside testError before i throw intentionally")>
+ <cfthrow message="throwing error intentially">
+ </cffunction>
+
+ <cffunction name="throwErrorFromComponentNotInWorkspace" output="false" access="public" returntype="any" hint="calls a component that isn't in the cfeclipse workspace">
+ <cfset var sc = createObject("component","SomeComponent")>
+ <cfset sc.saySomething()>
+ <cfset sc.throwAnError()>
+ </cffunction>
+
+ <cffunction name="testAnotherError" returntype="void" hint="">
+ <cfinvoke component="mxunit.framework.Formatters" method="toStructs" xml="invalidxml" returnvariable="nothin">
+ </cffunction>
+
+ <cffunction name="testWithDebug">
+ <cfset debug(StructNew())>
+ <cfset debug(arraynew(1))>
+ <cfdump var="#getDebug()#">
+ </cffunction>
+
+ <cffunction name="testPrivate" output="false" access="private">
+ <cfthrow message="this is private and should never run">
+ </cffunction>
+
+ <cffunction name="testPackage" output="false" access="package">
+ <cfthrow message="this is package and should never run">
+ </cffunction>
+
+ <cffunction name="testAssertTrueFailing" output="false" access="public" returntype="any" hint="">
+ <cfset assertTrue(1 eq 2,"this should fail because one equals two is not true")>
+ </cffunction>
+
+ <cffunction name="testAssertTrueFailingWithoutMessage" output="false" access="public" returntype="any" hint="">
+ <cfset assertTrue(1 eq 2)>
+ </cffunction>
+
+ <cffunction name="testAssertTrueOK">
+ <cfset assertTrue(1 eq 1,"")>
+ </cffunction>
+
+ <cffunction name="testAssertTrueCFCUnitStyle">
+ <cfset setTestStyle("default")>
+ <cfset assertTrue(1 eq 1,"OK")>
+ <cfset assertTrue(1 eq 1)>
+ </cffunction>
+
+ <cffunction name="testAssertTrueCFCUnitStyleFailure">
+ <cfset setTestStyle("default")>
+ <cfset assertTrue(1 eq 2,"1 does not equal 2")>
+ </cffunction>
+
+ <cffunction name="testAssertTrueCFUnitStyleFailure">
+ <cfset setTestSTyle("cfunit")>
+ <cfset assertTrue("false ain't true, sucka",false)>
+ </cffunction>
+
+
+</cfcomponent>
13 PluginDemoTests/InvalidMarkupTest.cfc
@@ -0,0 +1,13 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+ <cffunction name="setUp" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="invalid">
+ <cfset var x=
+ </cffunction>
+</cfcomponent>
34 PluginDemoTests/PrivateMethodTest.cfc
@@ -0,0 +1,34 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cfset this.objUnderTest = "">
+
+ <cffunction name="setUp">
+ <!--- we'll use this here object as a target, just for demonstration --->
+ <cfset this.objUnderTest = createObject("component","PrivateMethodTest")>
+ </cffunction>
+
+ <cffunction name="testPrivateDirectly">
+ <!--- this is gonna fail! --->
+ <cfset var result = this.objUnderTest.somePrivateMethod("blah") />
+ <cfset assertEquals("blah",result)>
+ </cffunction>
+
+ <cffunction name="testPrivateAndLookNoError">
+ <cfset var result = "" />
+ <cfset makePublic(this.objUnderTest,"somePrivateMethod","_YeeHaw")>
+ <cfset result = this.objUnderTest._YeeHaw("blah")>
+ <cfset assertEquals("blah",result)>
+
+ <!--- without the 3rd arg, it defaults to the method name --->
+ <cfset makePublic(this.objUnderTest,"somePrivateMethod")>
+ <cfset result = this.objUnderTest.somePrivateMethod("i love this stuff!")>
+ <cfset assertEquals("i love this stuff!",result)>
+ </cffunction>
+
+ <!--- pretend this is in some other object you're trying to test --->
+ <cffunction name="somePrivateMethod" access="private">
+ <cfargument name="arg1" type="string" required="false" default="">
+ <cfreturn arg1>
+ </cffunction>
+
+</cfcomponent>
43 PluginDemoTests/README.txt
@@ -0,0 +1,43 @@
+*************
+WHAT
+*************
+These tests are designed to showcase the mxunit plugin.
+Many of them fail or error in order to demonstrate that behavior.
+One of them, InvalidMarkupTest.cfc, is a bad file and as such
+will generate an eclipse Error prompt when you load the component.
+This is expected and designed to show you what happens when
+you try to run a test that contains invalid CFML.
+
+*************
+INSTALLING THE PLUGIN
+*************
+In Eclipse:
+
+1) Help -- Software Updates -- Find and Install
+2) Select the "Search for new features" radio button. Click Next
+3) click the "New Remote Site" button. Add the url "http://mxunit.org/update". give it any name.
+4) Click through. It'll download the plugin and install it. It will prompt you to restart eclipse.
+5) When eclipse is installed, the MXUnit view will be available in Window -- Show View -- Other -- MXUnit
+
+
+*************
+HOW TO RUN
+*************
+1) Open the MXUnit View
+2) Click the "Search" icon (or hit CTRL-F)
+3) type "PluginDemoTests". Click OK
+4) It'll take a few seconds to start up if this is the first time running the
+tests.
+ a) You'll then get an eclipse Error. This is expected,
+because InvalidMarkupTest.cfc is a bad file.
+ b) Click OK on the error message.
+ c) Each of the test cases in the entire directory of tests will load
+ into the tree. It does not run the tests.
+5) Click the green "Play" button (or hit Enter)
+6) The tests will run.
+7) To see any output from the tests, right click in the tree and select
+"Open test case results in browser". or hit "F8". or hit "b".
+8) To run all tests again, hit the green play arrow
+9) To run just the failures, hit the red play arrow
+10) To clear all results, click the "refresh" icon or hit "F5"
+
9 PluginDemoTests/SingleFailureTest.cfc
@@ -0,0 +1,9 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="testFail" returntype="void" hint="">
+ <cfoutput>wooopity doo!</cfoutput>
+ <cfset debug("blah")>
+ <cfset fail("failing intentionally")>
+ </cffunction>
+
+</cfcomponent>
21 PluginDemoTests/SingleMethodTest.cfc
@@ -0,0 +1,21 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+ <cffunction name="setUp" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="testOne" output="false" access="public" returntype="void" hint="">
+ <cfset assertTrue(true,"true")>
+ </cffunction>
+
+ <cffunction name="testPrivate" output="false" access="private" returntype="any" hint="">
+
+ </cffunction>
+
+ <cffunction name="testPackage" output="false" access="package" returntype="any" hint="">
+
+ </cffunction>
+</cfcomponent>
23 PluginDemoTests/SomeObject.cfc
@@ -0,0 +1,23 @@
+<cfcomponent>
+
+
+ <cffunction name="doSomething" output="true">
+ <cfdump var="#StructNew()#">
+
+ <cfthrow message="you ain't gonna see that struct">
+ </cffunction>
+
+ <cffunction name="doSomethingThenExitToGetDump" output="false">
+ <cfdump var="#StructNew()#">
+
+ <cfexit method="exittemplate">
+
+ <cfthrow message="you ain't gonna see that struct">
+ </cffunction>
+
+ <cffunction name="thisWillOnlyWorkInThePlugin">
+ <cfset request.debug("coming from SomeObject.cfc")>
+ <cfset request.debug("and some more!")>
+ </cffunction>
+
+</cfcomponent>
19 PluginDemoTests/SubDir/AnotherSubDir/AnotherTest.cfc
@@ -0,0 +1,19 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+
+ </cffunction>
+
+ <cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test">
+
+ </cffunction>
+
+ <cffunction name="testSomething" returntype="void" access="public">
+ <cfset assertTrue(true,"hi mom!")>
+
+ </cffunction>
+
+
+
+</cfcomponent>
19 PluginDemoTests/SubDir/AnotherSubDir/SomeOtherTest.cfc
@@ -0,0 +1,19 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+
+ </cffunction>
+
+ <cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test">
+
+ </cffunction>
+
+ <cffunction name="testSomething" returntype="void" access="public">
+ <cfset assertTrue(true,"hi mom!")>
+
+ </cffunction>
+
+
+
+</cfcomponent>
6 PluginDemoTests/SubDir/AnotherSubDir/TestSomething.cfc
@@ -0,0 +1,6 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="thisComponentShouldBeFoundBecauseItStartsWithTest">
+ <cfset assertEquals("Marc Is Cool","Marc is Cool")>
+ </cffunction>
+</cfcomponent>
26 PluginDemoTests/SubDir/CFUnitStyleTest.cfc
@@ -0,0 +1,26 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="setUp">
+ <cfset setTestStyle("cfunit")>
+
+ </cffunction>
+
+
+ <cffunction name="testAssertEquals">
+ <cfset assertEquals("my message goes here",1,1)>
+ </cffunction>
+
+ <cffunction name="testAssertEqualsFailure">
+ <cfset assertEquals("my message goes here",1,2)>
+ </cffunction>
+
+ <cffunction name="testAssertTrue">
+ <cfset assertTrue("my message goes here",true)>
+ </cffunction>
+
+ <cffunction name="testAssertTrueFailure">
+ <cfset assertTrue("my message goes here",false)>
+ </cffunction>
+
+
+</cfcomponent>
14 PluginDemoTests/ThrowsAnErrorTest.cfc
@@ -0,0 +1,14 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+ <cffunction name="setUp" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
+
+ </cffunction>
+
+ <cffunction name="testError" output="false" access="public" returntype="void" hint="">
+ <cfthrow message="This error is intentional">
+ </cffunction>
+
+</cfcomponent>
37 PluginDemoTests/build.xml
@@ -0,0 +1,37 @@
+<project name="PluginDemoTestAntRunner" default="runTests">
+
+
+ <target name="init">
+ <property name="antrunner.file" value="../buildprops/antrunner.properties" />
+ <path id="plugindemotests.classpath">
+ <fileset dir="../ant/lib">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+ <taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpathref="plugindemotests.classpath" />
+ </target>
+
+ <target name="runTests" depends="init">
+
+ <!-- load the current version of the package-summary file; this way, we can put it at the end of the email we send so that
+ comparing test the aggregate test results is easy; makes it simpler to see if any test failures crept in -->
+
+
+
+ <!-- get the server, port, and webroot properties from the antrunner file; this way
+ each developer can have their own version of the properties file with different
+ values depending on their setup -->
+ <property file="${antrunner.file}" />
+
+ <mxunittask server="${server}" port="${port}" defaultrunner="/mxunit/runner/HttpAntRunner.cfc" verbose="true" >
+
+ <!-- componentPath is not required, but it results in a much faster test run -->
+ <directory remoteMethod="run" path="${webroot}\mxunit\PluginDemoTests" packageName="mxunit.PluginDemoTests" componentPath="mxunit.PluginDemoTests" recurse="true" includes="*.cfc" excludes="FiveSecondTest" />
+
+ </mxunittask>
+
+
+ </target>
+
+
+</project>
11 PluginDemoTests/inheritance/BaseTest.cfc
@@ -0,0 +1,11 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="testSomethingSimple">
+ <cfset assertTrue(true)>
+ </cffunction>
+
+ <cffunction name="testSomethingThatWillFail">
+ <cfset fail("failing in BaseTest")>
+ </cffunction>
+
+</cfcomponent>
11 PluginDemoTests/inheritance/SomeDoublyExtendingTest.cfc
@@ -0,0 +1,11 @@
+<cfcomponent extends="SomeExtendingTest">
+
+ <cffunction name="testDoublysOwnThing">
+ <cfset assertTrue(true)>
+ </cffunction>
+
+ <cffunction name="testSomethingSimple">
+ <cfset fail("this is my custom test")>
+ </cffunction>
+
+</cfcomponent>
7 PluginDemoTests/inheritance/SomeExtendingTest.cfc
@@ -0,0 +1,7 @@
+<cfcomponent extends="BaseTest">
+
+ <cffunction name="TestMyOwnThing">
+ <cfset assertTrue(true)>
+ </cffunction>
+
+</cfcomponent>
34 PluginDemoTests/run.cfm
@@ -0,0 +1,34 @@
+<html>
+
+<head></head>
+<body>
+
+<cfsetting showdebugoutput="true">
+<cfsetting requesttimeout="300">
+<cfparam name="url.output" default="extjs">
+
+<cfset dir = expandPath(".")>
+
+<cfset DTS = createObject("component","mxunit.runner.DirectoryTestSuite")>
+
+<cfinvoke component="#DTS#"
+ method="run"
+ directory="#dir#"
+ componentpath="mxunit.PluginDemoTests"
+ recurse="true"
+ excludes="FiveSecondTest"
+ returnvariable="Results">
+
+<cfif NOT StructIsEmpty(DTS.getCatastrophicErrors())>
+ <cfdump var="#DTS.getCatastrophicErrors()#" expand="false" label="#StructCount(DTS.getCatastrophicErrors())# Catastrophic Errors">
+</cfif>
+
+<cfsetting showdebugoutput="true">
+<cfoutput>#results.getResultsOutput(url.output)#</cfoutput>
+
+<!---
+<cfdump var="#results.getResults()#">
+<cfdump var="#results.getDebug()#"> --->
+
+</body>
+</html>
5 README
@@ -0,0 +1,5 @@
+ MXUnit is a unit test framework for CFML.
+
+ Main website: http://mxunit.org
+
+
56 ant/README.txt
@@ -0,0 +1,56 @@
+01-25-08 Using Ant with MXUnit.
+
+Source is available here: http://mxunit.googlecode.com/svn/org.mxunit.ant/
+
+Overview:
+Used best for running groups of tests, test suites, and directories of
+tests. Writes test results in XML, JUnitXML, or HTML to a specified
+location. This is particularly useful for generating JUnit style
+reports, using Ant's <junitreport ...> task.
+
+This handles BASIC as well as NTML authentication as well as SSL.
+
+This assumes a basic knowledge of Ant.
+
+---------------------------- To Do --------------------------------
+You can also use this Ant task to invoke testcases and arbitrary cf
+components using the TCP/IP gateway in the CF server instead of the
+default HTTP GET method. This has significant performance benefits and
+does not use a CF http thread. However, there needs to be some minor
+gateway configuration performed on the CF server _and_ your CF server
+needs to support TCP/IP gateways. See the CF product comparison charts
+at adobe.com for information on which versions support gateways and to
+what extent.
+
+Dependencies: This assumes you have Ant installed. If not, please
+download the latest version from http://ant.apache.org/.
+
+The stylesheets in this package are the same as those in JUnit. Just a
+few slight modifications/branding were made.
+
+Usage: See sample-build.xml for usage.
+
+Examples:
+
+
+Enjoy ...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
BIN  ant/lib/mxunit-ant-java5.jar
Binary file not shown
BIN  ant/lib/mxunit-ant.jar
Binary file not shown
418 ant/mxunit-ant-doc.html
@@ -0,0 +1,418 @@
+<!--
+
+-->
+<html>
+
+<head>
+<meta http-equiv="Content-Language" content="en-us">
+<link rel="stylesheet" type="text/css" href="stylesheets/style.css">
+<title>MXUnitAntTask</title>
+</head>
+
+<body>
+
+<h2><a name="zip">MXUnitAntTask</a> - Version: 1.0.2</h2>
+<h3>Description</h3>
+<p>Runs MXUnit tests and saves the output to the directory specified by the <code>outputdir</code> parameter.</p>
+
+<p>This version uses HTTP to connect to the MXUnit test runner running on an
+Adobe ColdFusion server. Future plans may include the ability to run tests
+via the TCP/IP gateway in CF. Please let us know if this is something
+ you would like to see.
+</p>
+
+<p>
+ This version should also be able to handle Http authentications - BASIC, DIGEST, and NTLM.
+</p>
+
+
+<p>
+The default testrunner (/mxunit/runner/HttpAntRunner.cfc) accepts either individual test cases
+or directories of tests to run. This runner returns only JUnitReport formated XML. These XML files
+<em>may</em> optionally be used by the JUnitReport Ant task to generate nice HTML reports. Example usage:
+<xmp>
+ <junitreport todir="${junit.out.dir.html}">
+ <fileset dir="${output.dir}">
+ <include name="*.xml"/>
+ </fileset>
+ <report format="frames" todir="${junit.out.dir.html}" styledir="${style.dir}"/>
+ </junitreport>
+</xmp>
+</p>
+
+<p>
+Note that the mxunit-ant.jar must be in Ant's class path. This can be done by specifying
+the <code>taskdef</code> tag like this:<xmp><taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
+</xmp> and then coding the rest of the MXunit Ant task ...
+<xmp> <mxunittask server="localhost" port="8500"
+ defaultrunner="/mxunit/runner/HttpAntRunner.cfc"
+ outputdir="${output.dir}"
+ verbose="true"
+ haltonerror="true"> ... </xmp>
+
+</p>
+
+<p>
+In theory, one should be able to run multiple tests across multiple domains, as long as those tests
+are accessible via Http.
+</p>
+
+<h3>Parameters</h3>
+<table border="1" cellpadding="2" cellspacing="0" width="100%">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td valign="top" align="center"><b>Required</b></td>
+ <td valign="top" align="center"><b>Default</b></td>
+ </tr>
+ <tr>
+ <td valign="top">server</td>
+ <td valign="top">The Http server name where MXUnit is located.</td>
+ <td align="center" valign="top">Yes</td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td valign="top">port</td>
+ <td valign="top">The port the Http server is listening on.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">80</td>
+ </tr>
+ <tr>
+ <td valign="top">outputdir</td>
+ <td valign="top">A directory in which to save JUnit XML test results.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+ <tr>
+ <td valign="top">haltonerror</td>
+ <td valign="top">Instructs the task to stop executing when an <em>ERROR</em> is detected. <br />
+ This occurs <em>after</em> all the tests in the DIRECTORY or TESTCASE task have been run.
+
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">false</td>
+ </tr>
+ <tr>
+ <td valign="top">haltonfailure</td>
+ <td valign="top">Instructs the task to stop executing when a <em>FAILURE</em> is detected. <br />
+ This occurs <em>after</em> all the tests in the DIRECTORY or TESTCASE task have been run.
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">false</td>
+ </tr>
+ <tr>
+ <td valign="top">errorproperty</td>
+ <td valign="top">The name of a property to set in the event of an error.
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td valign="top">failureproperty</td>
+ <td valign="top"> The name of a property to set in the event of a failure (errors are considered failures as well).
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td valign="top">defaultrunner</td>
+ <td valign="top">
+ The testrunner responsible for accepting requests.
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="left">/mxunit/runner/HttpAntRunner.cfc</td>
+ </tr>
+ <tr>
+ <td valign="top">verbose</td>
+ <td valign="top">Flag to indicate to output additional information.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">false</td>
+ </tr>
+
+<tr>
+ <td valign="top">testResultsSummary</td>
+ <td valign="top">
+ Name of the properties file the task creates. This file is a Java
+ Properties file that records a summary of all the tests the task
+ has executed and is saved to the location specified in
+ the <code>${outputdir}</code> attribute.
+ This can be useful in automated deployments, for example,
+ if you wish inspect the results of all the tests run prior to deployment.
+ This offers a deeper level of granularity than the haltonerror or haltonfailure offers.
+ <br /><br />
+ The task generates the following properties that can be read by Ant using
+ the following syntax:<br />
+<xmp>
+<property file="${outputdir}/testresults.properties" />
+</xmp>
+testresults.properties looks something like:
+<pre>
+#Sat Mar 01 22:20:25 EST 2008
+success.ratio=.99
+total.failures=2
+failure.ratio=.01
+total.errors=0
+error.ratio=.00
+total.time=8016
+total.runs=151
+</pre>
+
+<code>error.ratio</code> is the number of errors to the total number of tests runs. <br />
+<code>failure.ratio</code> is the number of failures to the total number of tests runs. <br />
+<code>success.ratio</code> is the total number of tests run to the total number of errors and failures combined.<br />
+
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">testresults.properties</td>
+ </tr>
+
+</table>
+<h3>Parameters specified as nested elements </h3>
+
+<h3><code>directory</code></h3>
+<p><code>&lt;directory ... &gt;</code>s are used to specify groups of tests to run.</p>
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td valign="top" align="center"><b>Required</b></td>
+ <td valign="top" align="center"><b>Default</b></td>
+ </tr>
+ <tr>
+ <td valign="top">path</td>
+ <td valign="top">Directory of tests to run.
+ </td>
+ <td align="center" valign="top">Yes</td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+ <tr>
+ <td valign="top">componentPath</td>
+ <td valign="top">A prefix to the components being tested. This is a performance
+ attribute. If specified, directory tests will run faster. Otherwise, the framework
+ will discover the componentPath using built in Adobe ColdFusion functions.<br />
+ Example:
+ <code>componentPath="mxunit.tests.framework"</code>. <br />
+ MXUnit will correctly prepend this to all the
+ tests in the specified directory.
+ </td>
+ <td align="center" valign="top">No<br />
+ <strong>
+ Optionallity is deprecated. Future release will require this attribute to be
+ specified.
+ </strong>
+
+ </td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+ <tr>
+ <td valign="top">runner</td>
+ <td valign="top">The ColdFusion component runner responsible for running the tests,</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">/mxunit/runner/HttpAntRunner.cfc</td>
+ </tr>
+
+ <tr>
+ <td valign="top">remoteMethod</td>
+ <td valign="top">The remote method in the ColdFusion component that will be called.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center"><code>run</code></td>
+ </tr>
+
+ <tr>
+ <td valign="top">packageName</td>
+ <td valign="top">
+ The name used by the JUnitReport task to print the main and child packages in the
+ test result report.
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="left">mxunit.testresult</td>
+ </tr>
+ <tr>
+ <td valign="top">recurse</td>
+ <td valign="top">Flag to indicate to run all tests in sub directories.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">false</td>
+ </tr>
+
+ <tr>
+ <td valign="top">excludes</td>
+ <td valign="top">Comma-delimitted list of files not to include in the test suite.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">none</td>
+ </tr>
+
+ </table>
+
+<hr />
+
+<h3><code>testcase</code></h3>
+<p>A <code>&lt;testcase&gt;</code> allows you to specify one or more individual test cases to run.
+
+</p>
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td valign="top" align="center"><b>Required</b></td>
+ <td valign="top" align="center"><b>Default</b></td>
+ </tr>
+ <tr>
+ <td valign="top">name</td>
+ <td valign="top">The fully qualified ColdFusion component name (com.foo.bar.MyCFC)
+ </td>
+ <td align="center" valign="top">Yes</td>
+ <td valign="top" align="center">&nbsp;</td>
+ </tr>
+ <tr>
+ <td valign="top">runner</td>
+ <td valign="top">The ColdFusion component runner responsible for running the tests,</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center">/mxunit/runner/HttpAntRunner.cfc"</td>
+ </tr>
+
+ <tr>
+ <td valign="top">remoteMethod</td>
+ <td valign="top">The remote method in the ColdFusion component that will be called.</td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="center"><code>run</code></td>
+ </tr>
+
+ <tr>
+ <td valign="top">packageName</td>
+ <td valign="top">
+ The name used by the JUnitReport task to print the main and child packages in the
+ test result report.
+ </td>
+ <td align="center" valign="top">No</td>
+ <td valign="top" align="left">mxunit.testresult</td>
+ </tr>
+ </table>
+
+
+
+
+<hr />
+<h3>Examples</h3>
+<p>This example illustrates a minimal amount of code required to run one directory of tests.
+
+Note that this example does not save any results. This may be useful for automated deployments.</p>
+
+
+
+
+
+<pre>
+&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
+&lt;project name="MXUnitTask" basedir="." default="runtests"&gt;
+
+ &lt;target name="runtests" description="Run a dir of tests recursively"&gt;
+
+ &lt;taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" /&gt;
+ &lt;mxunittask server="localhost" &gt;
+ &lt;directory path="C:\CFusionMX7\wwwroot\mxunit\tests\framework" recurse="true" /&gt;
+ &lt;/mxunittask&gt;
+
+ &lt;/target&gt;
+&lt;/project&gt;
+ </pre>
+
+<p>This example runs both directories of and individual tests, saves the output to ${output.dir}, generates a JUnit report, and
+ opens a web browser with the JUnit report.
+</p>
+<pre> &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
+&lt;project name="MXUnitTask" basedir="." default="main"&gt;
+
+ &lt;property name="mxunit.jar" value="../ant/lib/mxunit-ant.jar" /&gt;
+ &lt;property name="junit.out.dir.xml" value="testresults" /&gt;
+ &lt;property name="junit.out.dir.html" value="testresults/html" /&gt;
+ &lt;property name="output.dir" value="tmp" /&gt;
+ &lt;property name="style.dir" value="../ant/xsl/" /&gt;
+
+
+
+ &lt;target name="main" depends="browse" /&gt;
+
+
+ &lt;target name="runtests" description="Make output directories and run the MXUnit task"&gt;
+ &lt;mkdir dir="${junit.out.dir.html}" /&gt;
+ &lt;mkdir dir="${output.dir}" /&gt;
+ &lt;taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" /&gt;
+
+ &lt;mxunittask server="localhost" port="8500"
+ defaultrunner="/mxunit/runner/HttpAntRunner.cfc"
+ connectionMethod="http"
+ outputdir="${output.dir}"
+ authmethod="basic"
+ username="foo"
+ password="bar"
+ verbose="true"&gt;
+
+ &lt;testcase name="mxunit.tests.framework.AssertTest" packageName="mxunit.asserttests" /&gt;
+ &lt;testcase name="mxunit.tests.framework.AssertDecoratorTest" packageName="mxunit.assertdecoratortests" /&gt;
+
+ &lt;directory runner="/mxunit/runner/HttpAntRunner.cfc"
+ remoteMethod="run"
+ path="C:\CFusionMX7\wwwroot\mxunit\tests\framework"
+ packageName="mxunit.framework"
+ recurse="false"
+ componentPath="mxunit.tests.framework"
+ excludes="none" /&gt;
+
+ &lt;!-- This has a bad componentPath and should fail --&gt;
+ &lt;directory runner="/mxunit/runner/HttpAntRunner.cfc"
+ remoteMethod="run"
+ path="C:\CFusionMX7\wwwroot\mxunit\tests\framework"
+ packageName="mxunit.bad.framework"
+ recurse="false"
+ componentPath="mxunit.foo.bar"
+ excludes="none" /&gt;
+
+ &lt;directory runner="/mxunit/runner/HttpAntRunner.cfc"
+ remoteMethod="run"
+ path="C:\CFusionMX7\wwwroot\mxunit\samples"
+ packageName="mxunit.tests.samples"
+ recurse="false"
+ excludes="" /&gt;
+
+
+ &lt;/mxunittask&gt;
+ &lt;/target&gt;
+
+
+
+
+ &lt;target name="junitreport" depends="runtests" description="Create a report for the rest result"&gt;
+ &lt;mkdir dir="${junit.out.dir.html}"/&gt;
+ &lt;junitreport todir="${junit.out.dir.html}"&gt;
+ &lt;fileset dir="${output.dir}"&gt;
+ &lt;include name="*.xml"/&gt;
+ &lt;/fileset&gt;
+ &lt;report format="frames" todir="${junit.out.dir.html}" styledir="${style.dir}"/&gt;
+ &lt;/junitreport&gt;
+ &lt;delete dir="${output.dir}" /&gt;
+ &lt;/target&gt;
+
+
+ &lt;!-- To fire up a browser with the test results. May not work on your machine --&gt;
+
+ &lt;target name="browse" depends="junitreport"&gt;
+ &lt;exec executable="C:\Program Files\Internet Explorer\iexplore.exe"&gt;
+ &lt;arg value="C:\CFusionMX7\wwwroot\mxunit\tests\testresults\html\index.html"/&gt;
+ &lt;/exec&gt;
+ &lt;/target&gt;
+
+
+
+&lt;/project&gt;
+
+</pre>
+<p>
+
+
+</body>
+</html>
+
+
104 ant/sample-build.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+
+ MXUnit Ant Task sample build file.
+
+ Usage: ant -f sample-build.xml
+
+ Notes: This assumes installation of mxunit directly under web root.
+ The webroot, in this example, is in D:/webapps/ on an MS Windows
+ installation.
+
+-->
+
+<project name="MXUnitTask" basedir="." default="main">
+
+ <property name="mxunit.jar" value="lib/mxunit-ant-java5.jar" />
+ <property name="junit.out.dir.xml" value="testresults" />
+ <property name="junit.out.dir.html" value="testresults/html" />
+ <property name="output.dir" value="tmp" />
+ <property name="style.dir" value="xsl/" />
+ <property name="web.root" value="D:/webapps/" />
+ <property name="server.name" value="localhost" />
+
+
+
+ <target name="main" depends="runtests,junitreport,browse" />
+
+
+ <target name="runtests" description="Make output directories and run the MXUnit task">
+ <mkdir dir="${junit.out.dir.html}" />
+ <mkdir dir="${output.dir}" />
+
+
+ <taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
+ <mxunittask server="${server.name}"
+ defaultrunner="/mxunit/runner/HttpAntRunner.cfc"
+ outputdir="${output.dir}"
+ verbose="true"
+ testResultsSummary="my.summary">
+
+ <testcase name="mxunit.tests.framework.AssertTest" packageName="mxunit.asserttests" />
+ <testcase name="mxunit.tests.framework.AssertDecoratorTest" packageName="mxunit.assertdecoratortests" />
+
+ <directory runner="/mxunit/runner/HttpAntRunner.cfc"
+ remoteMethod="run"
+ path="${web.root}mxunit/tests/framework"
+ componentPath="mxunit.tests.framework"
+ packageName="mxunit.framework"
+ recurse="false" />
+
+ <directory runner="/mxunit/runner/HttpAntRunner.cfc"
+ remoteMethod="run"
+ path="${web.root}mxunit/tests/runner"
+ componentPath="mxunit.tests.runner"
+ packageName="mxunit.runner"
+ recurse="false" />
+
+ <directory runner="/mxunit/runner/HttpAntRunner.cfc"
+ remoteMethod="run"
+ path="${web.root}mxunit/PluginDemoTests"
+ componentPath="mxunit.PluginDemoTests"
+ packageName="mxunit.plugintests"
+ recurse="false" />
+
+
+ </mxunittask>
+ </target>
+
+
+
+
+ <target name="junitreport" description="Create a report for the rest result">
+ <mkdir dir="${junit.out.dir.html}"/>
+ <junitreport todir="${junit.out.dir.html}">
+ <fileset dir="${output.dir}">
+ <include name="*.xml"/>
+ </fileset>
+ <report format="frames" todir="${junit.out.dir.html}" styledir="${style.dir}"/>
+ </junitreport>
+ <delete dir="${output.dir}" />
+
+ <!-- Read the properties files we generated -->
+ <property file="${output.dir}/my.summary" />
+ <echoproperties />
+
+ <echo />
+ <echo message="MXUnit sample Ant build completed." />
+ <echo message="Point a web browser to ${junit.out.dir.html}/index.html to view the report." />
+
+ </target>
+
+
+ <!-- To fire up a browser with the test results. May not work on your machine -->
+
+ <target name="browse" depends="junitreport">
+ <exec executable="C:\Programs\Mozilla Firefox\firefox.exe">
+ <arg value="${user.dir}\testresults\html\index.html"/>
+ </exec>
+ </target>
+
+
+
+</project>
20 ant/stylesheets/antmanual.css
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+body {
+ background-image:url(/images/beta.png)
+}
53 ant/stylesheets/style.css
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+h2 {
+ font-size: 200%;
+ background-color: ffffff;
+}
+
+h3 {
+ font-size: 130%;
+ color: #ffffff;
+ background-color: #525D76;
+}
+
+h4 {
+ color: #ffffff;
+ background-color: #828DA6;
+}
+
+td {
+ background-color: eeeeee;
+ color: 000000;
+}
+
+ /* first row */
+table tr:first-child td {
+ background-color: cccccc;
+ color: 000000;
+}
+
+ /* or th as first row */
+table th {
+ background-color: cccccc;
+ color: 000000;
+}
+
+pre {
+ background-color: efefef;
+}
875 ant/xsl/junit-frames.xsl
@@ -0,0 +1,875 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="http://xml.apache.org/xalan/redirect"
+ xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
+ extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="." grouping-separator=","/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!--
+
+ Sample stylesheet to be used with Ant JUnitReport output.
+
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+
+-->
+<xsl:param name="output.dir" select="'.'"/>
+
+
+<xsl:template match="testsuites">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-summary.html">
+ <xsl:apply-templates select="." mode="overview.packages"/>
+ </redirect:write>
+
+ <!-- create the all-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="all.packages"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="." mode="all.classes"/>
+ </redirect:write>
+
+ <!-- create the all-tests.html at the root -->
+ <redirect:write file="{$output.dir}/all-tests.html">
+ <xsl:apply-templates select="." mode="all.tests"/>
+ </redirect:write>
+
+ <!-- create the alltests-fails.html at the root -->
+ <redirect:write file="{$output.dir}/alltests-fails.html">
+ <xsl:apply-templates select="." mode="all.tests">
+ <xsl:with-param name="type" select="'fails'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+
+ <!-- create the alltests-errors.html at the root -->
+ <redirect:write file="{$output.dir}/alltests-errors.html">
+ <xsl:apply-templates select="." mode="all.tests">
+ <xsl:with-param name="type" select="'errors'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+
+ <!-- process all packages -->
+ <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+ <xsl:call-template name="package">
+ <xsl:with-param name="name" select="@package"/>
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="package">
+ <xsl:param name="name"/>
+ <xsl:variable name="package.dir">
+ <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
+ <xsl:if test="$name = ''">.</xsl:if>
+ </xsl:variable>
+ <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
+ <!-- create a classes-list.html in the package directory -->
+ <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
+ <xsl:call-template name="classes.list">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </redirect:write>
+
+ <!-- create a package-summary.html in the package directory -->
+ <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
+ <xsl:call-template name="package.summary">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </redirect:write>
+
+ <!-- for each class, creates a @name.html -->
+ <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
+ <xsl:for-each select="/testsuites/testsuite[@package = $name]">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}.html">
+ <xsl:apply-templates select="." mode="class.details"/>
+ </redirect:write>
+ <xsl:if test="string-length(./system-out)!=0">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-out.txt">
+ <xsl:value-of disable-output-escaping="yes" select="./system-out"/>
+ </redirect:write>
+ </xsl:if>
+ <xsl:if test="string-length(./system-err)!=0">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-err.txt">
+ <xsl:value-of disable-output-escaping="yes" select="./system-err"/>
+ </redirect:write>
+ </xsl:if>
+ <xsl:if test="@failures != 0">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-fails.html">
+ <xsl:apply-templates select="." mode="class.details">
+ <xsl:with-param name="type" select="'fails'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+ </xsl:if>
+ <xsl:if test="@errors != 0">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-errors.html">
+ <xsl:apply-templates select="." mode="class.details">
+ <xsl:with-param name="type" select="'errors'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+ </xsl:if>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="index.html">
+<html>
+ <head>
+ <title>MXUnit Test Results</title>
+ </head>
+ <frameset cols="20%,80%">
+ <frameset rows="30%,70%">
+ <frame src="overview-frame.html" name="packageListFrame"/>
+ <frame src="allclasses-frame.html" name="classListFrame"/>
+ </frameset>
+ <frame src="overview-summary.html" name="classFrame"/>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ 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.
+ </p>
+ </noframes>
+ </frameset>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+}
+table tr td, table tr th {
+ font-size: 68%;
+}
+table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+}
+table.details tr td{
+ background:#eeeee0;
+}
+
+p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+}
+h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+}
+h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+}
+h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+}
+h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+.Error {
+ font-weight:bold; color:red;
+}
+.Failure {
+ font-weight:bold; color:purple;
+}
+.Properties {
+ text-align:right;
+}
+</xsl:template>
+
+<!-- Create list of all/failed/errored tests -->
+<xsl:template match="testsuites" mode="all.tests">
+ <xsl:param name="type" select="'all'"/>
+ <html>
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <xsl:text>All Failures</xsl:text>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <xsl:text>All Errors</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>All Tests</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <head>
+ <title>MXUnit Test Results: <xsl:value-of select="$title"/></title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
+ <xsl:call-template name="pageHeader"/>
+ <h2><xsl:value-of select="$title"/></h2>
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header">
+ <xsl:with-param name="show.class" select="'yes'"/>
+ </xsl:call-template>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4">
+ <xsl:apply-templates select="./error"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <xsl:apply-templates select=".//testcase[failure]" mode="print.test">
+ <xsl:with-param name="show.class" select="'yes'"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <xsl:apply-templates select=".//testcase[error]" mode="print.test">
+ <xsl:with-param name="show.class" select="'yes'"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select=".//testcase" mode="print.test">
+ <xsl:with-param name="show.class" select="'yes'"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+
+<!-- ======================================================================
+ This page is created for every testsuite class.
+ It prints a summary of the testsuite and detailed information about
+ testcase methods.
+ ====================================================================== -->
+<xsl:template match="testsuite" mode="class.details">
+ <xsl:param name="type" select="'all'"/>
+ <xsl:variable name="package.name" select="@package"/>
+ <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>
+ <html>
+ <head>
+ <title>MXUnit Test Results: <xsl:value-of select="$class.name"/></title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name" select="$package.name"/>
+ </xsl:call-template>
+ <script type="text/javascript" language="JavaScript">
+ var TestCases = new Array();
+ var cur;
+ <xsl:apply-templates select="properties"/>
+ </script>
+ <script type="text/javascript" language="JavaScript"><![CDATA[
+ function displayProperties (name) {
+ var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+ var doc = win.document;
+ doc.open();
+ doc.write("<html><head><title>Properties of " + name + "</title>");
+ doc.write("<style type=\"text/css\">");
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
+ doc.write("table tr td, table tr th { font-size: 68%; }");
+ doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+ doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+ doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
+ doc.write("</style>");
+ doc.write("</head><body>");
+ doc.write("<h3>Properties of " + name + "</h3>");
+ doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
+ doc.write("<table class='properties'>");
+ doc.write("<tr><th>Name</th><th>Value</th></tr>");
+ for (prop in TestCases[name]) {
+ doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
+ }
+ doc.write("</table>");
+ doc.write("</body></html>");
+ doc.close();
+ win.focus();
+ }
+ ]]>
+ </script>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <h3>Class <xsl:value-of select="$class.name"/></h3>
+
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <xsl:apply-templates select="." mode="print.test"/>
+ </table>
+
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <h2>Failures</h2>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <h2>Errors</h2>
+ </xsl:when>
+ <xsl:otherwise>
+ <h2>Tests</h2>
+ </xsl:otherwise>
+ </xsl:choose>
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header"/>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4"><xsl:apply-templates select="./error"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <xsl:apply-templates select="./testcase[failure]" mode="print.test"/>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <xsl:apply-templates select="./testcase[error]" mode="print.test"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="./testcase" mode="print.test"/>