Repository: flex-tlf Updated Branches: refs/heads/develop a61535e60 -> 1bfedb755
Remove unused variables from OperationTest.as Add configuration loader to ScrollingTest.as Fix ignored test "twoColumnsTest" Project: http://git-wip-us.apache.org/repos/asf/flex-tlf/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-tlf/commit/1bfedb75 Tree: http://git-wip-us.apache.org/repos/asf/flex-tlf/tree/1bfedb75 Diff: http://git-wip-us.apache.org/repos/asf/flex-tlf/diff/1bfedb75 Branch: refs/heads/develop Commit: 1bfedb75560a3cd9ed8993bf58d8c2c3917465f3 Parents: a61535e Author: piotrz <piotrzarzyck...@gmail.com> Authored: Sat Mar 21 20:41:13 2015 +0100 Committer: piotrz <piotrzarzyck...@gmail.com> Committed: Sat Mar 21 20:41:13 2015 +0100 ---------------------------------------------------------------------- .../src/UnitTest/Tests/OperationTest.as | 21 ++--- .../src/UnitTest/Tests/ScrollingTest.as | 98 ++++++++++++++++---- test/testCases/ScrollingTest.xml | 22 ++--- 3 files changed, 100 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1bfedb75/automation_tests/src/UnitTest/Tests/OperationTest.as ---------------------------------------------------------------------- diff --git a/automation_tests/src/UnitTest/Tests/OperationTest.as b/automation_tests/src/UnitTest/Tests/OperationTest.as index c0a5fa6..d706665 100644 --- a/automation_tests/src/UnitTest/Tests/OperationTest.as +++ b/automation_tests/src/UnitTest/Tests/OperationTest.as @@ -352,7 +352,7 @@ package UnitTest.Tests public function deleteNextPageTest():void { var onePageRange:TextRange = new TextRange(SelManager.textFlow, 1, 5000); - var aa:Boolean = NavigationUtil.nextPage(onePageRange); + NavigationUtil.nextPage(onePageRange); deletePreviousWordFromRange(5000, 10000); } @@ -360,7 +360,7 @@ package UnitTest.Tests public function deletePreviousPageTest():void { var onePageRange:TextRange = new TextRange(SelManager.textFlow, 5000, 10000); - var aa:Boolean = NavigationUtil.nextPage(onePageRange); + NavigationUtil.nextPage(onePageRange); deletePreviousWordFromRange(1, 5000); } @@ -748,8 +748,6 @@ package UnitTest.Tests callback = true; const cutStart:int = 10; const cutEnd:int = 20; - var pasteLength:int = cutEnd - cutStart; - // Paste into a point selection SelManager.selectRange(cutStart, cutEnd); var scrap:TextScrap = SelManager.cutTextScrap(); @@ -799,7 +797,6 @@ package UnitTest.Tests SelManager.textFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_END, deleteNextCharExceptionTest, false, 0, true); - var flowLength:int = SelManager.textFlow.textLength; SelManager.selectRange(pastePosition, pastePosition); (SelManager as IEditManager).pasteTextScrap(scrap); } @@ -1096,7 +1093,6 @@ package UnitTest.Tests [Ignore] public function applyFormatToElementTest():void { - var textFlow:TextFlow = SelManager.textFlow; var format1:TextLayoutFormat = new TextLayoutFormat(); format1.color = 0xff; format1.fontSize = 30; @@ -1949,7 +1945,7 @@ package UnitTest.Tests p1.format = f1; p1.addChild(s1); var p2:ParagraphElement = new ParagraphElement(); - var s2:SpanElement = new SpanElement() + var s2:SpanElement = new SpanElement(); s2.text = "two"; p2.addChild(s2); TestFrame.textFlow.replaceChildren(0, 1, p1); @@ -2051,7 +2047,6 @@ package UnitTest.Tests var child:FlowElement; var child2:FlowElement; var combinationArray:Array; - var subrootId:int = 1; var parentId:int = 2; var targetId:int = 3; var childId:int = 4; @@ -2182,13 +2177,13 @@ package UnitTest.Tests { (child as SpanElement).text = "text"; } - return new Array(textFlow, subroot, parent, target, child); + return [textFlow, subroot, parent, target, child]; } private function checkOperation(combinationArray:Array):void { var textFlow:TextFlow = combinationArray[0]; - var subroot:FlowGroupElement = combinationArray[1] + var subroot:FlowGroupElement = combinationArray[1]; var parent:FlowGroupElement = combinationArray[2]; var target:FlowGroupElement = combinationArray[3]; var child:FlowElement = combinationArray[4]; @@ -2234,7 +2229,7 @@ package UnitTest.Tests assertTrue(combinedNames + ": fail to undo", subroot.getChildAt(0).id == "2" && subroot.getChildAt(1).id == "3" - && (subroot.getChildAt(0) as FlowGroupElement).getChildAt(0).id == "4") + && (subroot.getChildAt(0) as FlowGroupElement).getChildAt(0).id == "4"); //redo editMan.redo(); textFlow.flowComposer.updateAllControllers(); @@ -2290,7 +2285,7 @@ package UnitTest.Tests assertTrue(combinedNames + ": fail to undo", subroot.getChildAt(0).id == "2" && subroot.getChildAt(2).id == "3" - && (subroot.getChildAt(0) as FlowGroupElement).getChildAt(0).id == "4") + && (subroot.getChildAt(0) as FlowGroupElement).getChildAt(0).id == "4"); //redo editMan.redo(); textFlow.flowComposer.updateAllControllers(); @@ -2366,7 +2361,6 @@ package UnitTest.Tests [Test] public function MoveChildrenOperationTest():void { - var tf:TextFlow = SelManager.textFlow; SelManager.selectAll(); SelManager.deleteText(); @@ -2417,7 +2411,6 @@ package UnitTest.Tests [Test] public function ApplyFormatOperationTest():void { - var tf:TextFlow = SelManager.textFlow; SelManager.selectAll(); SelManager.deleteText(); http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1bfedb75/automation_tests/src/UnitTest/Tests/ScrollingTest.as ---------------------------------------------------------------------- diff --git a/automation_tests/src/UnitTest/Tests/ScrollingTest.as b/automation_tests/src/UnitTest/Tests/ScrollingTest.as index 8fdae0d..6ca0e41 100644 --- a/automation_tests/src/UnitTest/Tests/ScrollingTest.as +++ b/automation_tests/src/UnitTest/Tests/ScrollingTest.as @@ -27,8 +27,10 @@ package UnitTest.Tests { + import UnitTest.ExtendedClasses.TestConfigurationLoader; import UnitTest.ExtendedClasses.TestSuiteExtended; import UnitTest.ExtendedClasses.VellumTestCase; + import UnitTest.Fixtures.TestCaseVo; import UnitTest.Fixtures.TestConfig; import flash.display.Shape; @@ -54,8 +56,51 @@ package UnitTest.Tests /** Test the state of selection after each operation is done, undone, and redone. */ [TestCase(order=14)] + [RunWith("org.flexunit.runners.Parameterized")] public class ScrollingTest extends VellumTestCase { + [DataPoints(loader=scrollWithInsideListLoader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var scrollWithInsideListDp:Array; + + public static var scrollWithInsideListLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "scrollWithInsideList"); + + [DataPoints(loader=twoColumnsTestLoader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var twoColumnsTestDp:Array; + + public static var twoColumnsTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "twoColumnsTest"); + + [DataPoints(loader=bug2988852Loader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var bug2988852Dp:Array; + + public static var bug2988852Loader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "bug2988852"); + + [DataPoints(loader=bug2819924Case3TestLoader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var bug2819924Case3TestDp:Array; + + public static var bug2819924Case3TestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "bug2819924Case3Test"); + + [DataPoints(loader=bug2819924Case2TestLoader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var bug2819924Case2TestDp:Array; + + public static var bug2819924Case2TestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "bug2819924Case2Test"); + + [DataPoints(loader=bug2819924Case1TestLoader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var bug2819924Case1TestDp:Array; + + public static var bug2819924Case1TestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "bug2819924Case1Test"); + + [DataPoints(loader=largeLastLineLoader)] + [ArrayElementType("UnitTest.Fixtures.TestCaseVo")] + public static var largeLastLineDp:Array; + + public static var largeLastLineLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/ScrollingTest.xml", "largeLastLine"); + public function ScrollingTest() { // super(methodName, testID, testConfig, testCaseXML); @@ -84,6 +129,7 @@ package UnitTest.Tests [Before] override public function setUpTest():void { + TestData.fileName = "aliceExcerpt.xml"; super.setUpTest(); } @@ -440,9 +486,12 @@ package UnitTest.Tests // check rendering - there should be decorations } - [Test] - public function scrollWithInsideList():void + [Test(dataProvider=scrollWithInsideListDp)] + public function scrollWithInsideList(testCaseVo:TestCaseVo):void { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + var textFlow:TextFlow = SelManager.textFlow; textFlow.flowComposer.updateAllControllers(); // now page forward and then back @@ -460,9 +509,12 @@ package UnitTest.Tests return sprite; } - [Test] - public function largeLastLine():void // 2739996 + [Test(dataProvider=largeLastLineDp)] + public function largeLastLine(testCaseVo:TestCaseVo):void // 2739996 { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + var textFlow:TextFlow = SelManager.textFlow; SelManager.selectRange(textFlow.textLength - 1, textFlow.textLength - 1); SelManager.insertInlineGraphic(createFilledSprite(200, 200, 0xff0000), 200, 200, Float.NONE); @@ -479,9 +531,12 @@ package UnitTest.Tests /** * mjzhang : Watson#2819924 Error #1009 in flashx.textLayout.container::ContainerController::updateGraphics() */ - [Test] - public function Bug2819924_case1():void + [Test(dataProvider=bug2819924Case1TestDp)] + public function bug2819924Case1Test(testCaseVo:TestCaseVo):void { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + var textFlow:TextFlow = SelManager.textFlow; var controller:ContainerController = textFlow.flowComposer.getControllerAt(0); @@ -508,18 +563,24 @@ package UnitTest.Tests /** * mjzhang : Watson#2819924 Error #1009 in flashx.textLayout.container::ContainerController::updateGraphics() */ - [Test] - public function Bug2819924_case2():void + [Test(dataProvider=bug2819924Case2TestDp)] + public function bug2819924Case2Test(testCaseVo:TestCaseVo):void { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + SelManager.insertInlineGraphic(singleCT, 600, 400, Float.NONE); } /** * mjzhang : Watson#2819924 Error #1009 in flashx.textLayout.container::ContainerController::updateGraphics() Â */ - [Test] - public function Bug2819924_case3():void + [Test(dataProvider=bug2819924Case3TestDp)] + public function bug2819924Case3Test(testCaseVo:TestCaseVo):void { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + var textFlow:TextFlow = SelManager.textFlow; var controller:ContainerController = textFlow.flowComposer.getControllerAt(0); @@ -527,7 +588,7 @@ package UnitTest.Tests var i:int = 30; while (i > 0) { - str += i + "\n" + str += i + "\n"; i--; } @@ -555,9 +616,12 @@ package UnitTest.Tests textFlow.flowComposer.updateAllControllers(); } - [Test] - public function bug2988852():void + [Test(dataProvider=bug2988852Dp)] + public function bug2988852(testCaseVo:TestCaseVo):void { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + var tf:TextFlow = SelManager.textFlow; for (var i:int = 0; i < 15; i++) { @@ -589,10 +653,12 @@ package UnitTest.Tests } } - [Test] - [Ignore] - public function twoColumnsTest():void + [Test(dataProvider=twoColumnsTestDp)] + public function twoColumnsTest(testCaseVo:TestCaseVo):void { + TestData.fileName = testCaseVo.fileName; + super.setUpTest(); + var tf:TextFlow = SelManager.textFlow; for (var i:int = 0; i < 60; i++) { http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1bfedb75/test/testCases/ScrollingTest.xml ---------------------------------------------------------------------- diff --git a/test/testCases/ScrollingTest.xml b/test/testCases/ScrollingTest.xml index 14c5a25..7c6ada5 100644 --- a/test/testCases/ScrollingTest.xml +++ b/test/testCases/ScrollingTest.xml @@ -32,7 +32,7 @@ <TestCase functionName="previousPageTest"/> <TestCase functionName="scrollUpDownLimitTest"/> <TestCase functionName="scrollToSelectionAfterParagraphInsertion"> - <TestData name="testFile">simple.xml</TestData> + <TestData name="fileName">simple.xml</TestData> <TestData name="tb_rtl">false</TestData> </TestCase> <!-- Disabled, doesn't work on Astro/Squirt --> @@ -40,42 +40,42 @@ <TestData name="bitmapSnapshot">true</TestData> </TestCase> <TestCase functionName="scrollWithInsideList"> - <TestData name="testFile">insideListScroll.xml</TestData> + <TestData name="fileName">insideListScroll.xml</TestData> <TestData name="bitmapSnapshot">true</TestData> <TestData name="tb_rtl">false</TestData> <TestData name="rl_ltr">false</TestData> </TestCase> <TestCase functionName="largeLastLine"> - <TestData name="testFile">simple.xml</TestData> + <TestData name="fileName">simple.xml</TestData> <TestData name="bitmapSnapshot">false</TestData> <TestData name="tb_rtl">false</TestData> <TestData name="rl_ltr">true</TestData> </TestCase> -<TestCase functionName="Bug2819924_case1"> - <TestData name="testFile">simple.xml</TestData> +<TestCase functionName="bug2819924Case1Test"> + <TestData name="fileName">simple.xml</TestData> <TestData name="bitmapSnapshot">false</TestData> <TestData name="tb_rtl">false</TestData> <TestData name="rl_ltr">false</TestData> </TestCase> -<TestCase functionName="Bug2819924_case2"> - <TestData name="testFile">simple.xml</TestData> +<TestCase functionName="bug2819924Case2Test"> + <TestData name="fileName">simple.xml</TestData> <TestData name="bitmapSnapshot">false</TestData> <TestData name="tb_rtl">false</TestData> <TestData name="rl_ltr">false</TestData> </TestCase> -<TestCase functionName="Bug2819924_case3"> - <TestData name="testFile">simple.xml</TestData> +<TestCase functionName="bug2819924Case3Test"> + <TestData name="fileName">simple.xml</TestData> <TestData name="bitmapSnapshot">false</TestData> <TestData name="tb_rtl">false</TestData> <TestData name="rl_ltr">false</TestData> </TestCase> <TestCase functionName="bug2988852"> - <TestData name="testFile">simple.xml</TestData> + <TestData name="fileName">simple.xml</TestData> <TestData name="tb_rtl">true</TestData> <TestData name="rl_ltr">true</TestData> </TestCase> <TestCase functionName="twoColumnsTest"> - <TestData name="testFile">simple.xml</TestData> + <TestData name="fileName">simple.xml</TestData> <TestData name="tb_rtl">true</TestData> <TestData name="rl_ltr">true</TestData> </TestCase>