flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mih...@apache.org
Subject [13/14] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34775 moved the unit test where it can be run by 'ant test'.
Date Tue, 10 Mar 2015 16:44:10 GMT
FLEX-34775 moved the unit test where it can be run by 'ant test'.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/f7fcf121
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/f7fcf121
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/f7fcf121

Branch: refs/heads/develop
Commit: f7fcf121fc2acebaca725bb5cd28aece8df45a49
Parents: 143a23c
Author: Mihai Chira <mihaic@apache.org>
Authored: Tue Mar 10 17:04:13 2015 +0100
Committer: Mihai Chira <mihaic@apache.org>
Committed: Tue Mar 10 17:04:13 2015 +0100

----------------------------------------------------------------------
 ...erarchicalCollectionView_FLEX_34775_Tests.as | 149 ++++++++++++++++++
 ...erarchicalCollectionView_FLEX_34775_Tests.as | 150 -------------------
 2 files changed, 149 insertions(+), 150 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f7fcf121/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
new file mode 100644
index 0000000..14bc2a3
--- /dev/null
+++ b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.collections
+{
+    import mx.utils.StringUtil;
+
+    import org.flexunit.asserts.assertEquals;
+
+    public class HierarchicalCollectionView_FLEX_34775_Tests
+    {
+        private static var _utils:HierarchicalCollectionViewTestUtils = new HierarchicalCollectionViewTestUtils();
+        private static var _sut:HierarchicalCollectionView;
+        private var _level0:ArrayCollection;
+
+        [Before]
+        public function setUp():void
+        {
+            _sut = generateHierarchyViewWithClosedNodes();
+            _level0 = _utils.getRoot(_sut) as ArrayCollection;
+        }
+
+        [After]
+        public function tearDown():void
+        {
+            _sut = null;
+            _level0 = null;
+        }
+
+
+
+        [Test]
+        public function test_navigation_after_trying_to_open_inaccessible_node():void
+        {
+            //given
+            var company:DataNode = _level0.getItemAt(0) as DataNode;
+            var location:DataNode = company.children.getItemAt(0) as DataNode;
+
+            //when
+            _sut.openNode(location);
+
+            //then
+            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
+            assertEquals(1, stepsRequiredToNavigateStructure);
+            assertEquals(1, _sut.length);
+        }
+
+        [Test]
+        public function test_navigation_after_trying_to_open_accessible_node():void
+        {
+            //given
+            var company:DataNode = _level0.getItemAt(0) as DataNode;
+            var location:DataNode = company.children.getItemAt(0) as DataNode;
+
+            //when
+            _sut.openNode(company);
+            _sut.openNode(location);
+
+            //then
+            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
+            assertEquals(3, stepsRequiredToNavigateStructure);
+            assertEquals(3, _sut.length);
+        }
+
+        [Test]
+        public function test_navigation_after_trying_to_open_previously_closed_node():void
+        {
+            //given
+            var company:DataNode = _level0.getItemAt(0) as DataNode;
+            var location:DataNode = company.children.getItemAt(0) as DataNode;
+
+            //when
+            _sut.openNode(company);
+            _sut.openNode(location);
+            _sut.closeNode(location);
+
+            //then
+            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
+            assertEquals(2, stepsRequiredToNavigateStructure);
+            assertEquals(2, _sut.length);
+        }
+
+        [Test]
+        public function test_navigation_after_trying_to_open_filtered_out_node():void
+        {
+            function filterOutLocationNode(node:DataNode):Boolean {
+                return node && node.label != locationNodeName;
+            };
+
+            const locationNodeName:String = StringUtil.trim(HIERARCHY_STRING.split("\n")[2]);
+
+            //given
+            var company:DataNode = _level0.getItemAt(0) as DataNode;
+            var location:DataNode = company.children.getItemAt(0) as DataNode;
+            _sut.openNode(company);
+            _sut.openNode(location);
+
+            //when
+            _sut.filterFunction = filterOutLocationNode;
+            _sut.refresh();
+
+            _sut.openNode(location);
+
+            //then
+            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
+            assertEquals(1, stepsRequiredToNavigateStructure);
+            assertEquals(1, _sut.length);
+        }
+
+        private function attemptNavigation(into:HierarchicalCollectionView):int
+        {
+            var cursor:IViewCursor = into.createCursor();
+            var i:int = 0;
+            while(!cursor.afterLast && i++ < 100)
+            {
+                cursor.moveNext();
+            }
+
+            return i;
+        }
+
+        private static function generateHierarchyViewWithClosedNodes():HierarchicalCollectionView
+        {
+            return _utils.generateHCV(_utils.generateHierarchySourceFromString(HIERARCHY_STRING));
+        }
+
+        private static const HIERARCHY_STRING:String = (<![CDATA[
+        Adobe
+        Adobe->London
+        Adobe->London->FlexDept
+    ]]>).toString();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f7fcf121/frameworks/tests/unitTests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/tests/unitTests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
b/frameworks/tests/unitTests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
deleted file mode 100644
index 2b07605..0000000
--- a/frameworks/tests/unitTests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
+++ /dev/null
@@ -1,150 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-
-package mx.collections
-{
-    import mx.collections.*;
-    import mx.utils.StringUtil;
-
-    import org.flexunit.asserts.assertEquals;
-
-    public class HierarchicalCollectionView_FLEX_34775_Test
-    {
-        private static var _utils:HierarchicalCollectionViewTestUtils = new HierarchicalCollectionViewTestUtils();
-        private static var _sut:HierarchicalCollectionView;
-        private var _level0:ArrayCollection;
-
-        [Before]
-        public function setUp():void
-        {
-            _sut = generateHierarchyViewWithClosedNodes();
-            _level0 = _utils.getRoot(_sut) as ArrayCollection;
-        }
-
-        [After]
-        public function tearDown():void
-        {
-            _sut = null;
-            _level0 = null;
-        }
-
-
-
-        [Test]
-        public function test_navigation_after_trying_to_open_inaccessible_node():void
-        {
-            //given
-            var company:DataNode = _level0.getItemAt(0) as DataNode;
-            var location:DataNode = company.children.getItemAt(0) as DataNode;
-
-            //when
-            _sut.openNode(location);
-
-            //then
-            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
-            assertEquals(1, stepsRequiredToNavigateStructure);
-            assertEquals(1, _sut.length);
-        }
-
-        [Test]
-        public function test_navigation_after_trying_to_open_accessible_node():void
-        {
-            //given
-            var company:DataNode = _level0.getItemAt(0) as DataNode;
-            var location:DataNode = company.children.getItemAt(0) as DataNode;
-
-            //when
-            _sut.openNode(company);
-            _sut.openNode(location);
-
-            //then
-            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
-            assertEquals(3, stepsRequiredToNavigateStructure);
-            assertEquals(3, _sut.length);
-        }
-
-        [Test]
-        public function test_navigation_after_trying_to_open_previously_closed_node():void
-        {
-            //given
-            var company:DataNode = _level0.getItemAt(0) as DataNode;
-            var location:DataNode = company.children.getItemAt(0) as DataNode;
-
-            //when
-            _sut.openNode(company);
-            _sut.openNode(location);
-            _sut.closeNode(location);
-
-            //then
-            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
-            assertEquals(2, stepsRequiredToNavigateStructure);
-            assertEquals(2, _sut.length);
-        }
-
-        [Test]
-        public function test_navigation_after_trying_to_open_filtered_out_node():void
-        {
-            function filterOutLocationNode(node:DataNode):Boolean {
-                return node && node.label != locationNodeName;
-            };
-
-            const locationNodeName:String = StringUtil.trim(HIERARCHY_STRING.split("\n")[2]);
-
-            //given
-            var company:DataNode = _level0.getItemAt(0) as DataNode;
-            var location:DataNode = company.children.getItemAt(0) as DataNode;
-            _sut.openNode(company);
-            _sut.openNode(location);
-
-            //when
-            _sut.filterFunction = filterOutLocationNode;
-            _sut.refresh();
-
-            _sut.openNode(location);
-
-            //then
-            var stepsRequiredToNavigateStructure:int = attemptNavigation(_sut);
-            assertEquals(1, stepsRequiredToNavigateStructure);
-            assertEquals(1, _sut.length);
-        }
-
-        private function attemptNavigation(into:HierarchicalCollectionView):int
-        {
-            var cursor:IViewCursor = into.createCursor();
-            var i:int = 0;
-            while(!cursor.afterLast && i++ < 100)
-            {
-                cursor.moveNext();
-            }
-
-            return i;
-        }
-
-        private static function generateHierarchyViewWithClosedNodes():HierarchicalCollectionView
-        {
-            return _utils.generateHCV(_utils.generateHierarchySourceFromString(HIERARCHY_STRING));
-        }
-
-        private static const HIERARCHY_STRING:String = (<![CDATA[
-                Adobe
-        Adobe->London
-        Adobe->London->FlexDept
-    ]]>).toString();
-    }
-}
\ No newline at end of file


Mime
View raw message