Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added MXUnit tests for the first method.

  • Loading branch information...
commit ded741f0c81d67d8b9bf928de58e7f653fbc7ae9 1 parent 63736da
@bennadel authored
Showing with 38,572 additions and 0 deletions.
  1. +4 −0 README.md
  2. +42 −0 tests/Application.cfc
  3. +21 −0 tests/mxunit/MIT-License.txt
  4. +25 −0 tests/mxunit/MXUnitInstallTest.cfc
  5. +23 −0 tests/mxunit/PluginDemoTests/CFScriptExpectedExceptionTest.cfc
  6. +94 −0 tests/mxunit/PluginDemoTests/CompareDialogTest.cfc
  7. +18 −0 tests/mxunit/PluginDemoTests/ComplexExceptionTypeErrorTest.cfc
  8. +42 −0 tests/mxunit/PluginDemoTests/DoubleMethodTest.cfc
  9. +9 −0 tests/mxunit/PluginDemoTests/EmptyTest.cfc
  10. +9 −0 tests/mxunit/PluginDemoTests/ExpectedExceptionTest.cfc
  11. +8 −0 tests/mxunit/PluginDemoTests/FiveSecondTest.cfc
  12. +130 −0 tests/mxunit/PluginDemoTests/HodgePodgeTest.cfc
  13. +13 −0 tests/mxunit/PluginDemoTests/InvalidMarkupTest.cfc
  14. +34 −0 tests/mxunit/PluginDemoTests/PrivateMethodTest.cfc
  15. +43 −0 tests/mxunit/PluginDemoTests/README.txt
  16. +9 −0 tests/mxunit/PluginDemoTests/SingleFailureTest.cfc
  17. +21 −0 tests/mxunit/PluginDemoTests/SingleMethodTest.cfc
  18. +23 −0 tests/mxunit/PluginDemoTests/SomeObject.cfc
  19. +19 −0 tests/mxunit/PluginDemoTests/SubDir/AnotherSubDir/AnotherTest.cfc
  20. +9 −0 tests/mxunit/PluginDemoTests/SubDir/AnotherSubDir/SomeComponentWithStuff.cfc
  21. +21 −0 tests/mxunit/PluginDemoTests/SubDir/AnotherSubDir/SomeOtherTest.cfc
  22. +6 −0 tests/mxunit/PluginDemoTests/SubDir/AnotherSubDir/TestSomething.cfc
  23. +26 −0 tests/mxunit/PluginDemoTests/SubDir/CFUnitStyleTest.cfc
  24. +5 −0 tests/mxunit/PluginDemoTests/TestOrdering/AlphabeticallyOrderedTest.cfc
  25. +12 −0 tests/mxunit/PluginDemoTests/TestOrdering/DefaultOrderedTest.cfc
  26. +14 −0 tests/mxunit/PluginDemoTests/ThrowsAnErrorTest.cfc
  27. +37 −0 tests/mxunit/PluginDemoTests/build.xml
  28. +11 −0 tests/mxunit/PluginDemoTests/inheritance/BaseTest.cfc
  29. +11 −0 tests/mxunit/PluginDemoTests/inheritance/SomeDoublyExtendingTest.cfc
  30. +7 −0 tests/mxunit/PluginDemoTests/inheritance/SomeExtendingTest.cfc
  31. +34 −0 tests/mxunit/PluginDemoTests/run.cfm
  32. +14 −0 tests/mxunit/PluginDemoTests/weirderrordemos/BustedConstructorTest.cfc
  33. +12 −0 tests/mxunit/PluginDemoTests/weirderrordemos/BustedSetupTest.cfc
  34. +12 −0 tests/mxunit/PluginDemoTests/weirderrordemos/BustedTearDownTest.cfc
  35. +9 −0 tests/mxunit/PluginDemoTests/weirderrordemos/extends/Extends.cfc
  36. +8 −0 tests/mxunit/PluginDemoTests/weirderrordemos/extends/SomeTest.cfc
  37. +13 −0 tests/mxunit/README.txt
  38. +47 −0 tests/mxunit/ant/README.txt
  39. BIN  tests/mxunit/ant/lib/mxunit-ant.jar
  40. +415 −0 tests/mxunit/ant/mxunit-ant-doc.html
  41. +104 −0 tests/mxunit/ant/sample-build.xml
  42. +20 −0 tests/mxunit/ant/stylesheets/antmanual.css
  43. +53 −0 tests/mxunit/ant/stylesheets/style.css
  44. +875 −0 tests/mxunit/ant/xsl/junit-frames.xsl
  45. +464 −0 tests/mxunit/ant/xsl/junit-noframes.xsl
  46. +511 −0 tests/mxunit/build.xml
  47. +4 −0 tests/mxunit/buildprops/antrunner.properties
  48. +5 −0 tests/mxunit/buildprops/antrunner_sample.properties
  49. +24 −0 tests/mxunit/buildprops/scripts/http_doc_gen.js
  50. +8 −0 tests/mxunit/buildprops/unames_example.properties
  51. +8 −0 tests/mxunit/buildprops/version.properties
  52. +196 −0 tests/mxunit/doc/api/allclasses-frame.html
  53. +39 −0 tests/mxunit/doc/api/index.html
  54. +1,125 −0 tests/mxunit/doc/api/mxunit/framework/Assert.html
  55. +324 −0 tests/mxunit/doc/api/mxunit/framework/CSVUtility.html
  56. +471 −0 tests/mxunit/doc/api/mxunit/framework/ComponentBlender.html
  57. +619 −0 tests/mxunit/doc/api/mxunit/framework/ComponentUtils.html
  58. +373 −0 tests/mxunit/doc/api/mxunit/framework/ConfigManager.html
  59. +386 −0 tests/mxunit/doc/api/mxunit/framework/DataCompare.html
  60. +740 −0 tests/mxunit/doc/api/mxunit/framework/DataproviderHandler.html
  61. +234 −0 tests/mxunit/doc/api/mxunit/framework/Formatters.html
  62. +339 −0 tests/mxunit/doc/api/mxunit/framework/HamcrestAssert.html
  63. +357 −0 tests/mxunit/doc/api/mxunit/framework/HamcrestMatcher.html
  64. +395 −0 tests/mxunit/doc/api/mxunit/framework/HtmlTestResult.html
  65. +407 −0 tests/mxunit/doc/api/mxunit/framework/JUnitXMLTestResult.html
  66. +618 −0 tests/mxunit/doc/api/mxunit/framework/JavaLoader.html
  67. +942 −0 tests/mxunit/doc/api/mxunit/framework/JavaProxy.html
  68. +639 −0 tests/mxunit/doc/api/mxunit/framework/MXUnitAssertionExtensions.html
  69. +393 −0 tests/mxunit/doc/api/mxunit/framework/MockFactoryFactory.html
  70. +666 −0 tests/mxunit/doc/api/mxunit/framework/POIUtility.html
  71. +451 −0 tests/mxunit/doc/api/mxunit/framework/PublicProxyMaker.html
  72. +294 −0 tests/mxunit/doc/api/mxunit/framework/QueryTestResult.html
  73. +627 −0 tests/mxunit/doc/api/mxunit/framework/RemoteFacade.html
  74. +467 −0 tests/mxunit/doc/api/mxunit/framework/RemoteFacadeObjectCache.html
  75. +263 −0 tests/mxunit/doc/api/mxunit/framework/Test.html
  76. +1,672 −0 tests/mxunit/doc/api/mxunit/framework/TestCase.html
  77. +948 −0 tests/mxunit/doc/api/mxunit/framework/TestDecorator.html
  78. +1,178 −0 tests/mxunit/doc/api/mxunit/framework/TestResult.html
  79. +646 −0 tests/mxunit/doc/api/mxunit/framework/TestSuite.html
  80. +604 −0 tests/mxunit/doc/api/mxunit/framework/TestSuiteRunner.html
  81. +423 −0 tests/mxunit/doc/api/mxunit/framework/TextTestResult.html
  82. +256 −0 tests/mxunit/doc/api/mxunit/framework/VersionReader.html
  83. +492 −0 tests/mxunit/doc/api/mxunit/framework/XMLTestResult.html
  84. +364 −0 tests/mxunit/doc/api/mxunit/framework/XPathAssert.html
  85. +395 −0 tests/mxunit/doc/api/mxunit/framework/adapters/cf9/PublicProxyMaker.html
  86. +36 −0 tests/mxunit/doc/api/mxunit/framework/adapters/cf9/package-frame.html
  87. +143 −0 tests/mxunit/doc/api/mxunit/framework/adapters/cf9/package-summary.html
  88. +258 −0 tests/mxunit/doc/api/mxunit/framework/decorators/AlphabeticallyOrderedTestsDecorator.html
  89. +675 −0 tests/mxunit/doc/api/mxunit/framework/decorators/DataProviderDecorator.html
  90. +258 −0 tests/mxunit/doc/api/mxunit/framework/decorators/OrderedTestDecorator.html
  91. +267 −0 tests/mxunit/doc/api/mxunit/framework/decorators/TransactionRollbackDecorator.html
  92. +45 −0 tests/mxunit/doc/api/mxunit/framework/decorators/package-frame.html
  93. +170 −0 tests/mxunit/doc/api/mxunit/framework/decorators/package-summary.html
  94. +234 −0 tests/mxunit/doc/api/mxunit/framework/ext/AssertionExtensionTemplate.html
  95. +36 −0 tests/mxunit/doc/api/mxunit/framework/ext/package-frame.html
  96. +143 −0 tests/mxunit/doc/api/mxunit/framework/ext/package-summary.html
  97. +544 −0 tests/mxunit/doc/api/mxunit/framework/javaloader/JavaCompiler.html
  98. +1,239 −0 tests/mxunit/doc/api/mxunit/framework/javaloader/JavaLoader.html
  99. +942 −0 tests/mxunit/doc/api/mxunit/framework/javaloader/JavaProxy.html
  100. +42 −0 tests/mxunit/doc/api/mxunit/framework/javaloader/package-frame.html
  101. +161 −0 tests/mxunit/doc/api/mxunit/framework/javaloader/package-summary.html
  102. +592 −0 tests/mxunit/doc/api/mxunit/framework/mail.html
  103. +179 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/AbstractMock.html
  104. +336 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/ArgumentMatcher.html
  105. +1,022 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/MightyMock.html
  106. +326 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/MightyMockFactory.html
  107. +266 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/MockDebug.html
  108. +278 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/MockFactory.html
  109. +219 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/MockLogger.html
  110. +862 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/MockRegistry.html
  111. +592 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/OrderedExpectation.html
  112. +576 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/Verifier.html
  113. +63 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/package-frame.html
  114. +224 −0 tests/mxunit/doc/api/mxunit/framework/mightymock/package-summary.html
  115. +129 −0 tests/mxunit/doc/api/mxunit/framework/package-frame.html
  116. +422 −0 tests/mxunit/doc/api/mxunit/framework/package-summary.html
  117. +517 −0 tests/mxunit/doc/api/mxunit/runner/DirectoryTestSuite.html
  118. +265 −0 tests/mxunit/doc/api/mxunit/runner/HtmlRunner.html
  119. +326 −0 tests/mxunit/doc/api/mxunit/runner/HttpAntRunner.html
  120. +242 −0 tests/mxunit/doc/api/mxunit/runner/RunnerUtils.html
  121. +45 −0 tests/mxunit/doc/api/mxunit/runner/package-frame.html
  122. +170 −0 tests/mxunit/doc/api/mxunit/runner/package-summary.html
  123. +67 −0 tests/mxunit/doc/api/overview-frame.html
  124. +165 −0 tests/mxunit/doc/api/overview-summary.html
  125. +134 −0 tests/mxunit/doc/build.cfm
  126. +170 −0 tests/mxunit/doc/colddoc/ColdDoc.cfc
  127. +213 −0 tests/mxunit/doc/colddoc/licence.txt
  128. +440 −0 tests/mxunit/doc/colddoc/strategy/AbstractTemplateStrategy.cfc
  129. +163 −0 tests/mxunit/doc/colddoc/strategy/api/HTMLAPIStrategy.cfc
  130. +35 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/allclasses-frame.html
  131. +527 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/class.html
  132. +65 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/inc/nav.html
  133. +40 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/index.html
  134. +52 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/overview-frame.html
  135. +70 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/overview-summary.html
  136. +37 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/package-frame.html
  137. +75 −0 tests/mxunit/doc/colddoc/strategy/api/resources/templates/package-summary.html
  138. +123 −0 tests/mxunit/doc/colddoc/strategy/uml2tools/XMIStrategy.cfc
  139. +404 −0 tests/mxunit/doc/colddoc/strategy/uml2tools/resources/templates/template.uml
  140. +110 −0 tests/mxunit/eclipse/copy.xml
  141. +132 −0 tests/mxunit/eclipse/copysnippets.xml
  142. +424 −0 tests/mxunit/eclipse/dictionary/mxunit.xml
  143. +13 −0 tests/mxunit/eclipse/dictionary/readme.txt
  144. +36 −0 tests/mxunit/eclipse/snippets/keyCombos.properties
  145. +100 −0 tests/mxunit/eclipse/snippets/mxunit/ant/mxunitAntTaskExample.xml
  146. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/addAssertDecorator.xml
  147. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertEquals.xml
  148. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertFalse.xml
  149. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsArray.xml
  150. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsDefined.xml
  151. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsEmpty.xml
  152. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsQuery.xml
  153. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsStruct.xml
  154. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsTypeOf.xml
  155. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertIsXMLDoc.xml
  156. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertNotEquals.xml
  157. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertNotSame.xml
  158. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertSame.xml
  159. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/assertTrue.xml
  160. +7 −0 tests/mxunit/eclipse/snippets/mxunit/assert/fail.xml
  161. +18 −0 tests/mxunit/eclipse/snippets/mxunit/assert/try catch error path.xml
  162. +16 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/cfquerysim.xml
  163. +7 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/debug.xml
  164. +7 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/injectMethod.xml
  165. +7 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/injectProperty.xml
  166. +7 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/makepublic.xml
  167. +17 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/querysim.xml
  168. +10 −0 tests/mxunit/eclipse/snippets/mxunit/helpers/test-time override function.xml
  169. +29 −0 tests/mxunit/eclipse/snippets/mxunit/new MXUnit TestCase cfscript.xml
  170. +28 −0 tests/mxunit/eclipse/snippets/mxunit/new MXUnit TestCase.xml
  171. +11 −0 tests/mxunit/eclipse/snippets/mxunit/new test error path function cfscript.xml
  172. +10 −0 tests/mxunit/eclipse/snippets/mxunit/new test error path function.xml
  173. +9 −0 tests/mxunit/eclipse/snippets/mxunit/new test function cfscript.xml
  174. +11 −0 tests/mxunit/eclipse/snippets/mxunit/new test function.xml
  175. +9 −0 tests/mxunit/eclipse/snippets/mxunit/setUp cfscript.xml
  176. +9 −0 tests/mxunit/eclipse/snippets/mxunit/setUp.xml
  177. +9 −0 tests/mxunit/eclipse/snippets/mxunit/tearDown cfscript.xml
  178. +9 −0 tests/mxunit/eclipse/snippets/mxunit/tearDown.xml
  179. +23 −0 tests/mxunit/eclipse/snippets/mxunit/testrunner/Directory Test Suite Skeleton.xml
  180. +43 −0 tests/mxunit/eclipse/snippets/mxunit/testrunner/Simple Scheduled Test Run Template.xml
  181. +10 −0 tests/mxunit/eclipse/snippets/readme.txt
