You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2015/03/22 18:26:43 UTC
git commit: [flex-tlf] [refs/heads/develop] - Add configuration
loader for TabTest
Repository: flex-tlf
Updated Branches:
refs/heads/develop 820ab432e -> 4538bdac4
Add configuration loader for TabTest
Project: http://git-wip-us.apache.org/repos/asf/flex-tlf/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-tlf/commit/4538bdac
Tree: http://git-wip-us.apache.org/repos/asf/flex-tlf/tree/4538bdac
Diff: http://git-wip-us.apache.org/repos/asf/flex-tlf/diff/4538bdac
Branch: refs/heads/develop
Commit: 4538bdac47155b379486438a7661382a69898843
Parents: 820ab43
Author: piotrz <pi...@gmail.com>
Authored: Sun Mar 22 18:26:31 2015 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Sun Mar 22 18:26:31 2015 +0100
----------------------------------------------------------------------
automation_tests/src/UnitTest/Tests/TabTest.as | 37 ++++++++++++++++-----
test/testCases/TabTest.xml | 2 +-
2 files changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/4538bdac/automation_tests/src/UnitTest/Tests/TabTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/TabTest.as b/automation_tests/src/UnitTest/Tests/TabTest.as
index 938c88b..797fe18 100644
--- a/automation_tests/src/UnitTest/Tests/TabTest.as
+++ b/automation_tests/src/UnitTest/Tests/TabTest.as
@@ -18,7 +18,9 @@
////////////////////////////////////////////////////////////////////////////////
package UnitTest.Tests
{
+ import UnitTest.ExtendedClasses.TestConfigurationLoader;
import UnitTest.ExtendedClasses.VellumTestCase;
+ import UnitTest.Fixtures.TestCaseVo;
import UnitTest.Fixtures.TestConfig;
import flash.geom.Rectangle;
@@ -32,8 +34,21 @@ package UnitTest.Tests
import org.flexunit.asserts.assertTrue;
[TestCase(order=24)]
+ [RunWith("org.flexunit.runners.Parameterized")]
public class TabTest extends VellumTestCase
{
+ [DataPoints(loader=endTabLongStringTestLoader)]
+ [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+ public static var endTabLongStringTestDp:Array;
+
+ public static var endTabLongStringTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/TabTest.xml", "endTabLongStringTest");
+
+ [DataPoints(loader=tabStopFormatTestLoader)]
+ [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+ public static var tabStopFormatTestDp:Array;
+
+ public static var tabStopFormatTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/TabTest.xml", "tabStopFormatTest");
+
public function TabTest()
{
super("", "TabTest", TestConfig.getInstance());
@@ -74,15 +89,13 @@ package UnitTest.Tests
TestFrame.flowComposer.updateAllControllers();
// get the first line
- var initialLine:TextLine;
- initialLine = SelManager.textFlow.flowComposer.getLineAt(0).getTextLine(true);
+ var initialLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(0).getTextLine(true);
//default single tab value
var tabValue:Number = 50;
//get the position of the second character, "N"
- var valueAfterTab:Number;
- valueAfterTab = initialLine.getAtomBounds(1).left;
+ var valueAfterTab:Number = initialLine.getAtomBounds(1).left;
//Check the the correct value is in the tab
assertTrue("tab should be " + tabValue + " but is " + valueAfterTab, valueAfterTab == tabValue);
@@ -526,12 +539,15 @@ package UnitTest.Tests
}
***/
- [Ignore][Test]
+ [Test(dataProvider=endTabLongStringTestDp)]
/**
* automate a end TAB bug test. When End Tab has a long string value, it didn't display correctly. It is a Player bug.
*/
- public function endTabLongStringTest():void
+ public function endTabLongStringTest(testCaseVo:TestCaseVo):void
{
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
SelManager.selectAll();
SelManager.deleteText();
SelManager.insertText("\tAAAAAAA\tBBBBBB");
@@ -553,9 +569,12 @@ package UnitTest.Tests
assertTrue("end TAB was not displayed when end Tab with long string value.", W != 0);
}
- [Test]
- public function TabStopFormatTest():void
+ [Test(dataProvider=tabStopFormatTestDp)]
+ public function tabStopFormatTest(testCaseVo:TestCaseVo):void
{
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
SelManager.selectAll();
SelManager.deleteText();
SelManager.insertText("1\txxx\txxx\txxx\n2\tyyyyyy\tyyyyyy\tyyyyyy\n3\tzz\tzz\tzz");
@@ -575,7 +594,7 @@ package UnitTest.Tests
tabStop2.position = 150;
tabStop3.alignment = TabAlignment.END;
tabStop3.position = 250;
- format.tabStops = new Array(tabStop1, tabStop2, tabStop3);
+ format.tabStops = [tabStop1, tabStop2, tabStop3];
SelManager.textFlow.hostFormat = format;
SelManager.textFlow.flowComposer.updateAllControllers();
}
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/4538bdac/test/testCases/TabTest.xml
----------------------------------------------------------------------
diff --git a/test/testCases/TabTest.xml b/test/testCases/TabTest.xml
index 46762dc..9491a4d 100644
--- a/test/testCases/TabTest.xml
+++ b/test/testCases/TabTest.xml
@@ -36,7 +36,7 @@
<TestData name="tb_rtl">false</TestData>
<TestData name="rl_ltr">false</TestData>
</TestCase>
-<TestCase functionName="TabStopFormatTest">
+<TestCase functionName="tabStopFormatTest">
<TestData name="fileName">empty.xml</TestData>
<TestData name="tb_rtl">false</TestData>
<TestData name="rl_ltr">false</TestData>