Permalink
Browse files

Renamed other versions of AsUnit to their own package names

  • Loading branch information...
1 parent 386109c commit de9742e640f3e016618b6c9bfcedd82dbfbfde80 @lukebayes lukebayes committed Mar 21, 2010
Showing with 4,389 additions and 0 deletions.
  1. BIN as2/AsUnitUi.swf
  2. 0 {as25 → asunit-2.0}/MIT-LICENSE.txt
  3. 0 {as2 → asunit-2.0}/README.textile
  4. 0 {as2 → asunit-2.0}/Sys.as
  5. 0 {as2 → asunit-2.0}/src/com/asunit/controls/LocalOutputPanel.as
  6. 0 {as2 → asunit-2.0}/src/com/asunit/controls/LocalOutputPanelTest.as
  7. 0 {as2 → asunit-2.0}/src/com/asunit/controls/LocalOutputPanelTextArea.as
  8. 0 {as2 → asunit-2.0}/src/com/asunit/controls/LocalOutputPanelTextAreaTest.as
  9. 0 {as2 → asunit-2.0}/src/com/asunit/controls/LocalOutputPanelTitleBar.as
  10. 0 {as2 → asunit-2.0}/src/com/asunit/controls/ResizeHandle.as
  11. 0 {as2 → asunit-2.0}/src/com/asunit/controls/ScrollArrow.as
  12. 0 {as2 → asunit-2.0}/src/com/asunit/controls/ScrollHandle.as
  13. 0 {as2 → asunit-2.0}/src/com/asunit/controls/ScrollListener.as
  14. 0 {as2 → asunit-2.0}/src/com/asunit/controls/TextScroller.as
  15. 0 {as2 → asunit-2.0}/src/com/asunit/controls/shapes/Rectangle.as
  16. 0 {as2 → asunit-2.0}/src/com/asunit/controls/shapes/Triangle.as
  17. 0 {as2 → asunit-2.0}/src/com/asunit/framework/AsUnit.as
  18. 0 {as2 → asunit-2.0}/src/com/asunit/framework/Assert.as
  19. 0 {as2 → asunit-2.0}/src/com/asunit/framework/Assertion.as
  20. 0 {as2 → asunit-2.0}/src/com/asunit/framework/Reflection.as
  21. 0 {as2 → asunit-2.0}/src/com/asunit/framework/Test.as
  22. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestCase.as
  23. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestCaseXml.as
  24. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestFailure.as
  25. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestResult.as
  26. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestRunner.as
  27. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestSetup.as
  28. 0 {as2 → asunit-2.0}/src/com/asunit/framework/TestSuite.as
  29. 0 {as2 → asunit-2.0}/src/com/asunit/ui/Main.as
  30. 0 {as2 → asunit-2.0}/src/com/asunit/ui/RemoteVersion.as
  31. 0 {as2 → asunit-2.0}/src/com/asunit/ui/SuccessMeter.as
  32. 0 {as2 → asunit-2.0}/src/com/asunit/util/Comparable.as
  33. 0 {as2 → asunit-2.0}/src/com/asunit/util/EventListener.as
  34. 0 {as2 → asunit-2.0}/src/com/asunit/util/EventSource.as
  35. 0 {as2 → asunit-2.0}/src/com/asunit/util/LocalConnClient.as
  36. 0 {as2 → asunit-2.0}/src/com/asunit/util/LocalConnGateway.as
  37. 0 {as2 → asunit-2.0}/src/com/asunit/util/LocalConnServer.as
  38. 0 {as2 → asunit-2.0}/src/com/asunit/util/LocalMessageBroker.as
  39. 0 {as2 → asunit-2.0}/src/com/asunit/util/Observable.as
  40. 0 {as2 → asunit-2.0}/src/com/asunit/util/TextFile.as
  41. 0 {as25 → asunit-2.5}/AsUnitRunner.fla
  42. 0 {as2 → asunit-2.5}/MIT-LICENSE.txt
  43. 0 {as25 → asunit-2.5}/README.textile
  44. 0 {as25 → asunit-2.5}/rakefile.rb
  45. 0 {as25 → asunit-2.5}/src/asunit/errors/AssertionFailedError.as
  46. 0 {as25 → asunit-2.5}/src/asunit/errors/ClassNameUndefinedError.as
  47. 0 {as25 → asunit-2.5}/src/asunit/errors/ClassNotFoundError.as
  48. 0 {as25 → asunit-2.5}/src/asunit/errors/InstanceNotFoundError.as
  49. 0 {as25 → asunit-2.5}/src/asunit/errors/UnimplementedFeatureError.as
  50. 0 {as25 → asunit-2.5}/src/asunit/flash/errors/IllegalOperationError.as
  51. 0 {as25 → asunit-2.5}/src/asunit/flash/events/Event.as
  52. 0 {as25 → asunit-2.5}/src/asunit/flash/events/EventDispatcher.as
  53. 0 {as25 → asunit-2.5}/src/asunit/flash/events/IEventDispatcher.as
  54. 0 {as25 → asunit-2.5}/src/asunit/flash/events/TimerEvent.as
  55. 0 {as25 → asunit-2.5}/src/asunit/flash/utils/Timer.as
  56. 0 {as25 → asunit-2.5}/src/asunit/framework/Assert.as
  57. 0 {as25 → asunit-2.5}/src/asunit/framework/AsyncOperation.as
  58. 0 {as25 → asunit-2.5}/src/asunit/framework/ITestListener.as
  59. 0 {as25 → asunit-2.5}/src/asunit/framework/Test.as
  60. 0 {as25 → asunit-2.5}/src/asunit/framework/TestCase.as
  61. 0 {as25 → asunit-2.5}/src/asunit/framework/TestCaseExample.as
  62. 0 {as25 → asunit-2.5}/src/asunit/framework/TestCaseMock.as
  63. 0 {as25 → asunit-2.5}/src/asunit/framework/TestFailure.as
  64. 0 {as25 → asunit-2.5}/src/asunit/framework/TestListener.as
  65. 0 {as25 → asunit-2.5}/src/asunit/framework/TestMethod.as
  66. 0 {as25 → asunit-2.5}/src/asunit/framework/TestResult.as
  67. 0 {as25 → asunit-2.5}/src/asunit/framework/TestSuite.as
  68. 0 {as25 → asunit-2.5}/src/asunit/runner/BaseTestRunner.as
  69. 0 {as25 → asunit-2.5}/src/asunit/runner/IResultPrinter.as
  70. 0 {as25 → asunit-2.5}/src/asunit/runner/TestSuiteLoader.as
  71. 0 {as25 → asunit-2.5}/src/asunit/runner/Version.as
  72. 0 {as25 → asunit-2.5}/src/asunit/textui/ResultPrinter.as
  73. 0 {as25 → asunit-2.5}/src/asunit/textui/SuccessBar.as
  74. 0 {as25 → asunit-2.5}/src/asunit/textui/TestRunner.as
  75. 0 {as25 → asunit-2.5}/src/asunit/textui/XMLResultPrinter.as
  76. 0 {as25 → asunit-2.5}/src/asunit/textui/XMLTestResult.as
  77. 0 {as25 → asunit-2.5}/src/asunit/util/ArrayIterator.as
  78. 0 {as25 → asunit-2.5}/src/asunit/util/ArrayIteratorTest.as
  79. 0 {as25 → asunit-2.5}/src/asunit/util/ArrayUtil.as
  80. 0 {as25 → asunit-2.5}/src/asunit/util/Iterator.as
  81. 0 {as25 → asunit-2.5}/src/asunit/util/Properties.as
  82. 0 {as25 → asunit-2.5}/test/AllTests.as
  83. 0 {as25 → asunit-2.5}/test/AsUnitRunner.as
  84. 0 {as25 → asunit-2.5}/test/asunit/AllTests.as
  85. 0 {as25 → asunit-2.5}/test/asunit/framework/AllTests.as
  86. 0 {as25 → asunit-2.5}/test/asunit/framework/AssertTest.as
  87. 0 {as25 → asunit-2.5}/test/asunit/framework/AsyncMethodTest.as
  88. 0 {as25 → asunit-2.5}/test/asunit/framework/MockData.xml
  89. 0 {as25 → asunit-2.5}/test/asunit/framework/TestCaseStub.as
  90. 0 {as25 → asunit-2.5}/test/asunit/framework/TestCaseTest.as
  91. 0 {as25 → asunit-2.5}/test/asunit/framework/TestFailureTest.as
  92. 0 {as25 → asunit-2.5}/test/asunit/framework/VisualTestCaseTest.as
  93. 0 {as25 → asunit-2.5}/test/asunit/runner/BaseTestRunnerMock.as
  94. 0 {as25 → asunit-2.5}/test/asunit/textui/AllTests.as
  95. 0 {as25 → asunit-2.5}/test/asunit/textui/TestRunnerTest.as
  96. 0 {as25 → asunit-2.5}/test/asunit/textui/TestRunnerTestCaseMock.as
  97. 0 {as25 → asunit-2.5}/test/asunit/util/AllTests.as
  98. 0 {as25 → asunit-2.5}/test/asunit/util/ArrayIteratorTest.as
  99. +22 −0 asunit-3.0/MIT-LICENSE.txt
  100. +9 −0 asunit-3.0/README.textile
  101. +52 −0 asunit-3.0/examples/asunit/framework/AsynchronousTestMethodExample.as
  102. +42 −0 asunit-3.0/examples/asunit/framework/ComponentTestExample.as
  103. +21 −0 asunit-3.0/examples/asunit/framework/ComponentTestIntroduction.as
  104. +50 −0 asunit-3.0/examples/asunit/framework/ComponentUnderTest.as
  105. +12 −0 asunit-3.0/examples/asunit/framework/MathUtil.as
  106. +44 −0 asunit-3.0/examples/asunit/framework/MathUtilTest.as
  107. +15 −0 asunit-3.0/examples/asunit/framework/TestSuiteExample.as
  108. +24 −0 asunit-3.0/examples/asunit/textui/AirRunnerExample.mxml
  109. +24 −0 asunit-3.0/examples/asunit/textui/FlexRunnerExample.mxml
  110. +15 −0 asunit-3.0/examples/asunit/textui/TestRunnerExample.as
  111. +17 −0 asunit-3.0/examples/asunit/textui/XMLResultPrinterExample.as
  112. +13 −0 asunit-3.0/examples/asunit/textui/XMLResultPrinterExample.xml
  113. +65 −0 asunit-3.0/rakefile.rb
  114. +64 −0 asunit-3.0/src/AsUnit.as
  115. +10 −0 asunit-3.0/src/asunit/errors/AbstractError.as
  116. +10 −0 asunit-3.0/src/asunit/errors/AssertionFailedError.as
  117. +10 −0 asunit-3.0/src/asunit/errors/ClassNotFoundError.as
  118. +10 −0 asunit-3.0/src/asunit/errors/InstanceNotFoundError.as
  119. +10 −0 asunit-3.0/src/asunit/errors/UnimplementedFeatureError.as
  120. +408 −0 asunit-3.0/src/asunit/framework/Assert.as
  121. +60 −0 asunit-3.0/src/asunit/framework/AsyncOperation.as
  122. +51 −0 asunit-3.0/src/asunit/framework/AsynchronousHTTPServiceTestCase.as
  123. +161 −0 asunit-3.0/src/asunit/framework/AsynchronousTestCase.as
  124. +82 −0 asunit-3.0/src/asunit/framework/AsynchronousTestCaseExample.as
  125. +186 −0 asunit-3.0/src/asunit/framework/RemotingTestCase.as
  126. +18 −0 asunit-3.0/src/asunit/framework/Test.as
  127. +499 −0 asunit-3.0/src/asunit/framework/TestCase.as
  128. +73 −0 asunit-3.0/src/asunit/framework/TestCaseExample.as
  129. +58 −0 asunit-3.0/src/asunit/framework/TestFailure.as
  130. +35 −0 asunit-3.0/src/asunit/framework/TestListener.as
  131. +38 −0 asunit-3.0/src/asunit/framework/TestMethod.as
  132. +174 −0 asunit-3.0/src/asunit/framework/TestResult.as
  133. +113 −0 asunit-3.0/src/asunit/framework/TestSuite.as
  134. +18 −0 asunit-3.0/src/asunit/runner/BaseTestRunner.as
  135. +9 −0 asunit-3.0/src/asunit/runner/TestSuiteLoader.as
  136. +11 −0 asunit-3.0/src/asunit/runner/Version.as
  137. +28 −0 asunit-3.0/src/asunit/textui/AirRunner.as
  138. +25 −0 asunit-3.0/src/asunit/textui/FlexRunner.as
  139. +58 −0 asunit-3.0/src/asunit/textui/FlexTestRunner.as
  140. +298 −0 asunit-3.0/src/asunit/textui/ResultPrinter.as
  141. +174 −0 asunit-3.0/src/asunit/textui/TestRunner.as
  142. +68 −0 asunit-3.0/src/asunit/textui/TestTime.as
  143. +204 −0 asunit-3.0/src/asunit/textui/XMLResultPrinter.as
  144. +26 −0 asunit-3.0/src/asunit/util/ArrayIterator.as
  145. +9 −0 asunit-3.0/src/asunit/util/Iterator.as
  146. +30 −0 asunit-3.0/src/asunit/util/Properties.as
  147. +11 −0 asunit-3.0/test/AllTests.as
  148. +10 −0 asunit-3.0/test/AsUnitRunner.as
  149. +15 −0 asunit-3.0/test/asunit/AllTests.as
  150. +27 −0 asunit-3.0/test/asunit/framework/AllTests.as
  151. +92 −0 asunit-3.0/test/asunit/framework/AssertEqualsArraysIgnoringOrderTest.as
  152. +82 −0 asunit-3.0/test/asunit/framework/AssertEqualsArraysTest.as
  153. +184 −0 asunit-3.0/test/asunit/framework/AssertTest.as
  154. +42 −0 asunit-3.0/test/asunit/framework/AssertThrowsTest.as
  155. +55 −0 asunit-3.0/test/asunit/framework/AsyncFailureTest.as
  156. +71 −0 asunit-3.0/test/asunit/framework/AsyncMethodTest.as
  157. +8 −0 asunit-3.0/test/asunit/framework/MockData.xml
  158. +24 −0 asunit-3.0/test/asunit/framework/TestCaseMock.as
  159. +91 −0 asunit-3.0/test/asunit/framework/TestCaseTest.as
  160. +14 −0 asunit-3.0/test/asunit/framework/TestFailureTest.as
  161. +43 −0 asunit-3.0/test/asunit/framework/VisualTestCaseTest.as
  162. +19 −0 asunit-3.0/test/asunit/framework/assertAssertionFailed.as
  163. +6 −0 asunit-3.0/test/asunit/runner/BaseTestRunnerMock.as
  164. +11 −0 asunit-3.0/test/asunit/textui/AllTests.as
  165. +25 −0 asunit-3.0/test/asunit/textui/TestRunnerTest.as
  166. +30 −0 asunit-3.0/test/asunit/textui/TestRunnerTestCaseMock.as
  167. +11 −0 asunit-3.0/test/asunit/util/AllTests.as
  168. +65 −0 asunit-3.0/test/asunit/util/ArrayIteratorTest.as