Sorry, we could not display the entire diff because too many files (452) changed.
View
4 README.md
@@ -10,4 +10,8 @@ APIs much easier. Before ColdFusion 10, however, you would need to dip down into
the Java layer to access the security libraries. This ColdFusion component -
Crypto.cfc - attempts to make access to such libraries easier and more concise.
+## Currently Supported Methods
+
+* hmacSha256( key, input [, encoding] )
+
[1]: http://www.bennadel.com/blog/2339-ColdFusion-10-Beta-Generating-Hash-Based-Message-Authentication-Codes-With-Hmac-.htm
View
42 tests/Application.cfc
@@ -0,0 +1,42 @@
+<cfscript>
+
+component
+ output = "false"
+ hint = "I define the unit-testing application settings."
+ {
+
+
+ // Define the application settings. For testing, these are pretty minimal.
+ this.name = hash( getCurrentTemplatePath() );
+ this.applicationTimeout = createTimeSpan( 0, 0, 1, 0 );
+ this.sessionManagement = false;
+
+ // Get the tests directory - we'll be setting up mappings for directories relative to our
+ // testing directory.
+ this.testsDirectory = getDirectoryFromPath( getCurrentTemplatePath() );
+
+ // Get the root directory for our project.
+ this.projectDirectory = (this.testsDirectory & "../");
+
+ // Get our MXUnit directory - we'll need this in order to run the test suties from our
+ // tests directory.
+ this.mxunitDirectory = (this.testsDirectory & "mxunit/");
+
+ // ***** MX UNIT FRAMEWORK *****
+ // Set up a mapping to the MXUnit framework; this is requied for the framework installation
+ // to run without a global mapping.
+ this.mappings[ "/mxunit" ] = this.mxunitDirectory;
+
+ // ***** TEST SPECIFICATIONS *****
+ // Map the spec folder so that our local tests can be located from within the MXUnit framework
+ // components.
+ this.mappings[ "/specs" ] = (this.testsDirectory & "specs/");
+
+ // ***** PROJECT COMPONENTS *****
+ // Map the Lib directory so we can include our projects components for unit testing.
+ this.mappings[ "/lib" ] = (this.projectDirectory & "lib/");
+
+
+}
+
+</cfscript>
View
21 tests/mxunit/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.
View
25 tests/mxunit/MXUnitInstallTest.cfc
@@ -0,0 +1,25 @@
+<cfcomponent displayname="MxunitInstallVerificationTest" extends="mxunit.framework.TestCase">
+ <cffunction name="testThis" >
+ <cfset assertEquals("this","this") />
+ </cffunction>
+
+ <cffunction name="testThat" >
+ <cfset assertEquals("this","that", "This is an intentional failure so you see what it looks like") />
+ </cffunction>
+
+ <cffunction name="testSomething" >
+ <cfset a = arrayNew(1)>
+ <cfset a[1] = "some debug traces" />
+ <cfset debug(a) />
+ <cfset assertEquals(1,1) />
+ </cffunction>
+
+ <cffunction name="testSomethingElse">
+ <cfset assertTrue(true) />
+ </cffunction>
+
+ <cffunction name="testIntentionalError">
+ <cfset foo = bar />
+ </cffunction>
+
+ </cfcomponent>
View
23 tests/mxunit/PluginDemoTests/CFScriptExpectedExceptionTest.cfc
@@ -0,0 +1,23 @@
+component extends="mxunit.framework.TestCase" {
+
+ /**
+ * @mxunit:expectedException MyCustomException
+ */
+ function thisShouldFail_BecauseExpectedExceptionIsNotThrown(){
+ throw("hi mom!", "SomeOtherKindOfException");
+ }
+
+ /**
+ * @mxunit:expectedException MyCustomException
+ */
+ function thisShouldPass_BecauseExpectedExceptionIsThrown(){
+ throw("hi mom!", "MyCustomException");
+ }
+
+ /**
+ * @mxunit:expectedException MyCustom.Exception
+ */
+ function thisShouldPass_BecauseExpectedExceptionIsThrown2(){
+ throw("hi mom!", "MyCustom.Exception");
+ }
+}
View
94 tests/mxunit/PluginDemoTests/CompareDialogTest.cfc
@@ -0,0 +1,94 @@
+<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 queries = makeQueries()>
+ <cfset assertQueryEquals(queries.one, queries.two)>
+ </cffunction>
+
+ <cffunction name="structCompareDifferences">
+ <cfset var s = makeStructures()>
+ <cfset assertStructEquals(s.one, s.two)>
+ </cffunction>
+
+ <cffunction name="arrayCompareDifferences">
+ <cfset var a1 = [1,2,3,4,5,"a","b","c"]>
+ <cfset var a2 = [1,2,3,4,6,"a","b","c","d","e","f"]>
+ <cfset debug("Check debug output!")>
+ <cfset assertEquals( a1, a2 )>
+ </cffunction>
+
+ <cffunction name="arrayCompareDifferences2">
+ <cfset var a1 = [1,2,3,4,6,"a","b","c","d","e","f"]>
+ <cfset var a2 = [1,2,3,4,5,"a","b","c"]>
+ <cfset debug("Check debug output!")>
+ <cfset assertEquals( a1, a2 )>
+ </cffunction>
+
+ <cffunction name="arrayCompareDifferencesComplex">
+ <cfset var s = makeStructures()>
+ <cfset var a1 = [1,2,3,4,6,"a","b","c", s.one, "d"]>
+ <cfset var a2 = [1,2,3,4,5,"a","b","c", s.two, "e"]>
+ <cfset debug("Check debug output!")>
+ <cfset assertEquals( a1, a2 )>
+ </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.nested = StructNew()>
+ <cfset s.nested.someValue = 5>
+ <cfset s.one = "one">
+ <cfset s.two = StructNew()>
+ <cfset s2 = duplicate(s)>
+ <cfset s2.one = "ona">
+ <cfset s2.nested.someValue = 50000>
+ <cfset combo.one = s>
+ <cfset combo.two = s2>
+ <cfset s2.KeyNotInS1 = "hi mom!">
+ <cfset s.KeyNotInS2 = "hi dad!">
+
+
+ <cfreturn combo>
+ </cffunction>
+
+
+
+</cfcomponent>
View
18 tests/mxunit/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>
View
42 tests/mxunit/PluginDemoTests/DoubleMethodTest.cfc
@@ -0,0 +1,42 @@
+<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>
View
9 tests/mxunit/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>
View
9 tests/mxunit/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>
View
8 tests/mxunit/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>
View
130 tests/mxunit/PluginDemoTests/HodgePodgeTest.cfc
@@ -0,0 +1,130 @@
+<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>
View
13 tests/mxunit/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>
View
34 tests/mxunit/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>
View
43 tests/mxunit/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"
+
View
9 tests/mxunit/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>
View
21 tests/mxunit/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>
View
23 tests/mxunit/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>
View
19 tests/mxunit/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>
View
9 tests/mxunit/PluginDemoTests/SubDir/AnotherSubDir/SomeComponentWithStuff.cfc
@@ -0,0 +1,9 @@
+<cfcomponent>
+ <cffunction name="throwError">
+ <cfthrow message="this is an error">
+ </cffunction>
+
+ <cffunction name="throwError2">
+ <cfset throwError()>
+ </cffunction>
+</cfcomponent>
View
21 tests/mxunit/PluginDemoTests/SubDir/AnotherSubDir/SomeOtherTest.cfc
@@ -0,0 +1,21 @@
+<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>
+
+ <cffunction name="thisShouldThrowAnError">
+ <cfinvoke component="SomeComponentWithStuff" method="throwError2">
+ </cffunction>
+
+</cfcomponent>
View
6 tests/mxunit/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>
View
26 tests/mxunit/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>
View
5 tests/mxunit/PluginDemoTests/TestOrdering/AlphabeticallyOrderedTest.cfc
@@ -0,0 +1,5 @@
+
+<!--- the test functions are in the DefaultOrderedTest --->
+<cfcomponent extends="DefaultOrderedTest" mxunit:decorators="mxunit.framework.decorators.AlphabeticallyOrderedTestsDecorator">
+
+</cfcomponent>
View
12 tests/mxunit/PluginDemoTests/TestOrdering/DefaultOrderedTest.cfc
@@ -0,0 +1,12 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="c" returntype="void">
+ </cffunction>
+
+ <cffunction name="b" returntype="void">
+ </cffunction>
+
+ <cffunction name="a" returntype="void">
+ </cffunction>
+
+</cfcomponent>
View
14 tests/mxunit/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>
View
37 tests/mxunit/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>
View
11 tests/mxunit/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>
View
11 tests/mxunit/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>
View
7 tests/mxunit/PluginDemoTests/inheritance/SomeExtendingTest.cfc
@@ -0,0 +1,7 @@
+<cfcomponent extends="BaseTest">
+
+ <cffunction name="TestMyOwnThing">
+ <cfset assertTrue(true)>
+ </cffunction>
+
+</cfcomponent>
View
34 tests/mxunit/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>
View
14 tests/mxunit/PluginDemoTests/weirderrordemos/BustedConstructorTest.cfc
@@ -0,0 +1,14 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cfset mxunit = cool>
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+ </cffunction>
+
+ <cffunction name="thisShouldWorkAllTheTime" returntype="void" access="public">
+ <cfset mxunit = "cool">
+ <cfset debug(mxunit)>
+ </cffunction>
+
+
+</cfcomponent>
View
12 tests/mxunit/PluginDemoTests/weirderrordemos/BustedSetupTest.cfc
@@ -0,0 +1,12 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+ <cfset mxunit = cool>
+ </cffunction>
+
+ <cffunction name="thisShouldWorkAllTheTime" returntype="void" access="public">
+ <cfset mxunit = "cool">
+ <cfset debug(mxunit)>
+ </cffunction>
+
+</cfcomponent>
View
12 tests/mxunit/PluginDemoTests/weirderrordemos/BustedTearDownTest.cfc
@@ -0,0 +1,12 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test">
+ <cfset mxunit = cool>
+ </cffunction>
+
+ <cffunction name="thisShouldWorkAllTheTime" returntype="void" access="public">
+ <cfset mxunit = "cool">
+ <cfset debug(mxunit)>
+ </cffunction>
+
+</cfcomponent>
View
9 tests/mxunit/PluginDemoTests/weirderrordemos/extends/Extends.cfc
@@ -0,0 +1,9 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+ <cfset mxunit = cool>
+ </cffunction>
+
+
+</cfcomponent>
View
8 tests/mxunit/PluginDemoTests/weirderrordemos/extends/SomeTest.cfc
@@ -0,0 +1,8 @@
+<cfcomponent extends="Extends">
+
+ <cffunction name="thisShouldWorkAllTheTime" returntype="void" access="public">
+ <cfset mxunit = "cool">
+ <cfset debug(mxunit)>
+ </cffunction>
+
+</cfcomponent>
View
13 tests/mxunit/README.txt
@@ -0,0 +1,13 @@
+ MXUnit is a unit test framework for CFML.
+
+ Main website: http://mxunit.org
+
+ Docs, etc: http://wiki.mxunit.org
+
+ Bugs and enhancements: http://jira.mxunit.org
+
+ SVN: http://mxunit.googlecode.com/svn/mxunit/trunk
+
+ MXUnit Google Group (to get help): http://groups.google.com/group/mxunit
+
+ Version Info: This is a nightly build of the 2.0.3 stream, built on 09/09/2011
View
47 tests/mxunit/ant/README.txt
@@ -0,0 +1,47 @@
+01-25-08 Using Ant with MXUnit.
+
+Source is available here: http://mxunit.googlecode.com/svn/org.mxunit.ant.idea/
+Get the updated ANT doc here: http://wiki.mxunit.org/display/default/Ant+Task+Doc
+
+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.
+
+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 ...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
View
BIN  tests/mxunit/ant/lib/mxunit-ant.jar
Binary file not shown
View
415 tests/mxunit/ant/mxunit-ant-doc.html
@@ -0,0 +1,415 @@
+<!--
+
+-->
+<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.5</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 a CFML server (ColdFusion, Railo, BlueDragon).
+</p>
+
+<p>
+ This version is also able to handle Http authentication - 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>
+
+
View
104 tests/mxunit/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>
View
20 tests/mxunit/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)
+}
View
53 tests/mxunit/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;
+}
View
875 tests/mxunit/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">