FLEX-34119 our test runner seems to be an Application, rather than WindowedApplication. Now the unit test reflects that.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/dabf7cc6 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/dabf7cc6 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/dabf7cc6 Branch: refs/heads/develop Commit: dabf7cc6f4a5d0d8a416857c9e2b2c1f61632e22 Parents: c325d39 Author: Mihai Chira <mih...@apache.org> Authored: Tue Mar 10 13:43:37 2015 +0100 Committer: Erik de Bruin <e...@ixsoftware.nl> Committed: Fri Mar 20 09:51:23 2015 +0100 ---------------------------------------------------------------------- ...archicalCollectionViewCursor_Basics_Tests.as | 115 +++++++++---------- 1 file changed, 55 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/dabf7cc6/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_Basics_Tests.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_Basics_Tests.as b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_Basics_Tests.as index c2bd0cb..93cd2d9 100644 --- a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_Basics_Tests.as +++ b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_Basics_Tests.as @@ -20,60 +20,55 @@ package mx.collections { import flash.events.UncaughtErrorEvent; + import flash.utils.describeType; -import flashx.textLayout.debug.assert; - -import mx.collections.ArrayCollection; - import mx.collections.CursorBookmark; - import mx.collections.HierarchicalCollectionView; - import mx.collections.HierarchicalCollectionViewCursor; import mx.core.FlexGlobals; - - import spark.components.WindowedApplication; - + import org.flexunit.asserts.assertEquals; + import org.flexunit.asserts.assertNotNull; - public class HierarchicalCollectionViewCursor_Basics_Test + import spark.components.Application; + + public class HierarchicalCollectionViewCursor_Basics_Tests { - private static var _utils:HierarchicalCollectionViewTestUtils = new HierarchicalCollectionViewTestUtils(); - private static var _currentHierarchy:HierarchicalCollectionView; - private static var _noErrorsThrown:Boolean = true; - private var _level0:ArrayCollection; - - private var _sut:HierarchicalCollectionViewCursor; - - [BeforeClass] - public static function setUpBeforeClass():void - { - if(FlexGlobals.topLevelApplication is WindowedApplication) - (FlexGlobals.topLevelApplication as WindowedApplication).loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtClientError); - } - - [AfterClass] - public static function tearDownAfterClass():void - { - if(FlexGlobals.topLevelApplication is WindowedApplication) - (FlexGlobals.topLevelApplication as WindowedApplication).loaderInfo.uncaughtErrorEvents.removeEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtClientError); - } - - [Before] - public function setUp():void - { + private static var _utils:HierarchicalCollectionViewTestUtils = new HierarchicalCollectionViewTestUtils(); + private static var _currentHierarchy:HierarchicalCollectionView; + private static var _noErrorsThrown:Boolean = true; + private var _level0:ArrayCollection; + + private var _sut:HierarchicalCollectionViewCursor; + + [BeforeClass] + public static function setUpBeforeClass():void + { + if(FlexGlobals.topLevelApplication is Application) + (FlexGlobals.topLevelApplication as Application).loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtClientError); + } + + [AfterClass] + public static function tearDownAfterClass():void + { + if(FlexGlobals.topLevelApplication is Application) + (FlexGlobals.topLevelApplication as Application).loaderInfo.uncaughtErrorEvents.removeEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtClientError); + } + + [Before] + public function setUp():void + { _currentHierarchy = generateHierarchyViewWithOpenNodes(); _level0 = _utils.getRoot(_currentHierarchy) as ArrayCollection; _sut = _currentHierarchy.createCursor() as HierarchicalCollectionViewCursor; - _noErrorsThrown = true; - } - - [After] - public function tearDown():void - { - _sut = null; + _noErrorsThrown = true; + } + + [After] + public function tearDown():void + { + _sut = null; _currentHierarchy = null; _level0 = null; - } - + } [Test] @@ -223,23 +218,23 @@ import mx.collections.ArrayCollection; //then assertEquals(firstLocation, _sut.current); } - - - private static function handleUncaughtClientError(event:UncaughtErrorEvent):void - { - event.preventDefault(); - event.stopImmediatePropagation(); - _noErrorsThrown = false; - - trace("\n" + event.error); - _utils.printHCollectionView(_currentHierarchy); - } - - - private static function generateHierarchyViewWithOpenNodes():HierarchicalCollectionView - { - return _utils.generateOpenHierarchyFromRootList(_utils.generateHierarchySourceFromString(HIERARCHY_STRING)); - } + + + private static function handleUncaughtClientError(event:UncaughtErrorEvent):void + { + event.preventDefault(); + event.stopImmediatePropagation(); + _noErrorsThrown = false; + + trace("\n" + event.error); + _utils.printHCollectionView(_currentHierarchy); + } + + + private static function generateHierarchyViewWithOpenNodes():HierarchicalCollectionView + { + return _utils.generateOpenHierarchyFromRootList(_utils.generateHierarchySourceFromString(HIERARCHY_STRING)); + } private static const HIERARCHY_STRING:String = (<![CDATA[ Company(1)