|
From: <luk...@us...> - 2006-03-05 00:14:46
|
Revision: 6 Author: lukebayes Date: 2006-03-04 16:14:34 -0800 (Sat, 04 Mar 2006) ViewCVS: http://svn.sourceforge.net/asunit/?rev=6&view=rev Log Message: ----------- Working on custom build for Flash Players 7 and 8 Added Paths: ----------- trunk/framework/as25/ trunk/framework/as25/AsUnitTestRunner.as trunk/framework/as25/AsUnitTestRunner.fla trunk/framework/as25/AsUnitTestRunner.swf trunk/framework/as25/asunit/ trunk/framework/as25/asunit/errors/ trunk/framework/as25/asunit/errors/AssertionFailedError.as trunk/framework/as25/asunit/errors/ClassNotFoundError.as trunk/framework/as25/asunit/errors/IllegalOperationError.as trunk/framework/as25/asunit/errors/InstanceNotFoundError.as trunk/framework/as25/asunit/errors/InvocationTargetError.as trunk/framework/as25/asunit/errors/UnimplementedFeatureError.as trunk/framework/as25/asunit/framework/ trunk/framework/as25/asunit/framework/Assert.as trunk/framework/as25/asunit/framework/ITestListener.as trunk/framework/as25/asunit/framework/Test.as trunk/framework/as25/asunit/framework/TestCase.as trunk/framework/as25/asunit/framework/TestFailure.as trunk/framework/as25/asunit/framework/TestResult.as trunk/framework/as25/asunit/framework/TestSuite.as trunk/framework/as25/asunit/runner/ trunk/framework/as25/asunit/runner/BaseTestRunner.as trunk/framework/as25/asunit/runner/IResultPrinter.as trunk/framework/as25/asunit/textui/ trunk/framework/as25/asunit/textui/ResultPrinter.as trunk/framework/as25/asunit/textui/SuccessBar.as trunk/framework/as25/asunit/textui/TestRunner.as Added: trunk/framework/as25/AsUnitTestRunner.as =================================================================== --- trunk/framework/as25/AsUnitTestRunner.as (rev 0) +++ trunk/framework/as25/AsUnitTestRunner.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,12 @@ +import asunit.textui.TestRunner; + +class AsUnitTestRunner extends TestRunner { + + public function AsUnitTestRunner() { + start(asunit.framework.ObjectTest); + } + + public static function main():Void { + var runner = new AsUnitTestRunner(); + } +} Added: trunk/framework/as25/AsUnitTestRunner.fla =================================================================== (Binary files differ) Property changes on: trunk/framework/as25/AsUnitTestRunner.fla ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/framework/as25/AsUnitTestRunner.swf =================================================================== (Binary files differ) Property changes on: trunk/framework/as25/AsUnitTestRunner.swf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/framework/as25/asunit/errors/AssertionFailedError.as =================================================================== --- trunk/framework/as25/asunit/errors/AssertionFailedError.as (rev 0) +++ trunk/framework/as25/asunit/errors/AssertionFailedError.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,7 @@ + +class asunit.errors.AssertionFailedError extends Error { + + public function AssertionFailedError(msg:String) { + super(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/errors/ClassNotFoundError.as =================================================================== --- trunk/framework/as25/asunit/errors/ClassNotFoundError.as (rev 0) +++ trunk/framework/as25/asunit/errors/ClassNotFoundError.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,7 @@ + +class asunit.errors.ClassNotFoundError extends Error { + + public function ClassNotFoundError(msg:String) { + super(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/errors/IllegalOperationError.as =================================================================== --- trunk/framework/as25/asunit/errors/IllegalOperationError.as (rev 0) +++ trunk/framework/as25/asunit/errors/IllegalOperationError.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,7 @@ + +class asunit.errors.IllegalOperationError extends Error { + + public function IllegalOperationError(msg:String) { + super(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/errors/InstanceNotFoundError.as =================================================================== --- trunk/framework/as25/asunit/errors/InstanceNotFoundError.as (rev 0) +++ trunk/framework/as25/asunit/errors/InstanceNotFoundError.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,7 @@ + +class asunit.errors.InstanceNotFoundError extends Error { + + public function InstanceNotFoundError(msg:String) { + super(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/errors/InvocationTargetError.as =================================================================== --- trunk/framework/as25/asunit/errors/InvocationTargetError.as (rev 0) +++ trunk/framework/as25/asunit/errors/InvocationTargetError.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,7 @@ + +class asunit.errors.InvocationTargetError extends Error { + + public function InvocationTargetError(msg:String) { + super(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/errors/UnimplementedFeatureError.as =================================================================== --- trunk/framework/as25/asunit/errors/UnimplementedFeatureError.as (rev 0) +++ trunk/framework/as25/asunit/errors/UnimplementedFeatureError.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,7 @@ + +class asunit.errors.UnimplementedFeatureError extends Error { + + public function UnimplementedFeatureError(msg:String) { + super(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/framework/Assert.as =================================================================== --- trunk/framework/as25/asunit/framework/Assert.as (rev 0) +++ trunk/framework/as25/asunit/framework/Assert.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,358 @@ +import asunit.errors.AssertionFailedError; + +/** + * Provides assert methods and other utility methods which are inherited by + * the {@link TestCase} subclass. Since all user-defined test cases should + * extend {@link TestCase} you should never have to use this class + * directly. + * + * @see TestCase + */ +class asunit.framework.Assert { +// private static var testRunner:TestRunner; + private static var defaultClassName:String = "[ClassName Unknown]"; + private static var lastDepth:Number = 1; + + +// private function Assert() { +// } + + /** + * Returns the next available depth for attaching a MovieClip. + * + * @return + * Number of next available depth. + */ + private static function nextDepth():Number { + return Assert.lastDepth++; + } + + /** + * Appends a test result to the {@link TestRunner} which manages test + * result output. This method is intended for use by the AsUnit + * framework and should never have to be called directly. + * + * @param msg + * The message associated with the assertion. + * @param assertType + * The assertion type. + * @param passFail + * Indicates whether the test passed (<code>true</code>) or + * failed (<code>false</code>). + * + */ + public static function addTestResult(msg:String, assertType:String, passed:Boolean) { + if(!passed) { + var str:String = ""; + if(msg != "") { + str += assertType + ".message: " + msg; + } + fail(str); + } + } + + /** + * Returns a reference to the {@link TestRunner} instance which manages + * the output of test results. This method is intended for use by the + * AsUnit framework and should never have to be called directly. + private static function getTestRunner():TestRunner { + if(testRunner == null) { + testRunner = new TestRunner(); + } + return testRunner; + } + */ + + /** + * Returns the number of {@link TestCases} that have completed. + public static function countTestCases():Number { + return testRunner.length; + } + */ + + /** + * Asserts that two objects are equal. If either of the + * objects provides an <code>equals()</code> method it will be used to + * determine equality. Otherwise, equality will be evaluated using the + * strict equality operator (<code>===</code>).<br /> + * <br /> + * The method below tests the <code>getFullName()</code> method of the + * <code>Person</code> class to make sure that the formatting of its + * return value is correct.<br /> + * + * <pre> + * public function testGetFullName():Void { + * var person:Person = new Person("John", "Alan", "Smith"); + * assertEquals("full name should be formatted: [first] [middleInitial]. [last]", + * "John A. Smith", + * person.getFullName()); + * } + * </pre> + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion1 + * First object to use in evaluation. + * @param assertion2 + * Second object to use in evaluation. + */ + public static function assertEquals(msg:Object, assertion1:Object, assertion2:Object):Void { + if(arguments.length == 2) { + assertion2 = assertion1; + assertion1 = msg; + msg = ""; + } + if(assertion1["equals"] instanceof Function) { + addTestResult(String(msg), "assertEquals", assertion1["equals"](assertion2)); + } else if(assertion2["equals"] != undefined) { + addTestResult(String(msg), "assertEquals", assertion2["equals"](assertion1)); + } else { + addTestResult(String(msg), "assertEquals", assertion1 === assertion2); + } + + } + + /** + * Asserts that a value is <code>null</code>.<br /> + * <br /> + * The method below tests to confirm that the parameter passed to the + * <code>getProductBySku</code> method of the + * <code>ProductCatalog</code> is treated as case sensitive.<br /> + * + * <pre> + * public function testGetProductBySku():Void { + * // Set up a fixture to test against. + * var productCatalog:ProductCatalog = new ProductCatalog(); + * productCatalog.addProduct(new Product("sku123a")); + * + * // Try retrieving a product using improper text case. + * var product:Product = productCatalog.getProductBySku("SKU123A"); + * assertNull("the SKU parameter should be case sensitive", + * product); + * } + * </pre> + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion + * Object to be evaluated. + */ + public static function assertNull(msg:Object, assertion:Object):Void { + if(arguments.length == 1) { + assertion = msg; + msg = ""; + } + addTestResult(String(msg), "assertNull", (assertion === null)); + } + + /** + * Asserts that a value is not <code>null</code>.<br /> + * <br /> + * The method below tests to confirm that the parameter passed to the + * <code>getColorByName</code> method of the <code>ColorManager</code> + * class is treated as case insensitive.<br /> + * + * <pre> + * public function testGetColorByName():Void { + * // Set up a fixture to test against. + * var colorManager:ColorManager = new ColorManager(); + * colorManager.addColor(new Color("blue")); + * + * // Try retrieving a color using alternate text case. + * var color:Color = colorManager.getColorByName("Blue"); + * assertNotNull("color name parameter should not be case sensitive", + * color); + * } + * </pre> + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion + * Object to be evaluated. + */ + public static function assertNotNull(msg:Object, assertion:Object):Void { + if(arguments.length == 1) { + assertion = msg; + msg = ""; + } + addTestResult(String(msg), "assertNotNull", (assertion !== null)); + } + + /** + * Asserts that a value is <code>undefined</code>. + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion + * Object to be evaluated. + */ + public static function assertUndefined(msg:Object, assertion:Object):Void { + if(arguments.length == 1) { + assertion = msg; + msg = ""; + } + addTestResult(String(msg), "assertUndefined", (assertion === undefined)); + } + + /** + * Asserts that a value is not <code>undefined</code>. + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion + * Object to be evaluated. + */ + public static function assertNotUndefined(msg:Object, assertion:Object):Void { + if(arguments.length == 1) { + assertion = msg; + msg = ""; + } + addTestResult(String(msg), "assertNotUndefined", (assertion !== undefined)); + } + + /** + * Asserts that two variables are pointing to the same object in + * memory.<br /> + * <br /> + * The method below tests to confirm that the static + * <code>getInstance()</code> method of the <code>ServiceLocator</code> + * class always returns a reference to the same instance of + * <code>ServiceLocator</code>.<br /> + * + * <pre> + * public function testGetInstance():Void { + * var instance1:ServiceLocator = ServiceLocator.getInstance(); + * var instance2:ServiceLocator = ServiceLocator.getInstance(); + * assertSame("getInstance() should always return the same ServiceLocator instance", + * instance1, + * instance2); + * } + * </code> + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param object1 + * First object to use in evaluation. + * @param object2 + * Second object to use in evaluation. + */ + public static function assertSame(msg:Object, object1:Object, object2:Object):Void { + if(arguments.length == 2) { + object2 = object1; + object1 = msg; + msg = ""; + } + addTestResult(String(msg), "assertSame", (object1 === object2)); + } + + /** + * Asserts that a statement evaluates to <code>true</code>. Since this + * method lets you pass in any expression that evaluates to a boolean + * value, it is a good method to fall back on when the other + * <code>assert<i>XXX</i></code> methods don't provide the kind of + * functionality your test requires.<br /> + * <br /> + * The method below test to confirm that new <code>Product</code> objects + * are assigned ascending catalog numbers when created by the + * <code>ProductGenerator</code> class.<br /> + * + * <pre> + * public function testMakeProductCatalogNumberAssignement():Void { + * var generator:ProductGenerator = ProductGenerator.getInstance(); + * var product1:Product = generator.makeProduct("sku123"); + * var product2:Product = generator.makeProduct("sku456"); + * assertTrue("products should be assigned ascending catalog numbers", + * product1.catNumber < product2.catNumber); + * } + * </code> + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion + * A statement that evaluates to a boolean value. + */ + public static function assertTrue(msg:Object, assertion:Boolean):Void { + if(arguments.length == 1) { + assertion = Boolean(msg); + msg = ""; + } + addTestResult(String(msg), "assertTrue", assertion); + } + + /** + * Asserts that a statement evaluates to <code>false</code>. Since this + * method lets you pass in any expression that evaluates to a boolean + * value, it is a good method to fall back on when the other + * <code>assert<i>XXX</i></code> methods don't provide the kind of + * functionality your test requires.<br /> + * <br /> + * The method below tests to confirm that the return value of the + * <code>truncate()</code> method of the <code>TextUtil</code> + * class is no longer than the specified limit<br /> + * + * <pre> + * public function testTruncate():Void { + * var limit:Number = 30; + * var text:String = "As a reviewer, I got an early opportunity to read the book you are holding."; + * var clippedText:String = TextUtil.truncate(text, limit); + * assertFalse("return value should be no more than 30 characters", + * clippedText.length > 30); + * } + * </code> + * + * @param msg + * Optional; Message to display should the test fail. It is + * recommended that this message describe what is asserted to be + * true rather than describing what went wrong. + * @param assertion + * A statement that evaluates to a boolean value. + */ + public static function assertFalse(msg:Object, assertion:Boolean):Void { + if(arguments.length == 1) { + assertion = Boolean(msg); + msg = ""; + } + addTestResult(String(msg), "assertFalse", !assertion); + } + + /** + * Forces a failing test result to be recorded. This method is useful + * in the rare circumstances where the <code>assert<i>XXX</i></code> + * methods can not be used, for example, when testing error + * handling.<br> + * <br /> + * The method below tests to confirm that a "gifts" product category can + * be accessed through a <code>Catalog</code> instance.<br /> + * + * <pre> + * public function testGiftsProductCategoryAccess():Void { + * var catalog:ProductCatalog = CatalogFactory.getCatalog("fall2005"); + * + * // Try accessing the "gifts" product category. + * try { + * var products:Array = catalog.getProducts("gifts"); + * } catch (error:com.mycompany.errors.InvalidProductCategoryError) { + * fail("catalog should contain 'gifts' products"); + * } + * } + * </pre> + */ + public static function fail(msg:String):Void { + trace("attempting to fail an assertion now with: " + msg); + throw new AssertionFailedError(msg); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/framework/ITestListener.as =================================================================== --- trunk/framework/as25/asunit/framework/ITestListener.as (rev 0) +++ trunk/framework/as25/asunit/framework/ITestListener.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,13 @@ +import asunit.errors.AssertionFailedError; +import asunit.framework.Test; + +interface asunit.framework.ITestListener { + // A test started. + public function startTest(test:Test):Void; + // An error occurred. + public function addError(test:Test, e:Error):Void; + // A failure occurred. + public function addFailure(test:Test, e:AssertionFailedError):Void; + // A test ended. + public function endTest(test:Test):Void; +} Added: trunk/framework/as25/asunit/framework/Test.as =================================================================== --- trunk/framework/as25/asunit/framework/Test.as (rev 0) +++ trunk/framework/as25/asunit/framework/Test.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,10 @@ +import asunit.framework.TestResult; + +interface asunit.framework.Test { + + public function setResult(result:TestResult):Void; + public function setContext(context:MovieClip):Void; + public function run():Void; + public function countTestCases():Number; + public function toString():String; +} \ No newline at end of file Added: trunk/framework/as25/asunit/framework/TestCase.as =================================================================== --- trunk/framework/as25/asunit/framework/TestCase.as (rev 0) +++ trunk/framework/as25/asunit/framework/TestCase.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,127 @@ +import asunit.framework.Assert; +import asunit.framework.Test; +import asunit.framework.TestResult; +import asunit.errors.AssertionFailedError; + +class asunit.framework.TestCase extends Assert implements Test { + private var className:String = "[default]"; + + private var result:TestResult; + private var context:MovieClip; + private var currentMethod:String; + private var runSingle:Boolean; + private var isComplete:Boolean; + + public function TestCase(testMethod:String) { + if(testMethod != undefined) { + runSingle = true; + currentMethod = testMethod; + } + } + + public function countTestCases():Number { + return getTestMethods().length; + } + + private function setUp():Void { + } + + private function tearDown():Void { + } + + private function cleanUp():Void { + } + + public function setResult(result:TestResult):Void { + this.result = result; + } + + public function setContext(context:MovieClip):Void { + this.context = context; + } + + public function run():Void { + var result:TestResult = getResult(); + result.run(this); + } + + public function runBare():Void { + var methods:Array = getTestMethods(); + var name:String; + try { + for(var i:Number = 0; i < methods.length; i++) { + name = methods[i]; + try { + runMethod(name); + } + catch(e:AssertionFailedError) { + result.addFailure(this, e); + } + catch(ioe:Error) { + result.addError(this, ioe); + } + } + } + finally { + if(!runSingle) { + cleanUp(); + } + } + + isComplete = true; + } + + private function runMethod(methodName:String):Void { + currentMethod = methodName; + setUp(); + try { + this[methodName](); + } + finally { + if(!runSingle) { + tearDown(); + } + } + } + + private function getTestMethods():Array { + if(runSingle) { + return new Array(currentMethod); + } + var methods:Array = new Array(); + _global.ASSetPropFlags(this.__proto__, null, 6, true); + for(var i:String in this) { + if(i.indexOf("test") == 0 && this[i] instanceof Function) { + methods.push(i); + } + } + _global.ASSetPropFlags(this.__proto__, null, 1, true); + methods.reverse(); + return methods; + } + + private function getResult():TestResult { + return result; + } + + /** + * Returns the name of the currently running test method. This + * method is intended for use by the AsUnit framework and should never + * have to be called directly. + * + * @return + * A method name. Ex. <code>"testGetValue"</code>. + */ + public function getCurrentMethod():String { + return currentMethod; + } + + public function toString():String { + trace("TEST CASE TO STRING: " + getCurrentMethod()); + return getName() + "." + getCurrentMethod() + "()"; + } + + public function getName():String { + return className; + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/framework/TestFailure.as =================================================================== --- trunk/framework/as25/asunit/framework/TestFailure.as (rev 0) +++ trunk/framework/as25/asunit/framework/TestFailure.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,53 @@ +//import flash.util.StringBuilder; +import asunit.errors.AssertionFailedError; +import asunit.framework.Test; + +/** + * A <code>TestFailure</code> collects a failed test together with + * the caught exception. + * @see TestResult + */ +class asunit.framework.TestFailure { + private var fFailedTest:String; + private var fThrownException:Error; + + /** + * Constructs a TestFailure with the given test and exception. + */ + public function TestFailure(failedTest:Test, thrownException:Error) { + fFailedTest = failedTest.toString(); + fThrownException = thrownException; + } + /** + * Gets the failed test. + */ + public function failedTest():String { + return fFailedTest; + } + /** + * Gets the thrown exception. + */ + public function thrownException():Error { + return fThrownException; + } + /** + * Returns a short description of the failure. + */ + public function toString():String { + return ""; +// return fFailedTest.toString(); +// var buffer:StringBuilder = new StringBuilder(); +// buffer.append(fFailedTest.toString()); +// buffer.append(":\n"); +// buffer.append(fThrownException.toString()); +// return buffer.toString(); + } + + public function exceptionMessage():String { + return thrownException().message; + } + + public function isFailure():Boolean { + return thrownException() instanceof AssertionFailedError; + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/framework/TestResult.as =================================================================== --- trunk/framework/as25/asunit/framework/TestResult.as (rev 0) +++ trunk/framework/as25/asunit/framework/TestResult.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,170 @@ +//import flash.events.EventDispatcher; +import asunit.errors.IllegalOperationError; +import asunit.errors.AssertionFailedError; +import asunit.errors.InstanceNotFoundError; +import asunit.framework.Test; +import asunit.framework.TestCase; +import asunit.framework.TestFailure; +import asunit.framework.ITestListener; + +/** + * A <code>TestResult</code> collects the results of executing + * a test case. It is an instance of the Collecting Parameter pattern. + * The test framework distinguishes between <i>failures</i> and <i>errors</i>. + * A failure is anticipated and checked for with assertions. Errors are + * unanticipated problems like an <code>ArrayIndexOutOfBoundsException</code>. + * + * @see Test + */ +class asunit.framework.TestResult { + private var fFailures:Array; + private var fErrors:Array; + private var fListeners:Array; + private var fRunTests:Number; + private var fStop:Boolean; + + public function TestResult() { + fFailures = new Array(); + fErrors = new Array(); + fListeners = new Array(); + fRunTests = 0; + fStop = false; + } + /** + * Adds an error to the list of errors. The passed in exception + * caused the error. + */ + public function addError(test:Test, t:Error):Void { + fErrors.push(new TestFailure(test, t)); + var len:Number = fListeners.length; + var item:ITestListener; + for(var i:Number = 0; i < len; i++) { + item = ITestListener(fListeners[i]); + item.addError(test, t); + } + } + /** + * Adds a failure to the list of failures. The passed in exception + * caused the failure. + */ + public function addFailure(test:Test, t:AssertionFailedError):Void { + fFailures.push(new TestFailure(test, t)); + var len:Number = fListeners.length; + var item:ITestListener; + for(var i:Number = 0; i < len; i++) { + item = ITestListener(fListeners[i]); + item.addFailure(test, t); + } + } + /** + * Registers a ITestListener + */ + public function addListener(listener:ITestListener):Void { + fListeners.push(listener); + } + /** + * Unregisters a ITestListener + */ + public function removeListener(listener:ITestListener):Void { + var len:Number = fListeners.length; + for(var i:Number = 0; i < len; i++) { + if(fListeners[i] == listener) { + fListeners.splice(i, 1); + return; + } + } + throw new InstanceNotFoundError("removeListener called without listener in list"); + } + /** + * Gets the number of detected errors. + */ + public function errorCount():Number { + return fErrors.length; + } + /** + * Returns an Enumeration for the errors + */ + public function errors():Array { + return fErrors; + } + /** + * Gets the number of detected failures. + */ + public function failureCount():Number { + return fFailures.length; + } + /** + * Returns an Enumeration for the failures + */ + public function failures():Array { + return fFailures; + } + + /** + * Runs a TestCase. + */ + public function run(test:TestCase):Void { + startTest(test); + try { + test.runBare(); + } + catch(e:AssertionFailedError) { + addFailure(test, e); + } + catch(ioe:IllegalOperationError) { + addError(test, ioe); + } + finally { + endTest(test); + } + } + /** + * Gets the number of run tests. + */ + public function runCount():Number { + return fRunTests; + } + /** + * Checks whether the test run should stop + */ + public function shouldStop():Boolean { + return fStop; + } + /** + * Informs the result that a test will be started. + */ + public function startTest(test:Test):Void { + var count:Number = test.countTestCases(); + fRunTests += count; + + var len:Number = fListeners.length; + var item:ITestListener; + for(var i:Number = 0; i < len; i++) { + item = ITestListener(fListeners[i]); + item.startTest(test); + } + } + /** + * Informs the result that a test was completed. + */ + public function endTest(test:Test):Void { + var len:Number = fListeners.length; + var item:ITestListener; + for(var i:Number = 0; i < len; i++) { + item = ITestListener(fListeners[i]); + item.endTest(test); + } + } + /** + * Marks that the test run should stop. + */ + public function stop():Void { + fStop = true; + } + /** + * Returns whether the entire test was successful or not. + */ + public function wasSuccessful():Boolean { + return (failureCount() == 0 && errorCount() == 0); + } +} \ No newline at end of file Added: trunk/framework/as25/asunit/framework/TestSuite.as =================================================================== --- trunk/framework/as25/asunit/framework/TestSuite.as (rev 0) +++ trunk/framework/as25/asunit/framework/TestSuite.as 2006-03-05 00:14:34 UTC (rev 6) @@ -0,0 +1,9 @@ +import asunit.framework.TestCase; +import asunit.framework.Test; + +class asunit.framework.TestSuite extends TestCase { + + publi... [truncated message content] |
|
From: <luk...@us...> - 2006-09-21 01:35:28
|
Revision: 117
http://svn.sourceforge.net/asunit/?rev=117&view=rev
Author: lukebayes
Date: 2006-09-20 18:35:18 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
Cleaned up traces and whatnot from async feature
Modified Paths:
--------------
trunk/framework/as3/AsUnitTestRunner.as
trunk/framework/as3/asunit/framework/TestCase.as
trunk/framework-test/as3/asunit/framework/TestCaseTest.as
Modified: trunk/framework/as3/AsUnitTestRunner.as
===================================================================
--- trunk/framework/as3/AsUnitTestRunner.as 2006-09-21 01:33:07 UTC (rev 116)
+++ trunk/framework/as3/AsUnitTestRunner.as 2006-09-21 01:35:18 UTC (rev 117)
@@ -1,12 +1,10 @@
package {
import asunit.textui.TestRunner;
- import asunit.framework.TestCaseTest;
public class AsUnitTestRunner extends TestRunner {
public function AsUnitTestRunner() {
start(AllTests, null, TestRunner.SHOW_TRACE);
-// start(TestCaseTest, "testAsync");
}
}
}
Modified: trunk/framework/as3/asunit/framework/TestCase.as
===================================================================
--- trunk/framework/as3/asunit/framework/TestCase.as 2006-09-21 01:33:07 UTC (rev 116)
+++ trunk/framework/as3/asunit/framework/TestCase.as 2006-09-21 01:35:18 UTC (rev 117)
@@ -296,7 +296,6 @@
context.getResult().addError(context, ioe);
}
finally {
- trace("ASYNC METHOD FINALLY BLOCK CALLED!");
context.methodIsAsynchronous = false;
context.runBare();
}
Modified: trunk/framework-test/as3/asunit/framework/TestCaseTest.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/TestCaseTest.as 2006-09-21 01:33:07 UTC (rev 116)
+++ trunk/framework-test/as3/asunit/framework/TestCaseTest.as 2006-09-21 01:35:18 UTC (rev 117)
@@ -48,10 +48,8 @@
}
public function testAsync():void {
- trace("TEST ASYNC");
var dispatcher:EventDispatcher = new EventDispatcher();
var handler:Function = addAsync(asyncHandler, 400);
- trace("METHOD IS ASYNC? : " + methodIsAsynchronous);
dispatcher.addEventListener(Event.COMPLETE, handler);
setTimeout(dispatcher.dispatchEvent, 200, new Event(Event.COMPLETE));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luk...@us...> - 2006-10-11 06:51:50
|
Revision: 125
http://svn.sourceforge.net/asunit/?rev=125&view=rev
Author: lukebayes
Date: 2006-10-10 23:51:42 -0700 (Tue, 10 Oct 2006)
Log Message:
-----------
Changed setTimeout to Timer object because setTimeout does not work as promised at all
Modified Paths:
--------------
trunk/framework/as3/asunit/framework/TestCase.as
trunk/framework/as3/asunit/framework/TestSuite.as
trunk/framework/as3/asunit/textui/TestRunner.as
trunk/framework-test/as3/asunit/framework/AllTests.as
Modified: trunk/framework/as3/asunit/framework/TestCase.as
===================================================================
--- trunk/framework/as3/asunit/framework/TestCase.as 2006-10-11 05:31:17 UTC (rev 124)
+++ trunk/framework/as3/asunit/framework/TestCase.as 2006-10-11 06:51:42 UTC (rev 125)
@@ -8,9 +8,9 @@
import asunit.util.Iterator;
import asunit.util.ArrayIterator;
import flash.net.getClassByAlias;
- import flash.utils.setTimeout;
- import flash.utils.clearTimeout;
import flash.events.Event;
+ import flash.utils.Timer;
+ import flash.events.TimerEvent;
/**
* A test case defines the fixture to run multiple tests. To define a test case<br>
@@ -86,11 +86,12 @@
protected var testMethods:Array;
protected var isComplete:Boolean;
protected var context:DisplayObjectContainer;
- private var asyncMethodTimeoutId:Number;
+ protected var methodIsAsynchronous:Boolean;
private var currentMethod:String;
private var runSingle:Boolean;
private var methodIterator:Iterator;
- protected var methodIsAsynchronous:Boolean;
+ private var timeout:Timer;
+ private var lastDuration:Number;
/**
* Constructs a test case with the given name.
@@ -211,10 +212,6 @@
private function runMethod(methodName:String):Boolean {
try {
-// if(!isNaN(asyncMethodTimeoutId)) {
-// clearTimeout(asyncMethodTimeoutId);
-// asyncMethodTimeoutId = NaN;
-// }
setUp();
currentMethod = methodName;
this[methodName]();
@@ -279,13 +276,18 @@
protected function addAsync(handler:Function = null, duration:Number=DEFAULT_TIMEOUT):Function {
if(handler == null) {
- handler = function() {};
+ handler = function(args:*):* {};
}
var context:TestCase = this;
context.methodIsAsynchronous = true;
- asyncMethodTimeoutId = setTimeout(asyncTimeoutHandler, duration, duration);
+ lastDuration = duration;
+
+ timeout = new Timer(duration, 1);
+ timeout.addEventListener(TimerEvent.TIMER_COMPLETE, timeoutCompleteHandler);
+ timeout.start();
return function(args:*):* {
- clearTimeout(context.asyncMethodTimeoutId);
+ context.timeout.stop();
+ context.timeout = null;
try {
handler.apply(context, arguments);
}
@@ -300,14 +302,13 @@
finally {
context.methodIsAsynchronous = false;
context.runTearDown();
- trace("CONTEXT: " + context);
context.runBare();
}
}
}
- private function asyncTimeoutHandler(duration:Number):void {
- result.addError(this, new IllegalOperationError("TestCase.timeout (" + duration + "ms) exceeded on an asynchronous test method."));
+ private function timeoutCompleteHandler(event:TimerEvent):void {
+ result.addError(this, new IllegalOperationError("TestCase.timeout (" + lastDuration + "ms) exceeded on an asynchronous test method."));
methodIsAsynchronous = false;
runTearDown();
runBare();
Modified: trunk/framework/as3/asunit/framework/TestSuite.as
===================================================================
--- trunk/framework/as3/asunit/framework/TestSuite.as 2006-10-11 05:31:17 UTC (rev 124)
+++ trunk/framework/as3/asunit/framework/TestSuite.as 2006-10-11 06:51:42 UTC (rev 125)
@@ -62,13 +62,13 @@
test.setResult(result);
test.addEventListener(Event.COMPLETE, testCompleteHandler);
test.run();
- if(!test.getIsComplete()) {
- isRunning = false;
- break;
- }
+// if(!test.getIsComplete()) {
+// isRunning = false;
+// break;
+// }
}
}
-
+
private function getIterator():ArrayIterator {
if(iterator == null) {
iterator = new ArrayIterator(fTests);
Modified: trunk/framework/as3/asunit/textui/TestRunner.as
===================================================================
--- trunk/framework/as3/asunit/textui/TestRunner.as 2006-10-11 05:31:17 UTC (rev 124)
+++ trunk/framework/as3/asunit/textui/TestRunner.as 2006-10-11 06:51:42 UTC (rev 125)
@@ -12,6 +12,8 @@
import flash.utils.describeType;
import flash.utils.getTimer;
import flash.utils.setInterval;
+ import flash.utils.Timer;
+ import flash.events.TimerEvent;
/**
* A command line based tool to run tests.
@@ -99,7 +101,7 @@
test.run();
return result;
}
-
+
private function testCompleteHandler(event:Event):void {
var endTime:Number = getTimer();
var runTime:Number = endTime - startTime;
Modified: trunk/framework-test/as3/asunit/framework/AllTests.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/AllTests.as 2006-10-11 05:31:17 UTC (rev 124)
+++ trunk/framework-test/as3/asunit/framework/AllTests.as 2006-10-11 06:51:42 UTC (rev 125)
@@ -1,6 +1,7 @@
package asunit.framework {
import asunit.framework.TestSuite;
import asunit.framework.AssertTest;
+ import asunit.framework.AsyncMethod2Test;
import asunit.framework.AsyncMethodTest;
import asunit.framework.TestCaseTest;
import asunit.framework.TestFailureTest;
@@ -10,8 +11,8 @@
public function AllTests() {
addTest(new asunit.framework.AssertTest());
+ addTest(new asunit.framework.AsyncMethod2Test());
addTest(new asunit.framework.AsyncMethodTest());
- addTest(new asunit.framework.AsyncMethod2Test());
addTest(new asunit.framework.TestCaseTest());
addTest(new asunit.framework.TestFailureTest());
addTest(new asunit.framework.VisualTestCaseTest());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luk...@us...> - 2006-10-12 06:13:35
|
Revision: 126
http://svn.sourceforge.net/asunit/?rev=126&view=rev
Author: lukebayes
Date: 2006-10-11 23:13:25 -0700 (Wed, 11 Oct 2006)
Log Message:
-----------
Restructured base TestCase so that it now runs completely asynchronously, fully support MXML projects, and addAsync works every time
Modified Paths:
--------------
trunk/framework/as3/AsUnitTestRunner.as
trunk/framework/as3/asunit/framework/TestCase.as
trunk/framework/as3/asunit/framework/TestSuite.as
trunk/framework-test/as3/asunit/framework/AllTests.as
trunk/framework-test/as3/asunit/framework/AsyncMethodTest.as
trunk/framework-test/as3/asunit/framework/TestCaseTest.as
Added Paths:
-----------
trunk/framework/as3/AsUnitApplication.as
Removed Paths:
-------------
trunk/framework-test/as3/asunit/framework/AsyncMethod2Test.as
Added: trunk/framework/as3/AsUnitApplication.as
===================================================================
--- trunk/framework/as3/AsUnitApplication.as (rev 0)
+++ trunk/framework/as3/AsUnitApplication.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -0,0 +1,20 @@
+package {
+ import asunit.framework.TestResult;
+ import mx.core.Application;
+ import asunit.textui.TestRunner;
+ import asunit.textui.FlexTestRunner;
+
+ public class AsUnitApplication extends Application {
+ protected var runner:TestRunner;
+
+ override protected function createChildren():void {
+ super.createChildren();
+ runner = new FlexTestRunner();
+ rawChildren.addChild(runner);
+ }
+
+ public function start(testCase:Class, testMethod:String = null, showTrace:Boolean = false):TestResult {
+ return runner.start(testCase, testMethod, showTrace);
+ }
+ }
+}
Modified: trunk/framework/as3/AsUnitTestRunner.as
===================================================================
--- trunk/framework/as3/AsUnitTestRunner.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework/as3/AsUnitTestRunner.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -1,10 +1,12 @@
package {
import asunit.textui.TestRunner;
+ import asunit.framework.TestCaseTest;
public class AsUnitTestRunner extends TestRunner {
public function AsUnitTestRunner() {
start(AllTests, null, TestRunner.SHOW_TRACE);
+// start(TestCaseTest, "testCustomConstructor");
}
}
}
Modified: trunk/framework/as3/asunit/framework/TestCase.as
===================================================================
--- trunk/framework/as3/asunit/framework/TestCase.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework/as3/asunit/framework/TestCase.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -11,6 +11,8 @@
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
+ import flash.utils.setTimeout;
+ import flash.utils.clearTimeout;
/**
* A test case defines the fixture to run multiple tests. To define a test case<br>
@@ -87,11 +89,10 @@
protected var isComplete:Boolean;
protected var context:DisplayObjectContainer;
protected var methodIsAsynchronous:Boolean;
+ protected var timeout:Timer;
private var currentMethod:String;
private var runSingle:Boolean;
private var methodIterator:Iterator;
- private var timeout:Timer;
- private var lastDuration:Number;
/**
* Constructs a test case with the given name.
@@ -175,7 +176,18 @@
public function runBare():void {
var name:String;
var itr:Iterator = getMethodIterator();
- var runCleanUp:Boolean = true;
+ if(itr.hasNext()) {
+ name = String(itr.next());
+ runMethod(name);
+ }
+ else {
+ cleanUp();
+ getResult().endTest(this);
+ isComplete = true;
+ dispatchEvent(new Event(Event.COMPLETE));
+ }
+
+/*
try {
while(itr.hasNext()) {
name = String(itr.next());
@@ -195,6 +207,7 @@
}
}
}
+*/
}
private function getMethodIterator():Iterator {
@@ -210,10 +223,11 @@
protected function cleanUp():void {
}
- private function runMethod(methodName:String):Boolean {
+ private function runMethod(methodName:String):void {
try {
setUp();
currentMethod = methodName;
+ methodIsAsynchronous = false;
this[methodName]();
}
catch(e:AssertionFailedError) {
@@ -226,7 +240,6 @@
if(!methodIsAsynchronous) {
runTearDown();
}
- return !methodIsAsynchronous;
}
}
@@ -278,16 +291,14 @@
if(handler == null) {
handler = function(args:*):* {};
}
- var context:TestCase = this;
- context.methodIsAsynchronous = true;
- lastDuration = duration;
-
+ methodIsAsynchronous = true;
timeout = new Timer(duration, 1);
- timeout.addEventListener(TimerEvent.TIMER_COMPLETE, timeoutCompleteHandler);
+ timeout.addEventListener(TimerEvent.TIMER_COMPLETE, getTimeoutComplete(duration));
timeout.start();
+ // try ..args
+ var context:TestCase = this;
return function(args:*):* {
context.timeout.stop();
- context.timeout = null;
try {
handler.apply(context, arguments);
}
@@ -295,29 +306,27 @@
context.getResult().addFailure(context, e);
}
catch(ioe:IllegalOperationError) {
- trace('illegaloperation'); // this trace needs to be here?! Why?!
- // without that trace, the app throws an error!!!!
context.getResult().addError(context, ioe);
}
finally {
- context.methodIsAsynchronous = false;
context.runTearDown();
- context.runBare();
}
}
}
- private function timeoutCompleteHandler(event:TimerEvent):void {
- result.addError(this, new IllegalOperationError("TestCase.timeout (" + lastDuration + "ms) exceeded on an asynchronous test method."));
- methodIsAsynchronous = false;
- runTearDown();
- runBare();
+ private function getTimeoutComplete(duration:Number):Function {
+ var context:TestCase = this;
+ return function(event:Event):void {
+ context.getResult().addError(context, new IllegalOperationError("TestCase.timeout (" + duration + "ms) exceeded on an asynchronous test method."));
+ context.runTearDown();
+ }
}
-
+
protected function runTearDown():void {
if(!runSingle) {
tearDown();
}
+ setTimeout(runBare, 5);
}
protected function addChild(child:DisplayObject):DisplayObject {
Modified: trunk/framework/as3/asunit/framework/TestSuite.as
===================================================================
--- trunk/framework/as3/asunit/framework/TestSuite.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework/as3/asunit/framework/TestSuite.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -62,10 +62,10 @@
test.setResult(result);
test.addEventListener(Event.COMPLETE, testCompleteHandler);
test.run();
-// if(!test.getIsComplete()) {
-// isRunning = false;
-// break;
-// }
+ if(!test.getIsComplete()) {
+ isRunning = false;
+ break;
+ }
}
}
Modified: trunk/framework-test/as3/asunit/framework/AllTests.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/AllTests.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework-test/as3/asunit/framework/AllTests.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -1,7 +1,6 @@
package asunit.framework {
import asunit.framework.TestSuite;
import asunit.framework.AssertTest;
- import asunit.framework.AsyncMethod2Test;
import asunit.framework.AsyncMethodTest;
import asunit.framework.TestCaseTest;
import asunit.framework.TestFailureTest;
@@ -11,7 +10,6 @@
public function AllTests() {
addTest(new asunit.framework.AssertTest());
- addTest(new asunit.framework.AsyncMethod2Test());
addTest(new asunit.framework.AsyncMethodTest());
addTest(new asunit.framework.TestCaseTest());
addTest(new asunit.framework.TestFailureTest());
Deleted: trunk/framework-test/as3/asunit/framework/AsyncMethod2Test.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/AsyncMethod2Test.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework-test/as3/asunit/framework/AsyncMethod2Test.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -1,50 +0,0 @@
-package asunit.framework {
- import asunit.framework.TestCase;
- import flash.display.Sprite;
- import flash.utils.setTimeout;
-
- public class AsyncMethod2Test extends TestCase {
- private var instance:Sprite;
-
- public function AsyncMethod2Test(testMethod:String = null) {
- super(testMethod);
- }
-
- protected override function setUp():void {
- instance = new Sprite();
- addChild(instance);
- }
-
- protected override function tearDown():void {
- removeChild(instance);
- instance = null;
- }
-
- public function testInstantiated():void {
- assertTrue("Sprite instantiated", instance is Sprite);
- }
-
- public function testAsyncMethod():void {
- var handler:Function = addAsync(asyncHandler);
- setTimeout(handler, 100);
- }
-
- private function asyncHandler():void {
- assertTrue(instance is Sprite);
- }
-
- public function testAsyncVisualEntity():void {
- var handler:Function = addAsync(spriteHandler);
- setTimeout(handler, 100);
- }
-
- private function spriteHandler():void {
- assertTrue(instance is Sprite);
- }
-
- public function testAsyncVisualEntity2():void {
- var handler:Function = addAsync(spriteHandler);
- setTimeout(handler, 100);
- }
- }
-}
Modified: trunk/framework-test/as3/asunit/framework/AsyncMethodTest.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/AsyncMethodTest.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework-test/as3/asunit/framework/AsyncMethodTest.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -1,6 +1,6 @@
package asunit.framework {
- import asunit.framework.TestCase;
import flash.display.Sprite;
+ import flash.events.Event;
import flash.utils.setTimeout;
public class AsyncMethodTest extends TestCase {
Modified: trunk/framework-test/as3/asunit/framework/TestCaseTest.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/TestCaseTest.as 2006-10-11 06:51:42 UTC (rev 125)
+++ trunk/framework-test/as3/asunit/framework/TestCaseTest.as 2006-10-12 06:13:25 UTC (rev 126)
@@ -17,36 +17,64 @@
public function testCustomConstructor():void {
var mock:TestCaseMock = new TestCaseMock("testMethod1");
+ var handler:Function = addAsync(getCustomConstructorCompleteHandler(mock));
+ mock.addEventListener(Event.COMPLETE, handler);
mock.run();
- assertTrue("testMethod1Run", mock.testMethod1Run);
- assertFalse("testMethod2Run", mock.testMethod2Run);
- assertFalse("testMethod3Run", mock.testMethod3Run);
}
+ private function getCustomConstructorCompleteHandler(mock:TestCaseMock):Function {
+ return function():* {
+ assertTrue("testMethod1Run", mock.testMethod1Run);
+ assertFalse("testMethod2Run", mock.testMethod2Run);
+ assertFalse("testMethod3Run", mock.testMethod3Run);
+ }
+ }
+
public function testCustomConstructor2():void {
var mock:TestCaseMock = new TestCaseMock("testMethod1, testMethod3");
+ var handler:Function = addAsync(getCustomConstructor2CompleteHandler(mock));
+ mock.addEventListener(Event.COMPLETE, handler);
mock.run();
- assertTrue("testMethod1Run", mock.testMethod1Run);
- assertFalse("testMethod2Run", mock.testMethod2Run);
- assertTrue("testMethod3Run", mock.testMethod3Run);
}
+
+ private function getCustomConstructor2CompleteHandler(mock:TestCaseMock):Function {
+ return function():* {
+ assertTrue("testMethod1Run", mock.testMethod1Run);
+ assertFalse("testMethod2Run", mock.testMethod2Run);
+ assertTrue("testMethod3Run", mock.testMethod3Run);
+ }
+ }
public function testCustomConstructor3():void {
var mock:TestCaseMock = new TestCaseMock("testMethod1,testMethod3");
+ var handler:Function = addAsync(getCustomConstructor3CompleteHandler(mock));
+ mock.addEventListener(Event.COMPLETE, handler);
mock.run();
- assertTrue("testMethod1Run", mock.testMethod1Run);
- assertFalse("testMethod2Run", mock.testMethod2Run);
- assertTrue("testMethod3Run", mock.testMethod3Run);
}
+
+ private function getCustomConstructor3CompleteHandler(mock:TestCaseMock):Function {
+ return function():* {
+ assertTrue("testMethod1Run", mock.testMethod1Run);
+ assertFalse("testMethod2Run", mock.testMethod2Run);
+ assertTrue("testMethod3Run", mock.testMethod3Run);
+ }
+ }
public function testCustomConstructor4():void {
var mock:TestCaseMock = new TestCaseMock("testMethod1, testMethod2,testMethod3");
+ var handler:Function = addAsync(getCustomConstructor4CompleteHandler(mock));
+ mock.addEventListener(Event.COMPLETE, handler);
mock.run();
- assertTrue("testMethod1Run", mock.testMethod1Run);
- assertTrue("testMethod2Run", mock.testMethod2Run);
- assertTrue("testMethod3Run", mock.testMethod3Run);
}
+ private function getCustomConstructor4CompleteHandler(mock:TestCaseMock):Function {
+ return function():* {
+ assertTrue("testMethod1Run", mock.testMethod1Run);
+ assertTrue("testMethod2Run", mock.testMethod2Run);
+ assertTrue("testMethod3Run", mock.testMethod3Run);
+ }
+ }
+
public function testAsync():void {
var dispatcher:EventDispatcher = new EventDispatcher();
var handler:Function = addAsync(asyncHandler, 400);
@@ -56,8 +84,6 @@
private function asyncHandler(event:Event):void {
assertEquals(event.type, Event.COMPLETE);
-// assertTrue(false);
-// throw new IllegalOperationError("broken");
}
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luk...@us...> - 2007-01-09 01:06:36
|
Revision: 146
http://svn.sourceforge.net/asunit/?rev=146&view=rev
Author: lukebayes
Date: 2007-01-08 17:06:36 -0800 (Mon, 08 Jan 2007)
Log Message:
-----------
Added License and Changelog to release
Added Paths:
-----------
trunk/framework/CHANGE-LOG.txt
trunk/framework/LICENSE.txt
Added: trunk/framework/CHANGE-LOG.txt
===================================================================
--- trunk/framework/CHANGE-LOG.txt (rev 0)
+++ trunk/framework/CHANGE-LOG.txt 2007-01-09 01:06:36 UTC (rev 146)
@@ -0,0 +1,1107 @@
+
+----------------------------
+RELEASE
+----------------------------
+
+------------------------------------------------------------------------
+r140 | lukebayes | 2006-11-24 00:32:08 -0800 (Fri, 24 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3
+ M /trunk/framework/as3/build.sh
+
+Cleaning up build process
+------------------------------------------------------------------------
+r137 | alimills | 2006-11-11 08:57:45 -0800 (Sat, 11 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/Assert.as
+
+adding assertEqualsFloat() which was donated by Penner
+------------------------------------------------------------------------
+r136 | lukebayes | 2006-11-06 17:23:44 -0800 (Mon, 06 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/errors/AbstractMemberCalledError.as
+ M /trunk/framework/as3/asunit/errors/AssertionFailedError.as
+ M /trunk/framework/as3/asunit/errors/ClassNotFoundError.as
+ M /trunk/framework/as3/asunit/errors/InstanceNotFoundError.as
+ D /trunk/framework/as3/asunit/errors/InvocationTargetError.as
+ M /trunk/framework/as3/asunit/errors/UnimplementedFeatureError.as
+ M /trunk/framework/as3/asunit/framework/AsynchronousTestCaseExample.as
+ M /trunk/framework/as3/asunit/framework/TestCaseExample.as
+ M /trunk/framework/as3/asunit/runner/BaseTestRunner.as
+ D /trunk/framework/as3/asunit/runner/TestRunListener.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+ M /trunk/framework/as3/asunit/util/Properties.as
+ A /trunk/framework/as3/build.sh
+ A /trunk/framework/as3/manifest.xml
+
+Cleaned up classes for swc creation, removed unused support and error classes
+------------------------------------------------------------------------
+r135 | lukebayes | 2006-11-06 16:17:29 -0800 (Mon, 06 Nov 2006) | 1 line
+Changed paths:
+ D /trunk/framework/as3/mx/managers/LayoutManagerTest.as
+ D /trunk/framework/as3/mx/managers/MockContainer.as
+
+Removed LayoutManagerTest and related class, as they can't be executed / tested without framework dependencies
+------------------------------------------------------------------------
+r134 | lukebayes | 2006-11-06 16:15:34 -0800 (Mon, 06 Nov 2006) | 1 line
+Changed paths:
+ D /trunk/framework/as3/mx/managers/ILayoutManagerClient.as
+
+Removed interface that didn't actually need to be imported
+------------------------------------------------------------------------
+r133 | lukebayes | 2006-11-06 16:11:50 -0800 (Mon, 06 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+
+Cleaned up LayoutManager code to avoid framework dependencies
+------------------------------------------------------------------------
+r132 | lukebayes | 2006-11-06 16:01:21 -0800 (Mon, 06 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ A /trunk/framework/as3/mx
+ A /trunk/framework/as3/mx/managers
+ A /trunk/framework/as3/mx/managers/ILayoutManagerClient.as
+ A /trunk/framework/as3/mx/managers/LayoutManager.as
+ A /trunk/framework/as3/mx/managers/LayoutManagerTest.as
+ A /trunk/framework/as3/mx/managers/MockContainer.as
+
+Added custom Implementation of LayoutManager that will prevent Validation of Flex components after tearDown has been called, this greatly speeds up the execution of larger test suites
+------------------------------------------------------------------------
+r131 | lukebayes | 2006-10-23 12:12:48 -0700 (Mon, 23 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+
+
+----------------------------
+RELEASE
+----------------------------
+
+
+Added bug fix to prevent multiple dispacthes to an async method from completing test execution more than once
+------------------------------------------------------------------------
+r128 | lukebayes | 2006-10-17 14:41:30 -0700 (Tue, 17 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+
+Working on async methods in TestCase
+------------------------------------------------------------------------
+r127 | lukebayes | 2006-10-11 23:21:07 -0700 (Wed, 11 Oct 2006) | 1 line
+Changed paths:
+ D /trunk/framework/as3/AsUnitApplication.as
+ A /trunk/framework/as3/asunit/textui/FlexRunner.as
+
+Moved base flex application to textui package
+------------------------------------------------------------------------
+r126 | lukebayes | 2006-10-11 23:13:25 -0700 (Wed, 11 Oct 2006) | 1 line
+Changed paths:
+ A /trunk/framework/as3/AsUnitApplication.as
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/framework/TestSuite.as
+ M /trunk/framework-test/as3/asunit/framework/AllTests.as
+ D /trunk/framework-test/as3/asunit/framework/AsyncMethod2Test.as
+ M /trunk/framework-test/as3/asunit/framework/AsyncMethodTest.as
+ M /trunk/framework-test/as3/asunit/framework/TestCaseTest.as
+
+Restructured base TestCase so that it now runs completely asynchronously, fully support MXML projects, and addAsync works every time
+------------------------------------------------------------------------
+r125 | lukebayes | 2006-10-10 23:51:42 -0700 (Tue, 10 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/framework/TestSuite.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+ M /trunk/framework-test/as3/asunit/framework/AllTests.as
+
+Changed setTimeout to Timer object because setTimeout does not work as promised at all
+------------------------------------------------------------------------
+r124 | lukebayes | 2006-10-10 22:31:17 -0700 (Tue, 10 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+
+Fixed Indenting on FlexTestRunner
+------------------------------------------------------------------------
+r122 | lukebayes | 2006-10-10 22:09:04 -0700 (Tue, 10 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/framework/TestSuite.as
+
+Made TestSuites pause execution for asynchronus TestCases
+------------------------------------------------------------------------
+r121 | lukebayes | 2006-10-05 13:17:40 -0700 (Thu, 05 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCaseExample.as
+
+updated example
+------------------------------------------------------------------------
+r120 | lukebayes | 2006-10-05 12:07:54 -0700 (Thu, 05 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+
+hooked up DEFAULT_TIMEOUT constant to async method timeout duration
+------------------------------------------------------------------------
+r119 | lukebayes | 2006-10-05 12:03:10 -0700 (Thu, 05 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+
+Got async test case working much better within the context of a Flex Framework application
+------------------------------------------------------------------------
+r118 | lukebayes | 2006-09-21 11:19:08 -0700 (Thu, 21 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/framework/TestSuite.as
+ M /trunk/framework/as25/asunit/runner/BaseTestRunner.as
+ A /trunk/framework/as25/asunit/util
+ A /trunk/framework/as25/asunit/util/ArrayIterator.as
+ A /trunk/framework/as25/asunit/util/ArrayIteratorTest.as
+ A /trunk/framework/as25/asunit/util/Iterator.as
+
+added asynchronous execution of test suites to avoid script timeouts on large projects
+------------------------------------------------------------------------
+r117 | lukebayes | 2006-09-20 18:35:18 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework-test/as3/asunit/framework/TestCaseTest.as
+
+Cleaned up traces and whatnot from async feature
+------------------------------------------------------------------------
+r115 | lukebayes | 2006-09-20 18:32:40 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/Assert.as
+ M /trunk/framework/as3/asunit/framework/Test.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/framework/TestSuite.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+Async test cases and suites seem to be working properly
+------------------------------------------------------------------------
+r114 | lukebayes | 2006-09-20 14:23:53 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCaseExample.as
+
+updating comments in TestCase
+------------------------------------------------------------------------
+r113 | lukebayes | 2006-09-20 14:22:59 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+
+updated runner to execute all tests
+------------------------------------------------------------------------
+r112 | lukebayes | 2006-09-20 14:21:37 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ D /trunk/framework/as3/asunit/AllTests.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ A /trunk/framework/as3/asunit/framework/TestCaseExample.as
+
+got async method working better
+------------------------------------------------------------------------
+r111 | lukebayes | 2006-09-20 11:50:50 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework
+
+added ignore props
+------------------------------------------------------------------------
+r104 | lukebayes | 2006-09-20 11:20:59 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ D /trunk/framework/as3/AllTests.as
+ D /trunk/framework/as3/asunit/framework/AllTests.as
+ D /trunk/framework/as3/asunit/framework/AssertTest.as
+ D /trunk/framework/as3/asunit/framework/MockData.xml
+ D /trunk/framework/as3/asunit/framework/TestCaseMock.as
+ D /trunk/framework/as3/asunit/framework/TestCaseTest.as
+ D /trunk/framework/as3/asunit/framework/TestFailureTest.as
+ D /trunk/framework/as3/asunit/framework/VisualTestCaseTest.as
+ D /trunk/framework/as3/asunit/runner/BaseTestRunnerMock.as
+ D /trunk/framework/as3/asunit/textui/AllTests.as
+ D /trunk/framework/as3/asunit/textui/TestRunnerTest.as
+ D /trunk/framework/as3/asunit/textui/TestRunnerTestCaseMock.as
+ D /trunk/framework/as3/asunit/util/AllTests.as
+ D /trunk/framework/as3/asunit/util/ArrayIteratorTest.as
+
+moving test classes to framework-test
+------------------------------------------------------------------------
+r103 | lukebayes | 2006-09-20 11:16:23 -0700 (Wed, 20 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3
+
+updated ignore props
+------------------------------------------------------------------------
+r102 | lukebayes | 2006-09-19 15:23:56 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ A /trunk/framework/as3/asunit/textui/AllTests.as
+
+adding test suites
+------------------------------------------------------------------------
+r101 | lukebayes | 2006-09-19 15:22:59 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/textui/TestRunnerTest.as
+
+working toward async test methods, seems like it might be working.
+------------------------------------------------------------------------
+r100 | lukebayes | 2006-09-19 15:11:36 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/Assert.as
+ M /trunk/framework/as3/asunit/framework/AssertTest.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/textui/TestRunnerTest.as
+
+working toward async test methods, almost there
+------------------------------------------------------------------------
+r99 | lukebayes | 2006-09-19 14:40:51 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/textui/TestRunnerTest.as
+
+got a basic async test method working, still not ideal though
+------------------------------------------------------------------------
+r98 | lukebayes | 2006-09-19 13:35:05 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/Assert.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/framework/TestResult.as
+ M /trunk/framework/as3/asunit/textui/TestRunnerTest.as
+ M /trunk/framework/as3/asunit/textui/TestRunnerTestCaseMock.as
+
+Working on async test methods
+------------------------------------------------------------------------
+r97 | lukebayes | 2006-09-19 09:57:15 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ A /trunk/framework/as3/asunit/textui/TestRunnerTest.as
+ A /trunk/framework/as3/asunit/textui/TestRunnerTestCaseMock.as
+
+added TestRunner test and mock
+------------------------------------------------------------------------
+r96 | lukebayes | 2006-09-19 09:56:18 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/AllTests.as
+ M /trunk/framework/as3/asunit/framework/AssertTest.as
+ M /trunk/framework/as3/asunit/framework/TestCaseMock.as
+ M /trunk/framework/as3/asunit/framework/TestCaseTest.as
+ M /trunk/framework/as3/asunit/framework/TestFailureTest.as
+ M /trunk/framework/as3/asunit/framework/VisualTestCaseTest.as
+ A /trunk/framework/as3/asunit/util/AllTests.as
+ A /trunk/framework/as3/asunit/util/ArrayIterator.as
+ A /trunk/framework/as3/asunit/util/ArrayIteratorTest.as
+ A /trunk/framework/as3/asunit/util/Iterator.as
+
+added ArrayIterator to framework
+------------------------------------------------------------------------
+r93 | lukebayes | 2006-09-19 09:24:06 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/AllTests.as
+ M /trunk/framework/as3/asunit/framework/AssertTest.as
+ M /trunk/framework/as3/asunit/framework/TestCaseTest.as
+ M /trunk/framework/as3/asunit/framework/TestFailureTest.as
+ D /trunk/framework/as3/asunit/framework/TestSuiteTest.as
+
+fixing test case constructors
+------------------------------------------------------------------------
+r92 | lukebayes | 2006-09-19 09:19:15 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ A /trunk/framework/as3/AllTests.as
+ A /trunk/framework/as3/asunit/AllTests.as
+ A /trunk/framework/as3/asunit/framework/AllTests.as
+
+added test suites to repository
+------------------------------------------------------------------------
+r91 | lukebayes | 2006-09-19 09:13:14 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/AsUnitTestRunner.as
+ M /trunk/framework/as3/asunit/framework/AssertTest.as
+ M /trunk/framework/as3/asunit/framework/TestCaseTest.as
+
+got test fixtures up to date
+------------------------------------------------------------------------
+r90 | alimills | 2006-09-19 09:11:28 -0700 (Tue, 19 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+fixing bug that broke AsUnit in ActionScript projects
+------------------------------------------------------------------------
+r69 | lukebayes | 2006-08-25 12:41:34 -0700 (Fri, 25 Aug 2006) | 2 lines
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+
+got rid of trace statements
+
+------------------------------------------------------------------------
+r68 | lukebayes | 2006-08-22 20:11:38 -0700 (Tue, 22 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+ M /trunk/framework/as3/asunit/textui/ResultPrinter.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+got the start interface to work properly in the FlexTestRunner (support showTrace:Boolean)
+------------------------------------------------------------------------
+r67 | lukebayes | 2006-08-18 11:18:11 -0700 (Fri, 18 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+
+added removeChild support to the FlexTestRunner
+------------------------------------------------------------------------
+r66 | lukebayes | 2006-08-18 11:08:49 -0700 (Fri, 18 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+ M /trunk/framework/as3/asunit/textui/ResultPrinter.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+working on flex2 support
+------------------------------------------------------------------------
+r65 | alimills | 2006-08-15 14:28:13 -0700 (Tue, 15 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+ M /trunk/framework/as3/asunit/textui/ResultPrinter.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+Flex project support added!!
+------------------------------------------------------------------------
+r64 | alimills | 2006-08-15 14:19:57 -0700 (Tue, 15 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/TestListener.as
+ M /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+integrated with flex!?
+------------------------------------------------------------------------
+r63 | alimills | 2006-08-15 12:14:06 -0700 (Tue, 15 Aug 2006) | 1 line
+Changed paths:
+ A /trunk/framework/as3/asunit/textui/FlexTestRunner.as
+ M /trunk/framework/as3/asunit/textui/ResultPrinter.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+
+working towards a working FlexTestRunner
+------------------------------------------------------------------------
+r62 | alimills | 2006-08-08 16:20:09 -0700 (Tue, 08 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/errors/AssertionFailedError.as
+ M /trunk/framework/as3/asunit/errors/InstanceNotFoundError.as
+ M /trunk/framework/as3/asunit/framework/AsynchronousTestCase.as
+ M /trunk/framework/as3/asunit/textui/ResultPrinter.as
+ M /trunk/xului/bin/AsUnit.xpi
+
+Flex Builder 2.0 release fixes
+------------------------------------------------------------------------
+r61 | alimills | 2006-06-25 10:32:09 -0700 (Sun, 25 Jun 2006) | 4 lines
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/MockData.xml
+
+The mockdata.xml file in as3\asunit\framework\ uses "&", which should be
+escaped with "&". Also, "Pragmattic" should have one "t". =)
+
+Robert
+------------------------------------------------------------------------
+r57 | alimills | 2006-06-20 15:27:11 -0700 (Tue, 20 Jun 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as3/asunit/framework/Assert.as
+ M /trunk/framework/as3/asunit/framework/TestCase.as
+ M /trunk/framework/as3/asunit/framework/TestFailure.as
+ M /trunk/framework/as3/asunit/framework/TestListener.as
+ M /trunk/framework/as3/asunit/framework/TestResult.as
+ M /trunk/framework/as3/asunit/framework/TestSuite.as
+ M /trunk/framework/as3/asunit/runner/BaseTestRunner.as
+ M /trunk/framework/as3/asunit/textui/ResultPrinter.as
+ M /trunk/framework/as3/asunit/textui/TestRunner.as
+ A /trunk/installers/win/AsUnit-20060619.msi
+ M /trunk/xului/bin/AsUnit.xpi
+ M /trunk/xului/src/chrome/AsUnit.jar
+ M /trunk/xului/src/chrome/asunit/content/asunit/SetupWizard.xul
+ M /trunk/xului/src/chrome/asunit/content/asunit/script/tokens/As3TestCaseConfig.js
+ M /trunk/xului/src/chrome/en-US.jar
+
+updating for Flex Builder 2.0 beta 3
+------------------------------------------------------------------------
+r54 | lukebayes | 2006-04-08 16:17:30 -0700 (Sat, 08 Apr 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/framework/AssertTest.as
+
+Removed bad trace statement
+------------------------------------------------------------------------
+r53 | lukebayes | 2006-04-08 14:28:50 -0700 (Sat, 08 Apr 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/framework/TestCase.as
+ M /trunk/framework/as25/asunit/framework/TestCaseXml.as
+ M /trunk/framework/as25/asunit/framework/TestResult.as
+
+Working on asynchronous test case error handling. Seems to be working properly now
+------------------------------------------------------------------------
+r47 | lukebayes | 2006-03-16 09:30:23 -0800 (Thu, 16 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/framework/TestCase.as
+
+Moved call to setUp inside of the try..catch so that errors thrown during calls to setUp get caught and displayed.
+------------------------------------------------------------------------
+r46 | lukebayes | 2006-03-16 09:28:53 -0800 (Thu, 16 Mar 2006) | 2 lines
+Changed paths:
+ A /trunk/framework/as25/asunit/errors/AssertionPassedError.as
+ M /trunk/framework/as25/asunit/textui/ResultPrinter.as
+
+Added AssertionPassedError to facilitate try..catch successes
+Updated ResultPrinter so that the traceOutput TextField is hidden until trace is called the first time. This allows us to select the text in the regular output - unless there are trace statements.
+------------------------------------------------------------------------
+r36 | alimills | 2006-03-08 09:52:56 -0800 (Wed, 08 Mar 2006) | 1 line
+Changed paths:
+ D /trunk/framework/as3/AsUnit.as
+ A /trunk/framework/as3/AsUnitTestRunner.as
+
+renaming AsUnit to AsUnitTestRunner
+------------------------------------------------------------------------
+r35 | alimills | 2006-03-08 09:50:50 -0800 (Wed, 08 Mar 2006) | 2 lines
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.as
+ D /trunk/framework/as25/AsUnitTestRunner.fla
+ D /trunk/framework/as25/AsUnitTestRunner.swf
+
+- removing FLA and SWF
+- cleaned up AsUnitTestRunner
+------------------------------------------------------------------------
+r34 | lukebayes | 2006-03-08 09:40:37 -0800 (Wed, 08 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.as
+
+Attempting to commit from anonymous (shouldn't work)
+------------------------------------------------------------------------
+r33 | lukebayes | 2006-03-08 09:38:59 -0800 (Wed, 08 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.as
+
+Removed bad start
+------------------------------------------------------------------------
+r32 | lukebayes | 2006-03-08 09:28:15 -0800 (Wed, 08 Mar 2006) | 1 line
+Changed paths:
+ D /trunk/framework/as3/AllTests.as
+ D /trunk/framework/as3/asunit/AllTests.as
+ D /trunk/framework/as3/asunit/errors/AllTests.as
+ D /trunk/framework/as3/asunit/framework/AllTests.as
+ D /trunk/framework/as3/asunit/runner/AllTests.as
+ D /trunk/framework/as3/asunit/textui/AllTests.as
+
+Removed concrete TestSuites from repository as they were causing conflicts in concrete projects
+------------------------------------------------------------------------
+r29 | lukebayes | 2006-03-07 12:13:39 -0800 (Tue, 07 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/textui/ResultPrinter.as
+
+Changed ResultPrinter to show names instead of company
+------------------------------------------------------------------------
+r28 | lukebayes | 2006-03-07 09:19:32 -0800 (Tue, 07 Mar 2006) | 3 lines
+Changed paths:
+ M /trunk/framework/as25/asunit/runner/BaseTestRunner.as
+ M /trunk/framework/as25/asunit/textui/ResultPrinter.as
+
+- Fixed infinite loop in async feature
+- Updated branding to names from company
+- Added 2.5 version number
+------------------------------------------------------------------------
+r25 | lukebayes | 2006-03-06 22:42:13 -0800 (Mon, 06 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/framework/Test.as
+ M /trunk/framework/as25/asunit/framework/TestCase.as
+ A /trunk/framework/as25/asunit/framework/TestCaseXml.as
+ M /trunk/framework/as25/asunit/framework/TestFailure.as
+ M /trunk/framework/as25/asunit/framework/TestSuite.as
+ M /trunk/framework/as25/asunit/runner/BaseTestRunner.as
+
+Added support for singular, asynchronous test cases. Still looking at ways to implement async methods.
+------------------------------------------------------------------------
+r23 | lukebayes | 2006-03-06 09:28:51 -0800 (Mon, 06 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.as
+ M /trunk/framework/as25/asunit/framework/Assert.as
+ A /trunk/framework/as25/asunit/framework/AssertMock.as
+ A /trunk/framework/as25/asunit/framework/AssertTest.as
+ A /trunk/framework/as25/asunit/framework/TestCaseMock.as
+ A /trunk/framework/as25/asunit/framework/TestCaseTest.as
+
+Adding tests to framework
+------------------------------------------------------------------------
+r18 | lukebayes | 2006-03-05 22:01:52 -0800 (Sun, 05 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as2/AsUnitUi.swf
+ M /trunk/framework/as2/com/asunit/ui/Main.as
+
+Incremented version number for swfui
+------------------------------------------------------------------------
+r17 | lukebayes | 2006-03-05 21:48:16 -0800 (Sun, 05 Mar 2006) | 18 lines
+Changed paths:
+ M /trunk/framework/as2/com/asunit/framework/TestRunner.as
+
+Implemented changes as per Darren Cook:
+
+I think the renderTests(arr:Array) function should be changed to
+renderTests(Void), and then change:
+ lc["addTests"](arr);
+ tests = new Array();
+to read:
+ lc["addTests"](tests);
+ tests = new Array();
+
+The reason is simply that this.tests gets reset so passing in anything
+other than this.tests is dangerous.
+
+While there I think renderTests() and getLocalConn() can be changed from
+public to private: no other classes seem to call them.
+
+addSuccess() and addFailure() don't seem to be called from anywhere at
+all. What are they for, and do they need to be part of the public interface?
+------------------------------------------------------------------------
+r16 | lukebayes | 2006-03-04 19:02:44 -0800 (Sat, 04 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.swf
+
+Checking in the SWF file
+------------------------------------------------------------------------
+r12 | lukebayes | 2006-03-04 18:17:50 -0800 (Sat, 04 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/framework/TestCase.as
+
+Was working on making all method calls asynchronous, but this was non-trivial. Will now look at re-implementing the original support for async TestCases
+------------------------------------------------------------------------
+r11 | lukebayes | 2006-03-04 18:00:49 -0800 (Sat, 04 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/textui/ResultPrinter.as
+
+It didn't do it
+------------------------------------------------------------------------
+r10 | lukebayes | 2006-03-04 18:00:27 -0800 (Sat, 04 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/framework/as25/asunit/textui/ResultPrinter.as
+
+Trying to find out if subversion will insert meta data directly into a file
+------------------------------------------------------------------------
+r9 | lukebayes | 2006-03-04 17:51:25 -0800 (Sat, 04 Mar 2006) | 3 lines
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.as
+ M /trunk/framework/as25/AsUnitTestRunner.swf
+ M /trunk/framework/as25/asunit/framework/Assert.as
+ M /trunk/framework/as25/asunit/framework/TestCase.as
+ M /trunk/framework/as25/asunit/runner/BaseTestRunner.as
+ M /trunk/framework/as25/asunit/textui/ResultPrinter.as
+
+- Added support for Visual TestCases.
+- Added support for single-method TestRunners (from the start command)
+
+------------------------------------------------------------------------
+r7 | lukebayes | 2006-03-04 17:18:26 -0800 (Sat, 04 Mar 2006) | 2 lines
+Changed paths:
+ M /trunk/framework/as25/AsUnitTestRunner.as
+ M /trunk/framework/as25/AsUnitTestRunner.fla
+ M /trunk/framework/as25/AsUnitTestRunner.swf
+ M /trunk/framework/as25/asunit/framework/Assert.as
+ M /trunk/framework/as25/asunit/framework/TestCase.as
+ M /trunk/framework/as25/asunit/framework/TestSuite.as
+
+Got TestSuites working.
+Still need to get Visual TestCases and Async TestCases.
+------------------------------------------------------------------------
+r6 | lukebayes | 2006-03-04 16:14:34 -0800 (Sat, 04 Mar 2006) | 1 line
+Changed paths:
+ A /trunk/framework/as25
+ A /trunk/framework/as25/AsUnitTestRunner.as
+ A /trunk/framework/as25/AsUnitTestRunner.fla
+ A /trunk/framework/as25/AsUnitTestRunner.swf
+ A /trunk/framework/as25/asunit
+ A /trunk/framework/as25/asunit/errors
+ A /trunk/framework/as25/asunit/errors/AssertionFailedError.as
+ A /trunk/framework/as25/asunit/errors/ClassNotFoundError.as
+ A /trunk/framework/as25/asunit/errors/IllegalOperationError.as
+ A /trunk/framework/as25/asunit/errors/InstanceNotFoundError.as
+ A /trunk/framework/as25/asunit/errors/InvocationTargetError.as
+ A /trunk/framework/as25/asunit/errors/UnimplementedFeatureError.as
+ A /trunk/framework/as25/asunit/framework
+ A /trunk/framework/as25/asunit/framework/Assert.as
+ A /trunk/framework/as25/asunit/framework/ITestListener.as
+ A /trunk/framework/as25/asunit/framework/Test.as
+ A /trunk/framework/as25/asunit/framework/TestCase.as
+ A /trunk/framework/as25/asunit/framework/TestFailure.as
+ A /trunk/framework/as25/as...
[truncated message content] |
|
From: <luk...@us...> - 2008-07-11 18:27:29
|
Revision: 189
http://asunit.svn.sourceforge.net/asunit/?rev=189&view=rev
Author: lukebayes
Date: 2008-07-11 11:27:39 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
Preparing for integration of Patch submitted by Ian Tyrrell
Added Paths:
-----------
trunk/framework-test/as3/AllTests.as
trunk/framework-test/as3/AsUnitTestRunner.as
trunk/framework-test/as3/rakefile.rb
Removed Paths:
-------------
trunk/framework/as3/AsUnitTestRunner.as
trunk/framework-test/as3/asunit/framework/AllTests.as
Property Changed:
----------------
trunk/framework-test/as3/
Deleted: trunk/framework/as3/AsUnitTestRunner.as
===================================================================
--- trunk/framework/as3/AsUnitTestRunner.as 2008-02-25 10:39:47 UTC (rev 188)
+++ trunk/framework/as3/AsUnitTestRunner.as 2008-07-11 18:27:39 UTC (rev 189)
@@ -1,10 +0,0 @@
-package {
- import asunit.textui.TestRunner;
-
- public class AsUnitTestRunner extends TestRunner {
-
- public function AsUnitTestRunner() {
- start(AllTests, null, TestRunner.SHOW_TRACE);
- }
- }
-}
Property changes on: trunk/framework-test/as3
___________________________________________________________________
Name: svn:ignore
+ bin
Added: trunk/framework-test/as3/AllTests.as
===================================================================
--- trunk/framework-test/as3/AllTests.as (rev 0)
+++ trunk/framework-test/as3/AllTests.as 2008-07-11 18:27:39 UTC (rev 189)
@@ -0,0 +1,23 @@
+package {
+ import asunit.framework.TestSuite;
+ import asunit.framework.AssertTest;
+ import asunit.framework.AsyncMethodTest;
+ import asunit.framework.TestCaseTest;
+ import asunit.framework.TestFailureTest;
+ import asunit.framework.VisualTestCaseTest;
+ import asunit.textui.TestRunnerTest;
+ import asunit.util.ArrayIteratorTest;
+
+ public class AllTests extends TestSuite {
+
+ public function AllTests() {
+ addTest(new asunit.framework.AssertTest());
+ addTest(new asunit.framework.AsyncMethodTest());
+ addTest(new asunit.framework.TestCaseTest());
+ addTest(new asunit.framework.TestFailureTest());
+ addTest(new asunit.framework.VisualTestCaseTest());
+ addTest(new asunit.textui.TestRunnerTest());
+ addTest(new asunit.util.ArrayIteratorTest());
+ }
+ }
+}
Property changes on: trunk/framework-test/as3/AllTests.as
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/framework-test/as3/AsUnitTestRunner.as
===================================================================
--- trunk/framework-test/as3/AsUnitTestRunner.as (rev 0)
+++ trunk/framework-test/as3/AsUnitTestRunner.as 2008-07-11 18:27:39 UTC (rev 189)
@@ -0,0 +1,10 @@
+package {
+ import asunit.textui.TestRunner;
+
+ public class AsUnitTestRunner extends TestRunner {
+
+ public function AsUnitTestRunner() {
+ start(AllTests);
+ }
+ }
+}
Property changes on: trunk/framework-test/as3/AsUnitTestRunner.as
___________________________________________________________________
Name: svn:executable
+ *
Deleted: trunk/framework-test/as3/asunit/framework/AllTests.as
===================================================================
--- trunk/framework-test/as3/asunit/framework/AllTests.as 2008-02-25 10:39:47 UTC (rev 188)
+++ trunk/framework-test/as3/asunit/framework/AllTests.as 2008-07-11 18:27:39 UTC (rev 189)
@@ -1,19 +0,0 @@
-package asunit.framework {
- import asunit.framework.TestSuite;
- import asunit.framework.AssertTest;
- import asunit.framework.AsyncMethodTest;
- import asunit.framework.TestCaseTest;
- import asunit.framework.TestFailureTest;
- import asunit.framework.VisualTestCaseTest;
-
- public class AllTests extends TestSuite {
-
- public function AllTests() {
- addTest(new asunit.framework.AssertTest());
- addTest(new asunit.framework.AsyncMethodTest());
- addTest(new asunit.framework.TestCaseTest());
- addTest(new asunit.framework.TestFailureTest());
- addTest(new asunit.framework.VisualTestCaseTest());
- }
- }
-}
Added: trunk/framework-test/as3/rakefile.rb
===================================================================
--- trunk/framework-test/as3/rakefile.rb (rev 0)
+++ trunk/framework-test/as3/rakefile.rb 2008-07-11 18:27:39 UTC (rev 189)
@@ -0,0 +1,20 @@
+require 'sprout'
+sprout 'as3'
+
+##########################################
+# Compile the Test Harness
+
+mxmlc 'bin/AsUnit3Runner.swf' do |t|
+ t.default_size = '1000 600'
+ t.input = 'AsUnitTestRunner.as'
+ t.source_path << '../../framework/as3'
+end
+
+##########################################
+# Launch the Test Harness
+
+desc "Compile and run the test harness"
+flashplayer :run => 'bin/AsUnit3Runner.swf'
+
+task :default => :run
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|