flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject git commit: [flex-tlf] [refs/heads/develop] - Migrate ImpliedParagraphTest to FU 4 Change TestId for HorizontalScrollingTest
Date Sun, 22 Mar 2015 18:36:10 GMT
Repository: flex-tlf
Updated Branches:
  refs/heads/develop 3f6abddfb -> 2f36aee85


Migrate ImpliedParagraphTest to FU 4
Change TestId for HorizontalScrollingTest


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

Branch: refs/heads/develop
Commit: 2f36aee85e2c9b76275825258fa8af51e30aa719
Parents: 3f6abdd
Author: piotrz <piotrzarzycki21@gmail.com>
Authored: Sun Mar 22 19:36:04 2015 +0100
Committer: piotrz <piotrzarzycki21@gmail.com>
Committed: Sun Mar 22 19:36:04 2015 +0100

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |   2 +
 .../UnitTest/Tests/HorizontalScrollingTest.as   |   2 +-
 .../src/UnitTest/Tests/ImpliedParagraphTest.as  | 186 +++++++++++--------
 3 files changed, 115 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/2f36aee8/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index 0b186d5..9690325 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -38,6 +38,7 @@ package
     import UnitTest.Tests.FlowModelTest;
     import UnitTest.Tests.GeneralFunctionsTest;
     import UnitTest.Tests.HorizontalScrollingTest;
+    import UnitTest.Tests.ImpliedParagraphTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
     import UnitTest.Tests.TabTest;
@@ -74,6 +75,7 @@ package
         public var textFlowEditTest:TextFlowEditTest;
         public var tabTest:TabTest;
         public var horizontalScrollingTest:HorizontalScrollingTest;