View
BIN as2/AsUnitUi.swf
Binary file not shown.
View
0 as25/MIT-LICENSE.txt → asunit-2.0/MIT-LICENSE.txt
File renamed without changes.
View
0 as2/README.textile → asunit-2.0/README.textile
File renamed without changes.
View
0 as2/Sys.as → asunit-2.0/Sys.as
File renamed without changes.
View
0 ...c/com/asunit/controls/LocalOutputPanel.as → ...c/com/asunit/controls/LocalOutputPanel.as
File renamed without changes.
View
0 ...m/asunit/controls/LocalOutputPanelTest.as → ...m/asunit/controls/LocalOutputPanelTest.as
File renamed without changes.
View
0 ...unit/controls/LocalOutputPanelTextArea.as → ...unit/controls/LocalOutputPanelTextArea.as
File renamed without changes.
View
0 .../controls/LocalOutputPanelTextAreaTest.as → .../controls/LocalOutputPanelTextAreaTest.as
File renamed without changes.
View
0 ...unit/controls/LocalOutputPanelTitleBar.as → ...unit/controls/LocalOutputPanelTitleBar.as
File renamed without changes.
View
0 as2/src/com/asunit/controls/ResizeHandle.as → ...0/src/com/asunit/controls/ResizeHandle.as
File renamed without changes.
View
0 as2/src/com/asunit/controls/ScrollArrow.as → ....0/src/com/asunit/controls/ScrollArrow.as
File renamed without changes.
View
0 as2/src/com/asunit/controls/ScrollHandle.as → ...0/src/com/asunit/controls/ScrollHandle.as
File renamed without changes.
View
0 ...src/com/asunit/controls/ScrollListener.as → ...src/com/asunit/controls/ScrollListener.as
File renamed without changes.
View
0 as2/src/com/asunit/controls/TextScroller.as → ...0/src/com/asunit/controls/TextScroller.as
File renamed without changes.
View
0 ...c/com/asunit/controls/shapes/Rectangle.as → ...c/com/asunit/controls/shapes/Rectangle.as
File renamed without changes.
View
0 ...rc/com/asunit/controls/shapes/Triangle.as → ...rc/com/asunit/controls/shapes/Triangle.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/AsUnit.as → ...it-2.0/src/com/asunit/framework/AsUnit.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/Assert.as → ...it-2.0/src/com/asunit/framework/Assert.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/Assertion.as → ...2.0/src/com/asunit/framework/Assertion.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/Reflection.as → ....0/src/com/asunit/framework/Reflection.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/Test.as → asunit-2.0/src/com/asunit/framework/Test.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestCase.as → ...-2.0/src/com/asunit/framework/TestCase.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestCaseXml.as → ...0/src/com/asunit/framework/TestCaseXml.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestFailure.as → ...0/src/com/asunit/framework/TestFailure.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestResult.as → ....0/src/com/asunit/framework/TestResult.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestRunner.as → ....0/src/com/asunit/framework/TestRunner.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestSetup.as → ...2.0/src/com/asunit/framework/TestSetup.as
File renamed without changes.
View
0 as2/src/com/asunit/framework/TestSuite.as → ...2.0/src/com/asunit/framework/TestSuite.as
File renamed without changes.
View
0 as2/src/com/asunit/ui/Main.as → asunit-2.0/src/com/asunit/ui/Main.as
File renamed without changes.
View
0 as2/src/com/asunit/ui/RemoteVersion.as → ...it-2.0/src/com/asunit/ui/RemoteVersion.as
File renamed without changes.
View
0 as2/src/com/asunit/ui/SuccessMeter.as → asunit-2.0/src/com/asunit/ui/SuccessMeter.as
File renamed without changes.
View
0 as2/src/com/asunit/util/Comparable.as → asunit-2.0/src/com/asunit/util/Comparable.as
File renamed without changes.
View
0 as2/src/com/asunit/util/EventListener.as → ...-2.0/src/com/asunit/util/EventListener.as
File renamed without changes.
View
0 as2/src/com/asunit/util/EventSource.as → ...it-2.0/src/com/asunit/util/EventSource.as
File renamed without changes.
View
0 as2/src/com/asunit/util/LocalConnClient.as → ....0/src/com/asunit/util/LocalConnClient.as
File renamed without changes.
View
0 as2/src/com/asunit/util/LocalConnGateway.as → ...0/src/com/asunit/util/LocalConnGateway.as
File renamed without changes.
View
0 as2/src/com/asunit/util/LocalConnServer.as → ....0/src/com/asunit/util/LocalConnServer.as
File renamed without changes.
View
0 ...src/com/asunit/util/LocalMessageBroker.as → ...src/com/asunit/util/LocalMessageBroker.as
File renamed without changes.
View
0 as2/src/com/asunit/util/Observable.as → asunit-2.0/src/com/asunit/util/Observable.as
File renamed without changes.
View
0 as2/src/com/asunit/util/TextFile.as → asunit-2.0/src/com/asunit/util/TextFile.as
File renamed without changes.
View
0 as25/AsUnitRunner.fla → asunit-2.5/AsUnitRunner.fla
File renamed without changes.
View
0 as2/MIT-LICENSE.txt → asunit-2.5/MIT-LICENSE.txt
File renamed without changes.
View
0 as25/README.textile → asunit-2.5/README.textile
File renamed without changes.
View
0 as25/rakefile.rb → asunit-2.5/rakefile.rb
File renamed without changes.
View
0 ...src/asunit/errors/AssertionFailedError.as → ...src/asunit/errors/AssertionFailedError.as
File renamed without changes.
View
0 .../asunit/errors/ClassNameUndefinedError.as → .../asunit/errors/ClassNameUndefinedError.as
File renamed without changes.
View
0 as25/src/asunit/errors/ClassNotFoundError.as → ...5/src/asunit/errors/ClassNotFoundError.as
File renamed without changes.
View
0 ...rc/asunit/errors/InstanceNotFoundError.as → ...rc/asunit/errors/InstanceNotFoundError.as
File renamed without changes.
View
0 ...sunit/errors/UnimplementedFeatureError.as → ...sunit/errors/UnimplementedFeatureError.as
File renamed without changes.
View
0 ...nit/flash/errors/IllegalOperationError.as → ...nit/flash/errors/IllegalOperationError.as
File renamed without changes.
View
0 as25/src/asunit/flash/events/Event.as → asunit-2.5/src/asunit/flash/events/Event.as
File renamed without changes.
View
0 ...rc/asunit/flash/events/EventDispatcher.as → ...rc/asunit/flash/events/EventDispatcher.as
File renamed without changes.
View
0 ...c/asunit/flash/events/IEventDispatcher.as → ...c/asunit/flash/events/IEventDispatcher.as
File renamed without changes.
View
0 as25/src/asunit/flash/events/TimerEvent.as → ...2.5/src/asunit/flash/events/TimerEvent.as
File renamed without changes.
View
0 as25/src/asunit/flash/utils/Timer.as → asunit-2.5/src/asunit/flash/utils/Timer.as
File renamed without changes.
View
0 as25/src/asunit/framework/Assert.as → asunit-2.5/src/asunit/framework/Assert.as
File renamed without changes.
View
0 as25/src/asunit/framework/AsyncOperation.as → ....5/src/asunit/framework/AsyncOperation.as
File renamed without changes.
View
0 as25/src/asunit/framework/ITestListener.as → ...2.5/src/asunit/framework/ITestListener.as
File renamed without changes.
View
0 as25/src/asunit/framework/Test.as → asunit-2.5/src/asunit/framework/Test.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestCase.as → asunit-2.5/src/asunit/framework/TestCase.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestCaseExample.as → ...5/src/asunit/framework/TestCaseExample.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestCaseMock.as → ...-2.5/src/asunit/framework/TestCaseMock.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestFailure.as → ...t-2.5/src/asunit/framework/TestFailure.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestListener.as → ...-2.5/src/asunit/framework/TestListener.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestMethod.as → ...it-2.5/src/asunit/framework/TestMethod.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestResult.as → ...it-2.5/src/asunit/framework/TestResult.as
File renamed without changes.
View
0 as25/src/asunit/framework/TestSuite.as → asunit-2.5/src/asunit/framework/TestSuite.as
File renamed without changes.
View
0 as25/src/asunit/runner/BaseTestRunner.as → ...t-2.5/src/asunit/runner/BaseTestRunner.as
File renamed without changes.
View
0 as25/src/asunit/runner/IResultPrinter.as → ...t-2.5/src/asunit/runner/IResultPrinter.as
File renamed without changes.
View
0 as25/src/asunit/runner/TestSuiteLoader.as → ...-2.5/src/asunit/runner/TestSuiteLoader.as
File renamed without changes.
View
0 as25/src/asunit/runner/Version.as → asunit-2.5/src/asunit/runner/Version.as
File renamed without changes.
View
0 as25/src/asunit/textui/ResultPrinter.as → ...it-2.5/src/asunit/textui/ResultPrinter.as
File renamed without changes.
View
0 as25/src/asunit/textui/SuccessBar.as → asunit-2.5/src/asunit/textui/SuccessBar.as
File renamed without changes.
View
0 as25/src/asunit/textui/TestRunner.as → asunit-2.5/src/asunit/textui/TestRunner.as
File renamed without changes.
View
0 as25/src/asunit/textui/XMLResultPrinter.as → ...2.5/src/asunit/textui/XMLResultPrinter.as
File renamed without changes.
View
0 as25/src/asunit/textui/XMLTestResult.as → ...it-2.5/src/asunit/textui/XMLTestResult.as
File renamed without changes.
View
0 as25/src/asunit/util/ArrayIterator.as → asunit-2.5/src/asunit/util/ArrayIterator.as
File renamed without changes.
View
0 as25/src/asunit/util/ArrayIteratorTest.as → ...-2.5/src/asunit/util/ArrayIteratorTest.as
File renamed without changes.
View
0 as25/src/asunit/util/ArrayUtil.as → asunit-2.5/src/asunit/util/ArrayUtil.as
File renamed without changes.
View
0 as25/src/asunit/util/Iterator.as → asunit-2.5/src/asunit/util/Iterator.as
File renamed without changes.
View
0 as25/src/asunit/util/Properties.as → asunit-2.5/src/asunit/util/Properties.as
File renamed without changes.
View
0 as25/test/AllTests.as → asunit-2.5/test/AllTests.as
File renamed without changes.
View
0 as25/test/AsUnitRunner.as → asunit-2.5/test/AsUnitRunner.as
File renamed without changes.
View
0 as25/test/asunit/AllTests.as → asunit-2.5/test/asunit/AllTests.as
File renamed without changes.
View
0 as25/test/asunit/framework/AllTests.as → asunit-2.5/test/asunit/framework/AllTests.as
File renamed without changes.
View
0 as25/test/asunit/framework/AssertTest.as → ...t-2.5/test/asunit/framework/AssertTest.as
File renamed without changes.
View
0 .../test/asunit/framework/AsyncMethodTest.as → .../test/asunit/framework/AsyncMethodTest.as
File renamed without changes.
View
0 as25/test/asunit/framework/MockData.xml → ...it-2.5/test/asunit/framework/MockData.xml
File renamed without changes.
View
0 as25/test/asunit/framework/TestCaseStub.as → ...2.5/test/asunit/framework/TestCaseStub.as
File renamed without changes.
View
0 as25/test/asunit/framework/TestCaseTest.as → ...2.5/test/asunit/framework/TestCaseTest.as
File renamed without changes.
View
0 .../test/asunit/framework/TestFailureTest.as → .../test/asunit/framework/TestFailureTest.as
File renamed without changes.
View
0 ...st/asunit/framework/VisualTestCaseTest.as → ...st/asunit/framework/VisualTestCaseTest.as
File renamed without changes.
View
0 .../test/asunit/runner/BaseTestRunnerMock.as → .../test/asunit/runner/BaseTestRunnerMock.as
File renamed without changes.
View
0 as25/test/asunit/textui/AllTests.as → asunit-2.5/test/asunit/textui/AllTests.as
File renamed without changes.
View
0 as25/test/asunit/textui/TestRunnerTest.as → ...-2.5/test/asunit/textui/TestRunnerTest.as
File renamed without changes.
View
0 ...t/asunit/textui/TestRunnerTestCaseMock.as → ...t/asunit/textui/TestRunnerTestCaseMock.as
File renamed without changes.
View
0 as25/test/asunit/util/AllTests.as → asunit-2.5/test/asunit/util/AllTests.as
File renamed without changes.
View
0 as25/test/asunit/util/ArrayIteratorTest.as → ...2.5/test/asunit/util/ArrayIteratorTest.as
File renamed without changes.
View
22 asunit-3.0/MIT-LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (c) <year> <copyright holders>
+
+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
9 asunit-3.0/README.textile
@@ -0,0 +1,9 @@
+
+h1. AsUnit 3.x
+
+This build of the AsUnit test framework should support Flash Players 9, 10 and Adobe AIR.
+
+This framework includes runner base classes for ActionScript 3, Flex MXML or Adobe AIR test runners.
+
+
+
View
52 asunit-3.0/examples/asunit/framework/AsynchronousTestMethodExample.as
@@ -0,0 +1,52 @@
+//Assume we have a feature that performs some asynchronous action:
+
+package net {
+
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+ import flash.utils.setTimeout;
+
+ [Event(name="complete", type="flash.events.Event")]
+ public class AsyncMethod extends EventDispatcher {
+
+ public function doSomething():void {
+ setTimeout(function():void {
+ dispatchEvent(new Event(Event.COMPLETE));
+ }, 100);
+ }
+ }
+}
+
+//We can test this feature with the following test case:
+package net {
+
+ import asunit.framework.TestCase;
+ import flash.events.Event;
+
+ public class AsyncMethodTest extends TestCase {
+ private var instance:AsyncMethod;
+
+ public function AsyncMethodTest(methodName:String=null) {
+ super(methodName)
+ }
+
+ override protected function setUp():void {
+ super.setUp();
+ instance = new AsyncMethod();
+ }
+
+ override protected function tearDown():void {
+ super.tearDown();
+ instance = null;
+ }
+
+ public function testInstantiated():void {
+ assertTrue("instance is AsyncMethod", instance is AsyncMethod);
+ }
+
+ public function testDoSomething():void {
+ instance.addEventListener(Event.COMPLETE, addAsync());
+ instance.doSomething();
+ }
+ }
+}
View
42 asunit-3.0/examples/asunit/framework/ComponentTestExample.as
@@ -0,0 +1,42 @@
+/*
+And finally, the test case that will validate the ViewComponent class and
+it's goToHalfSize method.
+*/
+
+package controls {
+
+ import asunit.framework.TestCase;
+
+ public class ViewComponentTest extends TestCase {
+ private var instance:ViewComponent;
+
+ public function ViewComponentTest(methodName:String=null) {
+ super(methodName)
+ }
+
+ override protected function setUp():void {
+ super.setUp();
+ instance = new ViewComponent();
+ addChild(instance);
+ }
+
+ override protected function tearDown():void {
+ super.tearDown();
+ removeChild(instance);
+ instance = null;
+ }
+
+ public function testInstantiated():void {
+ assertTrue("instance is ViewComponent", instance is ViewComponent);
+ }
+
+ public function testGoToHalfSize():void {
+ instance.width = 400;
+ instance.height = 200;
+ instance.goToHalfSize();
+
+ assertEquals('width', 200, instance.width);
+ assertEquals('height', 100, instance.height);
+ }
+ }
+}
View
21 asunit-3.0/examples/asunit/framework/ComponentTestIntroduction.as
@@ -0,0 +1,21 @@
+/*
+For the purpose of the following test example, we'll be using a Runner that
+looks like this:
+*/
+
+package {
+ import asunit.textui.TestRunner;
+ import controls.ViewComponentTest;
+
+ public class SomeProjectRunner extends TestRunner {
+
+ public function SomeProjectRunner() {
+ // start(clazz:Class, methodName:String, showTrace:Boolean)
+ // NOTE: sending a particular class and method name will
+ // execute setUp(), the method and NOT tearDown.
+ // This allows you to get visual confirmation while developing
+ // visual entities
+ start(ViewComponentTest, 'testGoToHalfSize', TestRunner.SHOW_TRACE);
+ }
+ }
+}
View
50 asunit-3.0/examples/asunit/framework/ComponentUnderTest.as
@@ -0,0 +1,50 @@
+/*
+The following Component is a visual component whose primary feature
+is the 'goToHalfSize' method.
+*/
+
+package controls {
+
+ import flash.display.Sprite;
+ import flash.events.Event;
+
+ public class ViewComponent extends Sprite {
+
+ private var _width:Number;
+ private var _height:Number;
+
+ public function ViewComponent() {
+ _width = 640;
+ _height = 480;
+ }
+
+ public function draw():void {
+ graphics.clear();
+ graphics.beginFill(0xFFCC00);
+ graphics.drawRect(0, 0, width, height);
+ graphics.endFill();
+ }
+
+ public function goToHalfSize():void {
+ width = Math.round(width / 2);
+ height = Math.round(height / 2);
+ draw();
+ }
+
+ override public function set width(width:Number):void {
+ _width = width;
+ }
+
+ override public function get width():Number {
+ return _width;
+ }
+
+ override public function set height(height:Number):void {
+ _height = height;
+ }
+
+ override public function get height():Number {
+ return _height;
+ }
+ }
+}
View
12 asunit-3.0/examples/asunit/framework/MathUtil.as
@@ -0,0 +1,12 @@
+package utils {
+
+ public class MathUtil {
+
+ public function MathUtil() {
+ }
+
+ public function addOne(num:Number):Number {
+ return num + 1;
+ }
+ }
+}
View
44 asunit-3.0/examples/asunit/framework/MathUtilTest.as
@@ -0,0 +1,44 @@
+// Assume we are testing a class that looks like this:
+package utils {
+
+ public class MathUtil {
+
+ // Add one to the number provided:
+ public function addOne(num:Number):Number {
+ return num + 1;
+ }
+ }
+}
+
+
+// This is a test case for the class above:
+package utils {
+
+ import asunit.framework.TestCase;
+
+ public class MathUtilTest extends TestCase {
+ private var mathUtil:MathUtil;
+
+ public function MathUtilTest(methodName:String=null) {
+ super(methodName)
+ }
+
+ override protected function setUp():void {
+ super.setUp();
+ mathUtil = new MathUtil();
+ }
+
+ override protected function tearDown():void {
+ super.tearDown();
+ mathUtil = null;
+ }
+
+ public function testInstantiated():void {
+ assertTrue("mathUtil is MathUtil", mathUtil is MathUtil);
+ }
+
+ public function testAddOne():void {
+ assertEquals(5, mathUtil.addOne(4));
+ }
+ }
+}
View
15 asunit-3.0/examples/asunit/framework/TestSuiteExample.as
@@ -0,0 +1,15 @@
+package {
+ import asunit.framework.TestSuite;
+ import errors.CustomErrorTest;
+ import net.CustomRequestTest;
+ import net.CustomServiceTest;
+
+ public class AllTests extends TestSuite {
+
+ public function AllTests() {
+ addTest(new errors.CustomErrorTest());
+ addTest(new net.CustomRequestTest());
+ addTest(new net.CustomServiceTest());
+ }
+ }
+}
View
24 asunit-3.0/examples/asunit/textui/AirRunnerExample.mxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<AirRunner
+ xmlns="asunit.textui.*"
+ xmlns:mx="http://www.adobe.com/2006/mxml"
+ creationComplete="runTests()"
+ >
+ <!-- Import Application Styles -->
+ <mx:Style source="MyProjectSkin.css" />
+ <mx:Script>
+ <![CDATA[
+ import asunit.textui.TestRunner;
+
+ public function runTests():void {
+
+ // start(clazz:Class, methodName:String, showTrace:Boolean)
+ // NOTE: sending a particular class and method name will
+ // execute setUp(), the method and NOT tearDown.
+ // This allows you to get visual confirmation while developing
+ // visual entities
+ start(AllTests, null, TestRunner.SHOW_TRACE);
+ }
+ ]]>
+ </mx:Script>
+</AirRunner>
View
24 asunit-3.0/examples/asunit/textui/FlexRunnerExample.mxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FlexRunner
+ xmlns="asunit.textui.*"
+ xmlns:mx="http://www.adobe.com/2006/mxml"
+ creationComplete="runTests()"
+ >
+ <!-- Import Application Styles -->
+ <mx:Style source="MyProjectSkin.css" />
+ <mx:Script>
+ <![CDATA[
+ import asunit.textui.TestRunner;
+
+ public function runTests():void {
+
+ // start(clazz:Class, methodName:String, showTrace:Boolean)
+ // NOTE: sending a particular class and method name will
+ // execute setUp(), the method and NOT tearDown.
+ // This allows you to get visual confirmation while developing
+ // visual entities
+ start(AllTests, null, TestRunner.SHOW_TRACE);
+ }
+ ]]>
+ </mx:Script>
+</FlexRunner>
View
15 asunit-3.0/examples/asunit/textui/TestRunnerExample.as
@@ -0,0 +1,15 @@
+package {
+ import asunit.textui.TestRunner;
+
+ public class SomeProjectRunner extends TestRunner {
+
+ public function SomeProjectRunner() {
+ // start(clazz:Class, methodName:String, showTrace:Boolean)
+ // NOTE: sending a particular class and method name will
+ // execute setUp(), the method and NOT tearDown.
+ // This allows you to get visual confirmation while developing
+ // visual entities
+ start(AllTests, null, TestRunner.SHOW_TRACE);
+ }
+ }
+}
View
17 asunit-3.0/examples/asunit/textui/XMLResultPrinterExample.as
@@ -0,0 +1,17 @@
+package {
+ import asunit.textui.TestRunner;
+ import asunit.textui.XMLResultPrinter;
+
+ public class XMLResultPrinterExample extends TestRunner {
+
+ public function XMLResultPrinterExample() {
+ // start(clazz:Class, methodName:String, showTrace:Boolean)
+ // NOTE: sending a particular class and method name will
+ // execute setUp(), the method and NOT tearDown.
+ // This allows you to get visual confirmation while developing
+ // visual entities
+ setPrinter(new XMLResultPrinter());
+ start(AllTests, null, TestRunner.SHOW_TRACE);
+ }
+ }
+}
View
13 asunit-3.0/examples/asunit/textui/XMLResultPrinterExample.xml
@@ -0,0 +1,13 @@
+<testsuites>
+ <testsuite name="Flash Profile Card AsUnit Test Suite" errors="1" failures="1" tests="8" time="8.002">
+ <testcase classname="lib.test.cases.FailureTest" name="testError" time="0.049">
+ <error type="java.lang.NullPointerException">
+ <!-- stack trace -->
+ </error>
+ <failure type="Error">Reference runtime test error</failure>
+ </testcase>
+ <testcase classname="lib.test.cases.FailureTest" name="testAssertion">
+ <failure type="AssertionFailedError">Reference assertion test failure</failure>
+ </testcase>
+ </testsuite>
+</testsuites>
View
65 asunit-3.0/rakefile.rb
@@ -0,0 +1,65 @@
+require 'sprout'
+sprout 'as3'
+
+ASUNIT_VERSION = '2.8'
+
+##########################################
+# To build from this file, install Ruby (http://ruby-lang.org)
+# and RubyGems (http://rubygems.org/), then run:
+# gem install sprout
+# gem install rake
+# rake
+# This should walk you through the installation
+# of required gems, compilers and vms
+
+##########################################
+# Compile the Test Harness
+
+desc "Compile the test harness"
+mxmlc 'bin/AsUnitRunner.swf' do |t|
+ t.default_size = '1000 600'
+ t.source_path << 'src'
+ t.input = 'test/AsUnitRunner.as'
+end
+
+##########################################
+# Generate documentation
+
+desc "Generate documentation"
+asdoc 'doc' do |t|
+ t.appended_args = '-examples-path=examples'
+ t.source_path << 'src'
+ t.doc_classes << 'AsUnit'
+
+ # Include air swcs to avoid failures
+ # on AirRunner:
+ t.library_path << 'lib/airglobal.swc'
+ t.library_path << 'lib/airframework.swc'
+end
+
+##########################################
+# Launch the Test Harness
+
+desc "Compile and run the test harness"
+flashplayer :run => 'bin/AsUnitRunner.swf'
+
+##########################################
+# Package framework ZIPs and SWCs
+
+archive = "bin/asunit3.#{ASUNIT_VERSION}.zip"
+
+zip archive do |t|
+ t.input = 'src/asunit'
+ puts "Created zip archive at: #{archive}"
+end
+
+desc "Create zip archives"
+task :zip => archive
+
+##########################################
+# Set up task wrappers
+
+task :default => :run
+
+desc "Alias to the default task"
+task :test => :run
View
64 asunit-3.0/src/AsUnit.as
@@ -0,0 +1,64 @@
+package {
+ import asunit.errors.AssertionFailedError;
+ import asunit.errors.ClassNotFoundError;
+ import asunit.errors.InstanceNotFoundError;
+ import asunit.errors.UnimplementedFeatureError;
+ import asunit.framework.Assert;
+ import asunit.framework.AsynchronousTestCase;
+ import asunit.framework.AsynchronousTestCaseExample;
+ import asunit.framework.AsyncOperation;
+ import asunit.framework.RemotingTestCase;
+ import asunit.framework.Test;
+ import asunit.framework.TestCase;
+ import asunit.framework.TestCaseExample;
+ import asunit.framework.TestFailure;
+ import asunit.framework.TestListener;
+ import asunit.framework.TestMethod;
+ import asunit.framework.TestResult;
+ import asunit.framework.TestSuite;
+ import asunit.runner.BaseTestRunner;
+ import asunit.runner.TestSuiteLoader;
+ import asunit.runner.Version;
+ import asunit.textui.AirRunner;
+ import asunit.textui.FlexRunner;
+ import asunit.textui.FlexTestRunner;
+ import asunit.textui.ResultPrinter;
+ import asunit.textui.TestRunner;
+ import asunit.textui.XMLResultPrinter;
+ import asunit.util.ArrayIterator;
+ import asunit.util.Iterator;
+ import asunit.util.Properties;
+
+ public class AsUnit {
+ private var assertionFailedError:AssertionFailedError;
+ private var classNotFoundError:ClassNotFoundError;
+ private var instanceNotFoundError:InstanceNotFoundError;
+ private var unimplementedFeatureError:UnimplementedFeatureError;
+ private var assert:Assert;
+ private var asynchronousTestCase:AsynchronousTestCase;
+ private var asynchronousTestCaseExample:AsynchronousTestCaseExample;
+ private var asyncOperation:AsyncOperation;
+ private var remotingTestCase:RemotingTestCase;
+ private var test:Test;
+ private var testCase:TestCase;
+ private var testCaseExample:TestCaseExample;
+ private var testFailure:TestFailure;
+ private var testListener:TestListener;
+ private var testMethod:TestMethod;
+ private var testResult:TestResult;
+ private var testSuite:TestSuite;
+ private var baseTestRunner:BaseTestRunner;
+ private var testSuiteLoader:TestSuiteLoader;
+ private var version:Version;
+ private var airRunner:AirRunner;
+ private var flexRunner:FlexRunner;
+ private var flexTestRunner:FlexTestRunner;
+ private var resultPrinter:ResultPrinter;
+ private var testRunner:TestRunner;
+ private var xMLResultPrinter:XMLResultPrinter;
+ private var arrayIterator:ArrayIterator;
+ private var iterator:Iterator;
+ private var properties:Properties;
+ private var asUnit:AsUnit;
+ }
+}
View
10 asunit-3.0/src/asunit/errors/AbstractError.as
@@ -0,0 +1,10 @@
+package asunit.errors {
+
+ public class AbstractError extends Error {
+
+ public function AbstractError(message:String) {
+ super(message);
+ name = "AbstractError";
+ }
+ }
+}
View
10 asunit-3.0/src/asunit/errors/AssertionFailedError.as
@@ -0,0 +1,10 @@
+package asunit.errors {
+
+ public class AssertionFailedError extends Error {
+
+ public function AssertionFailedError(message:String) {
+ super(message);
+ name = "AssertionFailedError";
+ }
+ }
+}
View
10 asunit-3.0/src/asunit/errors/ClassNotFoundError.as
@@ -0,0 +1,10 @@
+package asunit.errors {
+
+ public class ClassNotFoundError extends Error {
+
+ public function ClassNotFoundError(message:String) {
+ super(message);
+ name = "ClassNotFoundError";
+ }
+ }
+}
View
10 asunit-3.0/src/asunit/errors/InstanceNotFoundError.as
@@ -0,0 +1,10 @@
+package asunit.errors {
+
+ public class InstanceNotFoundError extends Error {
+
+ public function InstanceNotFoundError(message:String) {
+ super(message);
+ name = "InstanceNotFoundError";
+ }
+ }
+}
View
10 asunit-3.0/src/asunit/errors/UnimplementedFeatureError.as
@@ -0,0 +1,10 @@
+package asunit.errors {
+
+ public class UnimplementedFeatureError extends Error {
+
+ public function UnimplementedFeatureError(message:String) {
+ super(message);
+ name = "UnimplementedFeatureError";
+ }
+ }
+}
View
408 asunit-3.0/src/asunit/framework/Assert.as
@@ -0,0 +1,408 @@
+package asunit.framework {
+ import asunit.errors.AssertionFailedError;
+
+ import flash.utils.getQualifiedClassName;
+
+ import flash.errors.IllegalOperationError;
+ import flash.events.EventDispatcher;
+
+ /**
+ * A set of assert methods. Messages are only displayed when an assert fails.
+ */
+
+ public class Assert extends EventDispatcher {
+ /**
+ * Protect constructor since it is a static only class
+ */
+ public function Assert() {
+ }
+
+ /**
+ * Asserts that a condition is true. If it isn't it throws
+ * an AssertionFailedError with the given message.
+ */
+ static public function assertTrue(...args:Array):void {
+ var message:String;
+ var actual:Object;
+
+ if(args.length == 1) {
+ message = "";
+ actual = args[0];
+ }
+ else if(args.length == 2) {
+ message = args[0];
+ actual = args[1];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(!actual) {
+ throw new AssertionFailedError(format(message, true, actual));
+ }
+ }
+ /**
+ * Asserts that a condition is false. If it isn't it throws
+ * an AssertionFailedError with the given message.
+ */
+ static public function assertFalse(...args:Array):void {
+ var message:String;
+ var actual:Object;
+
+ if(args.length == 1) {
+ message = "";
+ actual = args[0];
+ }
+ else if(args.length == 2) {
+ message = args[0];
+ actual = args[1];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(actual) {
+ throw new AssertionFailedError(format(message, false, actual));
+ }
+ }
+ /**
+ * Fails a test with the given message.
+ *
+ * @example This method can be called anytime you want to break out and fail
+ * the current test.
+ *
+ * <listing>
+ * public function testSomething():void {
+ * var instance:MyClass = new MyClass();
+ * if(instance.foo()) {
+ * fail('The foo should not have been there');
+ * }
+ * }
+ * </listing>
+ */
+ static public function fail(message:String):void {
+ throw new AssertionFailedError(message);
+ }
+
+ /**
+ * Asserts that the provided block throws an exception that matches
+ * the type provided.
+ *
+ * <listing>
+ * public function testFailingCode():void {
+ * assertThrows(CustomError, function():void {
+ * var instance:Sprite = new Sprite();
+ * instance.callMethodThatThrows();
+ * });
+ * }
+ * </listing>
+ **/
+ static public function assertThrows(errorType:Class, block:Function):void {
+ try {
+ block.call();
+ }
+ catch(e:Error) {
+ if(!(e is errorType)) {
+ throw new AssertionFailedError("expected error type:<" + getQualifiedClassName(errorType)
+ +"> but was:<" + getQualifiedClassName(e) + ">");
+ }
+ return;
+ }
+ throw new AssertionFailedError("expected error type:<" + getQualifiedClassName(errorType) + "> but none was thrown." );
+ }
+
+ /**
+ * Asserts that two objects are equal. If they are not
+ * an AssertionFailedError is thrown with the given message.
+ *
+ * This assertion should be (by far) the one you use the most.
+ * It automatically provides useful information about what
+ * the failing values were.
+ *
+ * <listing>
+ * public function testNames():void {
+ * var name1:String = "Federico Aubele";
+ * var name2:String = "Frederico Aubele";
+ *
+ * assertEquals(name1, name2);
+ * }
+ * </listing>
+ */
+ static public function assertEquals(...args:Array):void {
+ var message:String;
+ var expected:Object;
+ var actual:Object;
+
+ if(args.length == 2) {
+ message = "";
+ expected = args[0];
+ actual = args[1];
+ }
+ else if(args.length == 3) {
+ message = args[0];
+ expected = args[1];
+ actual = args[2];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(expected == null && actual == null) {
+ return;
+ }
+
+ try {
+ if(expected != null && expected.equals(actual)) {
+ return;
+ }
+ }
+ catch(e:Error) {
+ if(expected != null && expected == actual) {
+ return;
+ }
+ }
+
+ throw new AssertionFailedError(format(message, expected, actual));
+ }
+ /**
+ * Asserts that an object isn't null. If it is
+ * an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertNotNull(...args:Array):void {
+ var message:String;
+ var actual:Object;
+
+ if(args.length == 1) {
+ message = "";
+ actual = args[0];
+ }
+ else if(args.length == 2) {
+ message = args[0] + " ";
+ actual = args[1];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(actual == null) {
+ throw new AssertionFailedError(message + "expected not null but was:<" + actual + ">");
+ }
+ }
+ /**
+ * Asserts that an object is null. If it is not
+ * an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertNull(...args:Array):void {
+ var message:String;
+ var actual:Object;
+
+ if(args.length == 1) {
+ message = "";
+ actual = args[0];
+ }
+ else if(args.length == 2) {
+ message = args[0];
+ actual = args[1];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(actual != null) {
+ throw new AssertionFailedError(format(message, null, actual));
+ }
+ }
+ /**
+ * Asserts that two objects refer to the same object. If they are not
+ * an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertSame(...args:Array):void {
+ var message:String;
+ var expected:Object;
+ var actual:Object;
+
+ if(args.length == 2) {
+ message = "";
+ expected = args[0];
+ actual = args[1];
+ }
+ else if(args.length == 3) {
+ message = args[0] + " ";
+ expected = args[1];
+ actual = args[2];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(expected !== actual) {
+ throw new AssertionFailedError(message + "expected same as:<" + expected + "> but was:<" + actual + ">");
+ }
+ }
+ /**
+ * Asserts that two objects do not refer to the same object. If they do,
+ * an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertNotSame(...args:Array):void {
+ var message:String;
+ var expected:Object;
+ var actual:Object;
+
+ if(args.length == 2) {
+ message = "";
+ expected = args[0];
+ actual = args[1];
+ }
+ else if(args.length == 3) {
+ message = args[0] + " ";
+ expected = args[1];
+ actual = args[2];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if(expected === actual) {
+ throw new AssertionFailedError(message + "expected not same but both were:<" + actual + ">");
+ }
+ }
+
+ /**
+ * Asserts that two numerical values are equal within a tolerance range.
+ * If they are not an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertEqualsFloat(...args:Array):void {
+ var message:String;
+ var expected:Number;
+ var actual:Number;
+ var tolerance:Number = 0;
+
+ if(args.length == 3) {
+ message = "";
+ expected = args[0];
+ actual = args[1];
+ tolerance = args[2];
+ }
+ else if(args.length == 4) {
+ message = args[0];
+ expected = args[1];
+ actual = args[2];
+ tolerance = args[3];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+ if (isNaN(tolerance)) tolerance = 0;
+ if(Math.abs(expected - actual) <= tolerance) {
+ return;
+ }
+ throw new AssertionFailedError(format(message, expected, actual));
+ }
+
+ /**
+ * Asserts that two arrays have the same length and contain the same
+ * objects in the same order. If the arrays are not equal by this
+ * definition an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertEqualsArrays(...args:Array):void {
+ var message:String;
+ var expected:Array;
+ var actual:Array;
+
+ if(args.length == 2) {
+ message = "";
+ expected = args[0];
+ actual = args[1];
+ }
+ else if(args.length == 3) {
+ message = args[0];
+ expected = args[1];
+ actual = args[2];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if (expected == null && actual == null) {
+ return;
+ }
+ if ((expected == null && actual != null) || (expected != null && actual == null)) {
+ failNotEquals(message, expected, actual);
+ }
+ // from here on: expected != null && actual != null
+ if (expected.length != actual.length) {
+ failNotEquals(message, expected, actual);
+ }
+ for (var i : int = 0; i < expected.length; i++) {
+ assertEquals(expected[i], actual[i]);
+ }
+ }
+
+ /**
+ * Asserts that two arrays have the same length and contain the same
+ * objects. The order of the objects in the arrays is ignored. If they
+ * are not equal by this definition an AssertionFailedError is thrown
+ * with the given message.
+ */
+ static public function assertEqualsArraysIgnoringOrder(...args:Array):void {
+ var message:String;
+ var expected:Array;
+ var actual:Array;
+
+ if(args.length == 2) {
+ message = "";
+ expected = args[0];
+ actual = args[1];
+ }
+ else if(args.length == 3) {
+ message = args[0];
+ expected = args[1];
+ actual = args[2];
+ }
+ else {
+ throw new IllegalOperationError("Invalid argument count");
+ }
+
+ if (expected == null && actual == null) {
+ return;
+ }
+ if ((expected == null && actual != null) || (expected != null && actual == null)) {
+ failNotEquals(message, expected, actual);
+ }
+ // from here on: expected != null && actual != null
+ if (expected.length != actual.length) {
+ failNotEquals(message, expected, actual);
+ }
+ for (var i : int = 0; i < expected.length; i++) {
+ var foundMatch : Boolean = false;
+ var expectedMember : Object = expected[i];
+ for (var j : int = 0; j < actual.length; j++) {
+ var actualMember : Object = actual[j];
+ try {
+ assertEquals(expectedMember, actualMember);
+ foundMatch = true;
+ break;
+ }
+ catch (e : AssertionFailedError) {
+ // no match, try next
+ }
+ }
+ if (!foundMatch) {
+ failNotEquals("Found no match for " + expectedMember + ";", expected, actual);
+ }
+ }
+ }
+
+ static private function failNotEquals(message:String, expected:Object, actual:Object):void {
+ fail(format(message, expected, actual));
+ }
+
+ static private function format(message:String, expected:Object, actual:Object):String {
+ var formatted:String = "";
+ if(message != null) {
+ formatted = message + " ";
+ }
+ return formatted + "expected:<" + expected + "> but was:<" + actual + ">";
+ }
+ }
+}
View
60 asunit-3.0/src/asunit/framework/AsyncOperation.as
@@ -0,0 +1,60 @@
+package asunit.framework {
+ import asunit.errors.AssertionFailedError;
+ import flash.errors.IllegalOperationError;
+ import flash.events.Event;
+ import flash.events.TimerEvent;
+ import flash.utils.Timer;
+
+ public class AsyncOperation{
+
+ private var timeout:Timer;
+ private var testCase:TestCase;
+ private var callback:Function;
+ private var duration:Number;
+ private var failureHandler:Function;
+
+ public function AsyncOperation(testCase:TestCase, handler:Function, duration:Number, failureHandler:Function=null){
+ this.testCase = testCase;
+ this.duration = duration;
+ timeout = new Timer(duration, 1);
+ timeout.addEventListener(TimerEvent.TIMER_COMPLETE, onTimeoutComplete);
+ timeout.start();
+ if(handler == null) {
+ handler = function(args:*):* {return;};
+ }
+ this.failureHandler = failureHandler;
+ var context:AsyncOperation = this;
+ callback = function(args:*):* {
+ timeout.stop();
+ try {
+ handler.apply(testCase, arguments);
+ }
+ catch(e:AssertionFailedError) {
+ testCase.getResult().addFailure(testCase, e);
+ }
+ catch(ioe:IllegalOperationError) {
+ testCase.getResult().addError(testCase, ioe);
+ }
+ catch(unknownError:Error) {
+ testCase.getResult().addError(testCase, unknownError);
+ }
+ finally {
+ testCase.asyncOperationComplete(context);
+ }
+ return;
+ };
+ }
+
+ public function getCallback():Function{
+ return callback;
+ }
+
+ private function onTimeoutComplete(event:TimerEvent):void {
+ if(null != failureHandler) {
+ failureHandler(new Event('async timeout'));
+ }
+ testCase.asyncOperationTimeout(this, duration, null==failureHandler);
+ }
+ }
+
+}
View
51 asunit-3.0/src/asunit/framework/AsynchronousHTTPServiceTestCase.as
@@ -0,0 +1,51 @@
+package asunit.framework {
+ import asunit.errors.AbstractError;
+
+ import flash.errors.IllegalOperationError;
+ import flash.events.*;
+ import flash.net.URLLoader;
+ import flash.utils.getTimer;
+
+ import mx.rpc.AsyncToken;
+ import mx.rpc.Responder;
+ import mx.rpc.events.FaultEvent;
+
+ /**
+ * Extend this class if you have a TestCase that requires the
+ * asynchronous load of external data.
+ */
+ public class AsynchronousHTTPServiceTestCase extends AsynchronousTestCase implements Test {
+
+ public function AsynchronousHTTPServiceTestCase(testMethod:String = null) {
+ super(testMethod);
+ }
+
+ // use this method in overriding run() if you are using an HTTPService:
+ protected function configureResponder(token:AsyncToken):void {
+ token.addResponder(new Responder(resultFunc, faultFunc));
+ }
+
+ protected function resultFunc(event:Object):void {
+ completeHandler(event as Event);
+ }
+
+ protected function faultFunc(event:Object):void {
+ var faultEvent:FaultEvent = event as FaultEvent;
+ if (faultEvent == null) {
+ return;
+ }
+ var cause:Object = faultEvent.fault.rootCause;
+ var ioErrorEvent:IOErrorEvent = cause as IOErrorEvent;
+ if (ioErrorEvent) {
+ ioErrorHandler(ioErrorEvent);
+ return;
+ }
+ var securityErrorEvent:SecurityErrorEvent = cause as SecurityErrorEvent;
+ if (securityErrorEvent) {
+ securityErrorHandler(securityErrorEvent);
+ }
+ }
+
+ }
+
+}
View
161 asunit-3.0/src/asunit/framework/AsynchronousTestCase.as
@@ -0,0 +1,161 @@
+package asunit.framework {
+
+ import asunit.errors.AbstractError;
+
+ import flash.errors.IllegalOperationError;
+ import flash.events.*;
+ import flash.net.URLLoader;
+ import flash.utils.getTimer;
+
+ /**
+ * Extend this class if you have a TestCase that requires the
+ * asynchronous load of external data.
+ */
+ public class AsynchronousTestCase extends TestCase implements Test {
+
+ protected static const DEFAULT_REMOTE_TIMEOUT:int = 30000;
+ private static const INVALID_TIME:int = -1;
+
+ private var _ioErrorExpected:Boolean;
+ private var _remoteDuration:int;
+ private var _remoteStartTime:int;
+ private var _remoteTimeout:int;
+ private var _securityErrorExpected:Boolean;
+
+ public function AsynchronousTestCase(testMethod:String = null) {
+ super(testMethod);
+ _remoteStartTime = INVALID_TIME;
+
+ // set defaults for user-configurable properties:
+ _remoteTimeout = DEFAULT_REMOTE_TIMEOUT;
+ _ioErrorExpected = false;
+ _securityErrorExpected = false;
+ }
+
+ public function get remoteDuration():int {
+ return _remoteDuration;
+ }
+
+ public function remoteDurationIsValid():Boolean {
+ return _remoteDuration != INVALID_TIME;
+ }
+
+ // see testRemoteDuration() below
+ public function set remoteTimeout(ms:int):void {
+ _remoteTimeout = ms;
+ }
+
+ public function set ioErrorExpected(yn:Boolean):void {
+ _ioErrorExpected = yn;
+ }
+
+ public function set securityErrorExpected(yn:Boolean):void {
+ _securityErrorExpected = yn;
+ }
+
+ // use this method in overriding run() if you are using a URLLoader:
+ protected function configureListeners(loader:URLLoader):void {
+ loader.addEventListener(Event.COMPLETE, completeHandler);
+ loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
+ loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
+ loader.addEventListener(Event.OPEN, openHandler);
+ loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+ loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+ }
+
+ // in a subclass, you should override this method and call super.run() at the end
+ public override function run():void {
+ if ((this as Object).constructor == AsynchronousTestCase)
+ {
+ throw new AbstractError("run() method must be overridden in class derived from AsynchronousTestCase");
+ }
+
+ startRemoteDuration();
+ }
+
+ private final function startRemoteDuration():void {
+ _remoteStartTime = getTimer();
+ }
+
+ private final function setRemoteDuration():void {
+ if (_remoteStartTime == INVALID_TIME) {
+ // I guess you overrode run() in a subclass without calling super.run()
+ _remoteDuration = INVALID_TIME;
+ }
+ else {
+ _remoteDuration = getTimer() - _remoteStartTime;
+ }
+ }
+
+ protected final function completeHandler(event:Event):void {
+ setRemoteDuration();
+ setDataSource(event);
+ // call super.run() to execute test methods:
+ runTests();
+ }
+
+ // override this method to put a copy of the data into a member reference
+ protected function setDataSource(event:Event):void {
+ throw new AbstractError("setDataSource must be overridden in class derived from AsynchronousTestCase");
+ }
+
+ // this method gives derived classes access to TestCase.run()
+ protected final function runTests():void {
+ super.run();
+ }
+
+ // TODO: add support for failing status events...
+ protected function httpStatusHandler(event:HTTPStatusEvent):void {
+ // I believe this is useless except in AIR.
+ }
+
+ protected final function ioErrorHandler(event:IOErrorEvent):void {
+ result.startTest(this);
+ if (_ioErrorExpected == false)
+ {
+ // access is authorized and we didn't get in: log the error
+ result.addError(this, new IllegalOperationError(event.text));
+ }
+ setRemoteDuration();
+ testRemoteDuration();
+ dispatchEvent(new Event(Event.COMPLETE));
+ }
+
+ protected function openHandler(event:Event):void {
+ }
+
+ protected function progressHandler(event:ProgressEvent):void {
+ }
+
+ protected final function securityErrorHandler(event:SecurityErrorEvent):void {
+ result.startTest(this);
+ if (_securityErrorExpected == false)
+ {
+ // access is authorized and we didn't get in: log the error
+ result.addError(this, new IllegalOperationError(event.text));
+ }
+ setRemoteDuration();
+ testRemoteDuration();
+ dispatchEvent(new Event(Event.COMPLETE));
+ }
+
+ public function testRemoteDuration():void {
+ if (!remoteDurationIsValid())
+ {
+ return;
+ }
+ if (_remoteDuration > _remoteTimeout)
+ {
+ result.addError(this, new IllegalOperationError("remote communication took too long: " + _remoteDuration/1000 + " seconds.\n" + this.toString()));
+ }
+ }
+
+ public function testUnauthorizedAccess():void {
+ if (_securityErrorExpected || _ioErrorExpected)
+ {
+ fail("unauthorized access permitted (expected no access)\n" + this.toString());
+ }
+ }
+
+ }
+}
View
82 asunit-3.0/src/asunit/framework/AsynchronousTestCaseExample.as
@@ -0,0 +1,82 @@
+package asunit.framework {
+ import flash.events.*;
+ import flash.net.URLLoader;
+ import flash.net.URLRequest;
+
+ /**
+ * This example is built on the following mock data:
+ * <books>
+ * <book publisher="Addison-Wesley" name="Design Patterns" />
+ * <book publisher="Addison-Wesley" name="The Pragmattic Programmer" />
+ * <book publisher="Addison-Wesley" name="Test Driven Development" />
+ * <book publisher="Addison-Wesley" name="Refactoring to Patterns" />
+ * <book publisher="O'Reilly Media" name="The Cathedral & the Bazaar" />
+ * <book publisher="O'Reilly Media" name="Unit Test Frameworks" />
+ * </books>
+ *
+ * This example was created to illustrate how one can build an synchronous
+ * TestCase - one that relies on remote data of some sort.
+ * This use case is now diminished by the creation of E4X and easily
+ * readable/editable XML data directly in source form.
+ * But asynchronous tests will probably need to be built at some point
+ * by somebody... If you're them, maybe you can use this as a template.
+ */
+
+ public class AsynchronousTestCaseExample extends AsynchronousTestCase {
+ private var source:String = "asunit/framework/MockData.xml";
+ private var dataSource:XML;
+ private var instance:Object;
+
+ // Override the run method and begin the request for remote data
+ public override function run():void {
+ var request:URLRequest = new URLRequest(source);
+ var loader:URLLoader = new URLLoader();
+ // configureListeners is a method on the AsynchronousTestCase
+ // and it will handle error states by failing loudly...
+ configureListeners(loader);
+ loader.load(request);
+
+ // call super.run() to start network duration:
+ super.run();
+ }
+
+ protected override function setDataSource(event:Event):void {
+ // put a copy of the data into a member reference
+ if (event == null)
+ {
+ dataSource = null;
+ }
+ else
+ {
+ dataSource = XML(event.target.data).copy();
+ }
+ }
+
+ protected override function setUp():void {
+ // create a new instance of the class under test
+ instance = new Object();
+ if (dataSource != null) // i.e. there was no IOError or SecurityError
+ {
+ // copy the data into a member or method of the _instance
+ instance.data = dataSource.copy();
+ }
+ }
+
+ protected override function tearDown():void {
+ // destroy the class under test instance
+ instance = null;
+ }
+
+ public function testBookCount():void {
+ var data:XML = XML(instance.data);
+ var list:XMLList = data..book;
+ assertTrue("list.length() == " + list.length() + " (6?)", list.length() == 6);
+ }
+
+ public function testOReillyBookCount():void {
+ var data:XML = XML(instance.data);
+ var list:XMLList = data..book.(@publisher == "O'Reilly Media");
+ assertTrue("list.length() == " + list.length() + " (2?)", list.length() == 2);
+ }
+ }
+}
View
186 asunit-3.0/src/asunit/framework/RemotingTestCase.as
@@ -0,0 +1,186 @@
+package asunit.framework
+{
+ import flash.errors.IllegalOperationError;
+ import flash.events.IOErrorEvent;
+ import flash.events.NetStatusEvent;
+ import flash.events.SecurityErrorEvent;
+ import flash.net.NetConnection;
+ import flash.net.ObjectEncoding;
+ import flash.net.Responder;
+
+ import asunit.framework.TestCase;
+ import asunit.util.ArrayIterator;
+
+ /**
+ * RemotingTestCase
+ * @author Jens Krause [www.websector.de]
+ * @date 11/29/07
+ *
+ */
+ public class RemotingTestCase extends TestCase
+ {
+
+ protected var connection: NetConnection;
+ /**
+ * Constructor
+ * @param testMethod String Name of the test case
+ *
+ */
+ public function RemotingTestCase(testMethod: String = null)
+ {
+ super(testMethod);
+ }
+
+ /**
+ * Inits a netConnection instance and add all necessary event listeners
+ *
+ */
+ protected function initConnection():void
+ {
+ if (connection == null)
+ {
+ connection = new NetConnection();
+
+ connection.addEventListener(NetStatusEvent.NET_STATUS, connectionStatusHandler);
+ connection.addEventListener(IOErrorEvent.IO_ERROR, connectionIOErrorHandler);
+ connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR , connectionSecurityErrorHandler);
+ }
+ }
+
+ /**
+ * Dispose the netConnection instance
+ *
+ */
+ protected function disposeConnection():void
+ {
+ if (connection != null)
+ {
+ connection.removeEventListener(NetStatusEvent.NET_STATUS, connectionStatusHandler);
+ connection.removeEventListener(IOErrorEvent.IO_ERROR, connectionIOErrorHandler);
+ connection.removeEventListener(SecurityErrorEvent.SECURITY_ERROR , connectionSecurityErrorHandler);
+
+ connection = null;
+ }
+ }
+
+ /**
+ * Callback handler for receiving SecurityErrorEvent
+ * @param event SecurityErrorEvent
+ *
+ */
+ protected function connectionSecurityErrorHandler(event: SecurityErrorEvent): void
+ {
+ result.addError(this, new IllegalOperationError(event.toString()));
+ isComplete = true;
+ }
+
+ /**
+ * Callback handler for receiving IOErrorEvent
+ * @param event IOErrorEvent
+ *
+ */
+ protected function connectionIOErrorHandler(event: IOErrorEvent): void
+ {
+ result.addError(this, new IllegalOperationError(event.toString()));
+ isComplete = true;
+ }
+
+ /**
+ * Callback handler for receiving NetStatusEvent
+ * @param event NetStatusEvent
+ *
+ */
+ protected function connectionStatusHandler(event: NetStatusEvent): void
+ {
+
+ }
+
+ /**
+ * Connects the gateway
+ *
+ * @param $gateway String Remote gateway
+ * @param $encoding uint Object encoding using either AMF0 or AMF3
+ *
+ */
+ protected function connect ($gateway: String = null, $encoding: uint = 0): void
+ {
+ initConnection();
+
+ connection.objectEncoding = ($encoding > ObjectEncoding.AMF0) ? $encoding : ObjectEncoding.AMF0;
+
+ try {
+ connection.connect($gateway);
+ }
+ catch(error: Error)
+ {
+ result.addError(this, error);
+ }
+ };
+
+ /**
+ * Calls a remote service method and test it
+ *
+ * @param $method String Remote service
+ * @param $responder Responder Responder to handle remoting calls
+ * @param $arguments Array Rest paramaters (optional)
+ *
+ */
+ protected function call ($method: String = null, $responder: Responder = null, ...$arguments): void
+ {
+ var hasReferenceError: Boolean = false;
+
+ // parameters for calling connection.call();
+ // To avoid using the type unsafe ...rest operator I decided to use type safe parameters within RemotingTestCase.call()
+ // and apply these later to connection.call();
+ var params: Array = [];
+
+ // check remote method
+ if ($method != null)
+ {
+ params.push($method);
+ }
+ else
+ {
+ result.addError(this, new ReferenceError("RemotingTestCase.call() has to defined a remote method."));
+ hasReferenceError = true;
+ }
+
+ // check responder
+ if ($responder != null)
+ {
+ params.push($responder);
+ }
+ else
+ {
+ result.addError(this, new ReferenceError("RemotingTestCase.call() has to defined a responder to handling its results."));
+ hasReferenceError = true;
+ }
+
+ // In case of a reference error invoke test running instantly
+ // to show the errors created above and return
+ if (hasReferenceError)
+ {
+ super.run();
+ return;
+ }
+
+
+ var arrIterator: ArrayIterator = new ArrayIterator($arguments);
+ while (arrIterator.hasNext())
+ {
+ params.push(arrIterator.next());
+ }
+
+ // call remote service
+ try {
+ connection.call.apply(null, params);
+ }
+ catch(error: Error)
+ {
+ result.addError(this, error);
+ }
+
+
+ };
+ }
+}
View
18 asunit-3.0/src/asunit/framework/Test.as
@@ -0,0 +1,18 @@
+package asunit.framework {
+ import flash.display.DisplayObjectContainer;
+ import flash.events.IEventDispatcher;
+
+ public interface Test extends IEventDispatcher {
+ function countTestCases():int;
+ function getName():String;
+ function getTestMethods():Array;
+ function toString():String;
+ function setResult(result:TestListener):void;
+ function run():void;
+ function runBare():void;
+ function getCurrentMethod():String;
+ function getIsComplete():Boolean;
+ function setContext(context:DisplayObjectContainer):void;
+ function getContext():DisplayObjectContainer;
+ }
+}
View
499 asunit-3.0/src/asunit/framework/TestCase.as
@@ -0,0 +1,499 @@
+package asunit.framework {
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.errors.IllegalOperationError;
+ import flash.events.Event;
+ import flash.events.TimerEvent;
+ import flash.utils.describeType;
+ import flash.utils.getDefinitionByName;
+ import flash.utils.setTimeout;
+ import flash.utils.Timer;
+
+ import asunit.errors.AssertionFailedError;
+ import asunit.util.ArrayIterator;
+ import asunit.util.Iterator;
+
+ /**
+ * A test case defines the fixture to run multiple tests. To define a test case<br>
+ * 1) implement a subclass of TestCase<br>
+ * 2) define instance variables that store the state of the fixture<br>
+ * 3) initialize the fixture state by overriding <code>setUp</code><br>
+ * 4) clean-up after a test by overriding <code>tearDown</code>.<br>
+ * Each test runs in its own fixture so there
+ * can be no side effects among test runs.
+ * Here is an example:
+ * <listing>
+ * public class MathTest extends TestCase {
+ * private var value1:Number;
+ * private var value2:Number;
+ *
+ * public function MathTest(methodName:String=null) {
+ * super(methodName);
+ * }
+ *
+ * override protected function setUp():void {
+ * super.setUp();
+ * value1 = 2;
+ * value2 = 3;
+ * }
+ * }
+ * </listing>
+ *
+ * For each test implement a method which interacts
+ * with the fixture. Verify the expected results with assertions specified
+ * by calling <code>assertTrue</code> with a boolean, or <code>assertEquals</code>
+ * with two primitive values that should match.
+ * <listing>
+ * public function testAdd():void {
+ * var result:Number = value1 + value2;
+ * assertEquals(5, result);
+ * }
+ * </listing>
+ *
+ * There are three common types of test cases:
+ *
+ * <ol>
+ * <li>Simple unit test</li>
+ * <li>Visual integration test</li>
+ * <li>Asynchronous test</li>
+ * </ol>
+ *