+        public var impliedParagraphTest:ImpliedParagraphTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/2f36aee8/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as b/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
index 9d94d66..c07096a 100644
--- a/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
+++ b/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
@@ -106,7 +106,7 @@ package UnitTest.Tests
 
         public function HorizontalScrollingTest()
         {
-            super("", "TabTest", TestConfig.getInstance());
+            super("", "HorizontalScrollingTest", TestConfig.getInstance());
 
             metaData = {};
             // Note: These must correspond to a Watson product area (case-sensitive)

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/2f36aee8/automation_tests/src/UnitTest/Tests/ImpliedParagraphTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ImpliedParagraphTest.as b/automation_tests/src/UnitTest/Tests/ImpliedParagraphTest.as
index 4d0c3fe..645c1c1 100644
--- a/automation_tests/src/UnitTest/Tests/ImpliedParagraphTest.as
+++ b/automation_tests/src/UnitTest/Tests/ImpliedParagraphTest.as
@@ -18,83 +18,121 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flashx.textLayout.conversion.ConversionType;
-	import flashx.textLayout.conversion.ITextExporter;
-	import flashx.textLayout.conversion.ITextImporter;
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.elements.TextFlow;
+    import UnitTest.ExtendedClasses.TestConfigurationLoader;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestCaseVo;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flashx.textLayout.conversion.ConversionType;
+    import flashx.textLayout.conversion.ITextExporter;
+    import flashx.textLayout.conversion.ITextImporter;
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.elements.TextFlow;
 
     import org.flexunit.asserts.assertTrue;
 
+    [TestCase(order=26)]
+    [RunWith("org.flexunit.runners.Parameterized")]
     public class ImpliedParagraphTest extends VellumTestCase
-	{
-		public function ImpliedParagraphTest(methodName:String, testID:String, testConfig:TestConfig,
testCaseXML:XML=null)
-		{
-			super(methodName, testID, testConfig, testCaseXML);
-		}
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = ImpliedParagraphTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-		private const inputString1:String = '<i>Italic</i> Plain <i>Italic</i>
Plain <b>Bold</b>';
-		private const inputString2:String = '<b>Bold</b> <i>Italic</i>
Plain <i>Italic</i> Plain <b>Bold</b>';
-		private const inputString3:String = '<i><b>BoldItalic</b></i> Plain
<i>Italic</i> Plain <b>Bold</b>';
-		private const inputString4:String = '<textformat leading="200%"><i><b>BoldItalic</b></i>
</textformat>Plain <i>Italic</i> Plain <b>Bold</b>';
-		private const inputString5:String = '<p>asdf</p><b>bold</b><i>italic</i><p>qwerty</p>';
-		private const inputString6:String = 'Plain <b>Bold</b> <i>Italic</i>
Plain <i>Italic</i> Plain <b>Bold</b>';
-		private const outputString1:String = '<p><span fontStyle="italic">Italic</span><span>
Plain </span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontWeight="bold">Bold</span></p>';
-		private const outputString2:String = '<p><span fontWeight="bold">Bold</span><span>
</span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontStyle="italic">Italic</span><span> Plain </span><span fontWeight="bold">Bold</span></p>';
-		private const outputString3:String = '<p><span fontStyle="italic" fontWeight="bold">BoldItalic</span><span>
Plain </span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontWeight="bold">Bold</span></p>';
-		private const outputString4:String = '<p leadingModel="approximateTextField" lineHeight="200%"><span
fontStyle="italic" fontWeight="bold">BoldItalic</span><span> Plain </span><span
fontStyle="italic">Italic</span><span> Plain </span><span fontWeight="bold">Bold</span></p>';
-		private const outputString5:String = '<p><span>asdf</span></p><p><span
fontWeight="bold">bold</span><span fontStyle="italic">italic</span></p><p><span>qwerty</span></p>';
-		private const outputString6:String = '<p><span>Plain </span><span
fontWeight="bold">Bold</span><span> </span><span fontStyle="italic">Italic</span><span>
Plain </span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontWeight="bold">Bold</span></p>';
-		private var textImporter:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT);
-		private var textExporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT);
-		
-		public function runTheTest(inString:String, outString:String):void
-		{
-			var textFlow:TextFlow = textImporter.importToFlow(inString);
-			var markupResult:String = textExporter.export(textFlow, ConversionType.STRING_TYPE) as
String;
-			var startIndex:int = markupResult.search("<p");
-			var endIndex:int = markupResult.search("</TextFlow>");
-			var expectedString:String = markupResult.substring(startIndex, endIndex);
-			assertTrue("TLF model did not match expected result",  expectedString == outString);
-		}
-		
-		public function impliedParagraphHTMLImportTest1():void
+    {
+        private const inputString1:String = '<i>Italic</i> Plain <i>Italic</i>
Plain <b>Bold</b>';
+        private const inputString2:String = '<b>Bold</b> <i>Italic</i>
Plain <i>Italic</i> Plain <b>Bold</b>';
+        private const inputString3:String = '<i><b>BoldItalic</b></i>
Plain <i>Italic</i> Plain <b>Bold</b>';
+        private const inputString4:String = '<textformat leading="200%"><i><b>BoldItalic</b></i>
</textformat>Plain <i>Italic</i> Plain <b>Bold</b>';
+        private const inputString5:String = '<p>asdf</p><b>bold</b><i>italic</i><p>qwerty</p>';
+        private const inputString6:String = 'Plain <b>Bold</b> <i>Italic</i>
Plain <i>Italic</i> Plain <b>Bold</b>';
+        private const outputString1:String = '<p><span fontStyle="italic">Italic</span><span>
Plain </span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontWeight="bold">Bold</span></p>';
+        private const outputString2:String = '<p><span fontWeight="bold">Bold</span><span>
</span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontStyle="italic">Italic</span><span> Plain </span><span fontWeight="bold">Bold</span></p>';
+        private const outputString3:String = '<p><span fontStyle="italic" fontWeight="bold">BoldItalic</span><span>
Plain </span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontWeight="bold">Bold</span></p>';
+        private const outputString4:String = '<p leadingModel="approximateTextField" lineHeight="200%"><span
fontStyle="italic" fontWeight="bold">BoldItalic</span><span> Plain </span><span
fontStyle="italic">Italic</span><span> Plain </span><span fontWeight="bold">Bold</span></p>';
+        private const outputString5:String = '<p><span>asdf</span></p><p><span
fontWeight="bold">bold</span><span fontStyle="italic">italic</span></p><p><span>qwerty</span></p>';
+        private const outputString6:String = '<p><span>Plain </span><span
fontWeight="bold">Bold</span><span> </span><span fontStyle="italic">Italic</span><span>
Plain </span><span fontStyle="italic">Italic</span><span> Plain </span><span
fontWeight="bold">Bold</span></p>';
+
+        [DataPoints(loader=impliedParagraphHTMLImportTest1Loader)]
+        [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+        public static var impliedParagraphHTMLImportTest1Dp:Array;
+
+        public static var impliedParagraphHTMLImportTest1Loader:TestConfigurationLoader =
new TestConfigurationLoader("../../test/testCases/ImpliedParagraphTest.xml", "impliedParagraphHTMLImportTest1");
+
+        private var textImporter:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT);
+        private var textExporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT);
+
+        public function ImpliedParagraphTest()
+        {
+            super("", "ImpliedParagraphTest", TestConfig.getInstance());
+
+            metaData = {};
+        }
+
+        [After]
+        public override function tearDownTest():void
+        {
+            // Restore default configurations
+            super.tearDownTest();
+        }
+
+        [Test(dataProvider=impliedParagraphHTMLImportTest1Dp)]
+        public function impliedParagraphHTMLImportTest1(testCaseVo:TestCaseVo):void
+        {
+            TestData.fileName = testCaseVo.fileName;
+            super.setUpTest();
+
+            runTheTest(inputString1, outputString1);
+        }
+
+        [Test(dataProvider=impliedParagraphHTMLImportTest1Dp)]
+        public function impliedParagraphHTMLImportTest2(testCaseVo:TestCaseVo):void
+        {
+            TestData.fileName = testCaseVo.fileName;
+            super.setUpTest();
+
+            runTheTest(inputString2, outputString2);
+        }
+
+        [Test(dataProvider=impliedParagraphHTMLImportTest1Dp)]
+        public function impliedParagraphHTMLImportTest3(testCaseVo:TestCaseVo):void
+        {
+            TestData.fileName = testCaseVo.fileName;
+            super.setUpTest();
+
+            runTheTest(inputString3, outputString3);
+        }
+
+        [Test(dataProvider=impliedParagraphHTMLImportTest1Dp)]
+        public function impliedParagraphHTMLImportTest4(testCaseVo:TestCaseVo):void
+        {
+            TestData.fileName = testCaseVo.fileName;
+            super.setUpTest();
+
+            runTheTest(inputString4, outputString4);
+        }
+
+        [Test(dataProvider=impliedParagraphHTMLImportTest1Dp)]
+        public function impliedParagraphHTMLImportTest5(testCaseVo:TestCaseVo):void
+        {
+            TestData.fileName = testCaseVo.fileName;
+            super.setUpTest();
+
+            runTheTest(inputString5, outputString5);
+        }
+
+        [Test(dataProvider=impliedParagraphHTMLImportTest1Dp)]
+        public function impliedParagraphHTMLImportTest6(testCaseVo:TestCaseVo):void
+        {
+            TestData.fileName = testCaseVo.fileName;
+            super.setUpTest();
+
+            runTheTest(inputString6, outputString6);
+        }
+
+        private function runTheTest(inString:String, outString:String):void
         {
-			runTheTest(inputString1, outputString1);
-		}
-		
-		public function impliedParagraphHTMLImportTest2():void
-		{
-			runTheTest(inputString2, outputString2);
-		}
-		
-		public function impliedParagraphHTMLImportTest3():void
-		{
-			runTheTest(inputString3, outputString3);
-		}
-		
-		public function impliedParagraphHTMLImportTest4():void
-		{
-			runTheTest(inputString4, outputString4);
-		}
-		
-		public function impliedParagraphHTMLImportTest5():void
-		{
-			runTheTest(inputString5, outputString5);
-		}
-		
-		public function impliedParagraphHTMLImportTest6():void
-		{
-			runTheTest(inputString6, outputString6);
-		}
-	}
+            var textFlow:TextFlow = textImporter.importToFlow(inString);
+            var markupResult:String = textExporter.export(textFlow, ConversionType.STRING_TYPE)
as String;
+            var startIndex:int = markupResult.search("<p");
+            var endIndex:int = markupResult.search("</TextFlow>");
+            var expectedString:String = markupResult.substring(startIndex, endIndex);
+            assertTrue("TLF model did not match expected result", expectedString == outString);
+        }
+    }
 }


Mime
View raw message