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 2014/11/03 21:50:43 UTC

[01/44] Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Repository: flex-tlf
Updated Branches:
  refs/heads/tables 84e8b25b2 -> f6348cdba


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/EventOverrideTest.as b/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
index c933f3d..604cedf 100644
--- a/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
+++ b/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
@@ -18,645 +18,372 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
 
-	import flash.events.*;
-	import flash.ui.KeyLocation;
+    import flash.events.*;
+    import flash.ui.KeyLocation;
 
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.undo.UndoManager;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.undo.UndoManager;
 
     import org.flexunit.asserts.assertTrue;
 
     public class EventOverrideTest extends VellumTestCase
-	{
-		public function EventOverrideTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
-		{
-			super(methodName, testID, testConfig, testCaseXML);
-
-			if ( TestData.eventOverride )
-   			{
-   				TestID = TestID + ":" + TestData.eventOverride;
-   			}
-
-   			// Note: These must correspond to a Watson product area (case-sensitive)
-   			metaData.productArea = "Editing";
-		}
-
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = EventOverrideTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-   		public override function setUpTest():void
-   		{
-   			/*if ( TestData.eventOverride )
-   			{
-   				TextFlow.defaultConfiguration.manageEventListeners = false;
-   			}*/
-
-   			super.setUpTest();
-
-   			if ( TestData.overrideEditManager == "true" )
-   			{
-	   			var testManager:EditManager = new TestEditManager(new UndoManager());
-	   			SelManager.textFlow.interactionManager = testManager;
-	   			SelManager = testManager;
-	   			SelManager.selectRange(0,0);
-	   		}
-   		}
-
-   		public override function tearDownTest():void
-   		{
-   			/*if ( TestData.eventOverride )
-   			{
-	   			TextFlow.defaultConfiguration.manageEventListeners = true;
-	   			// Make sure we leave without a broken TextFlow
-				loadTestFile("empty.xml");
-   			}*/
-
-   			if ( TestData.overrideEditManager == "true" )
-   			{
-	   			var newManager:EditManager = new EditManager(new UndoManager());
-	   			SelManager.textFlow.interactionManager = newManager;
-	   			SelManager = newManager;
-	   		}
-   		}
-
-   		// Returns the string from begIdx through and including endIdx
-   		private function getText( begIdx:int, endIdx:int ): String
-   		{
-   			var outString:String = "";
-
-   			for ( var x:int = begIdx; x < endIdx; x++ )
-   			{
-   				outString += SelManager.textFlow.getCharAtPosition(x);
-   			}
-
-   			return outString;
-   		}
-
-   		// Returns the text contents of the entire textflow
-   		private function getAllText(): String
-   		{
-   			var begIdx:int = SelManager.textFlow.parentRelativeStart;
-   			var endIdx:int = SelManager.textFlow.parentRelativeEnd-1;
-   			var outString:String = "";
-
-   			for ( var x:int = begIdx; x < endIdx; x++ )
-   			{
-   				outString += SelManager.textFlow.getCharAtPosition(x);
-   			}
-
-   			return outString;
-   		}
-
-/******* Framework for event override tests (Not using derived editmanager ***********************/
-/** Removing for expected ARB-related updates - probably to be removed permanently
- *
-   		private function eventFromText( textID:String, addListener:Boolean, removeListener:Boolean = false ):Event
-   		{
-			var outEvent:Event;
-
-			switch ( textID )
-			{
-				case "MOUSE_DOWN":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_DOWN, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_DOWN, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_DOWN, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "MOUSE_OVER":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_OVER, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_OVER, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_OVER, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "MOUSE_OUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_OUT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_OUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_OUT, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "MOUSE_WHEEL":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_WHEEL, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_WHEEL, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_WHEEL, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "DOUBLE_CLICK":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.DOUBLE_CLICK, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.DOUBLE_CLICK, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "KEY_DOWN":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( KeyboardEvent.KEY_DOWN, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( KeyboardEvent.KEY_DOWN, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false,
-											 8, 8, KeyLocation.STANDARD, true, false, false);
-						return outEvent;
-					}
-					break;
-				case "FOCUS_IN":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( FocusEvent.FOCUS_IN, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( FocusEvent.FOCUS_IN, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new FocusEvent( FocusEvent.FOCUS_IN );
-						return outEvent;
-					}
-					break;
-				case "FOCUS_OUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( FocusEvent.FOCUS_OUT, eventHandler );
-					}
-					else
-					if (addListener)
-					{
-						SelManager.textFlow.addEventListener( FocusEvent.FOCUS_OUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new FocusEvent( FocusEvent.FOCUS_OUT );
-						return outEvent;
-					}
-					break;
-				case "TEXT_INPUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( TextEvent.TEXT_INPUT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( TextEvent.TEXT_INPUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new TextEvent( TextEvent.TEXT_INPUT, false, true, "WONTSEEME" );
-						return outEvent;
-					}
-					break;
-				case "ACTIVATE":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.ACTIVATE, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.ACTIVATE, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.ACTIVATE );
-						return outEvent;
-					}
-					break;
-				case "DEACTIVATE":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.DEACTIVATE, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.DEACTIVATE, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.DEACTIVATE );
-						return outEvent;
-					}
-					break;
-				case "MENU_SELECT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( ContextMenuEvent.MENU_SELECT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( ContextMenuEvent.MENU_SELECT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new ContextMenuEvent( ContextMenuEvent.MENU_SELECT );
-						return outEvent;
-					}
-					break;
-				case "SELECT_ALL":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.SELECT_ALL, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.SELECT_ALL, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.SELECT_ALL );
-						return outEvent;
-					}
-					break;
-				case "COPY":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.COPY, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.COPY, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.COPY );
-						return outEvent;
-					}
-					break;
-				case "CUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.CUT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.CUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.CUT );
-						return outEvent;
-					}
-					break;
-				case "PASTE":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.PASTE, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.PASTE, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.PASTE );
-						return outEvent;
-					}
-					break;
-			}
-
-			return null;
-   		}
-
-   		// Generic event handler
-   		// How can this be made more even specific?
-   		private function eventHandler( event:Event ):void
-   		{
-   			SelManager.insertText("EVENT");
-   		}
-
-   		// Generic test case for all event overrides
-   		public function testEventOverride():void
-   		{
-   			SelManager.insertText("StillHere");
-   			SelManager.selectRange(9,9);
-
-   			// Add event listener
-   			eventFromText( TestData.eventOverride, true );
-
-   			var newEvent:Event = eventFromText( TestData.eventOverride, false );
-   			assertTrue( "Test Case Failure: Unable to find event specified in XML",
-   						newEvent != null );
-   			SelManager.textFlow.dispatchEvent(newEvent);
-
-   			SelManager.flushPendingOperations();
-   			assertTrue( TestData.eventOverride + " event was not executed after override",
-						getAllText() == "StillHereEVENT" );
-			assertTrue( TestData.eventOverride + " event shouldn't change selection",
-						SelManager.activePosition == 14 && SelManager.anchorPosition == 14 );
-
-			// Remove event listener
-			eventFromText( TestData.eventOverride, false, true );
-   		}
-*/
-/************** TESTS USING DERIVED EDITMANAGER **************************************************/
-
-   		public function keyDownDerivedTest():void
-   		{
-   			SelManager.insertText("StillHere");
-   			SelManager.selectRange(9,9);
-
-   			// Send a Ctrl-Backspace
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN,
-				true, false, 8, 8, KeyLocation.STANDARD, true, false, false);
-			TestFrame.container["dispatchEvent"](kEvent);
-
-			SelManager.flushPendingOperations();
-
-			assertTrue( "Keyboard event executed normally when overridden",
-						getText(0,9) == "StillHere" );
-
-			assertTrue( "Keyboard event override was not executed",
-						getAllText() == "StillHereKEYDOWN" );
-   		}
-
-   		public function mouseDownDerivedTest():void
-   		{
-   			var kEvent:MouseEvent = new MouseEvent( MouseEvent.MOUSE_DOWN, true, false, 0, 0 );
-			TestFrame.container["dispatchEvent"](kEvent);
-
-			SelManager.flushPendingOperations();
-
-			assertTrue( "Mouse Down event override was not executed",
-						getAllText() == "MOUSEDOWN" );
-   		}
-
-   		public function mouseMoveDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).mouseMoved = false;
-   			var kEvent:MouseEvent = new MouseEvent( MouseEvent.MOUSE_DOWN, true, false, 0, 0 );
-			TestFrame.container["dispatchEvent"](kEvent);
-   			var mEvent:MouseEvent = new MouseEvent( MouseEvent.MOUSE_MOVE, true, false,
-   											 20, 20 );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			SelManager.flushPendingOperations();
-
-			assertTrue( "Mouse Move event override was not executed",
-						getAllText() == "MOUSEDOWNMOUSEMOVE" );
-   		}
-
-   		public function textEventDerivedTest():void
-   		{
-   			// Send 'a' string
-   			var kEvent:TextEvent = new TextEvent( TextEvent.TEXT_INPUT, false, false, "a" );
-			TestFrame.container["dispatchEvent"](kEvent);
+    {
+        public function EventOverrideTest()
+        {
+            super("", "EventOverrideTest", TestConfig.getInstance());
+
+            if (TestData.eventOverride)
+            {
+                TestID = TestID + ":" + TestData.eventOverride;
+            }
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Editing";
+        }
+
+        [Before]
+        public override function setUpTest():void
+        {
+            super.setUpTest();
+
+            if (TestData.overrideEditManager == "true")
+            {
+                var testManager:EditManager = new TestEditManager(new UndoManager());
+                SelManager.textFlow.interactionManager = testManager;
+                SelManager = testManager;
+                SelManager.selectRange(0, 0);
+            }
+        }
+
+        [After]
+        public override function tearDownTest():void
+        {
+            if (TestData.overrideEditManager == "true")
+            {
+                var newManager:EditManager = new EditManager(new UndoManager());
+                SelManager.textFlow.interactionManager = newManager;
+                SelManager = newManager;
+            }
+        }
+
+        /************** TESTS USING DERIVED EDITMANAGER **************************************************/
+
+        [Test]
+        [Ignore]
+        public function keyDownDerivedTest():void
+        {
+            SelManager.insertText("StillHere");
+            SelManager.selectRange(9, 9);
+
+            // Send a Ctrl-Backspace
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN,
+                    true, false, 8, 8, KeyLocation.STANDARD, true, false, false);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Keyboard event executed normally when overridden",
+                    getText(0, 9) == "StillHere");
+
+            assertTrue("Keyboard event override was not executed",
+                    getAllText() == "StillHereKEYDOWN");
+        }
+
+        [Test]
+        [Ignore]
+        public function mouseDownDerivedTest():void
+        {
+            var kEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, 0, 0);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Mouse Down event override was not executed",
+                    getAllText() == "MOUSEDOWN");
+        }
+
+        [Test]
+        [Ignore]
+        public function mouseMoveDerivedTest():void
+        {
+            (SelManager as TestEditManager).mouseMoved = false;
+            var kEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, 0, 0);
+            TestFrame.container["dispatchEvent"](kEvent);
+            var mEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_MOVE, true, false,
+                    20, 20);
+            TestFrame.container["dispatchEvent"](mEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Mouse Move event override was not executed",
+                    getAllText() == "MOUSEDOWNMOUSEMOVE");
+        }
+
+        [Test]
+        [Ignore]
+        public function textEventDerivedTest():void
+        {
+            // Send 'a' string
+            var kEvent:TextEvent = new TextEvent(TextEvent.TEXT_INPUT, false, false, "a");
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Text Event override was not executed",
+                    getAllText() == "TEXTEVENT");
+        }
+
+        [Test]
+        [Ignore]
+        public function focusInDerivedTest():void
+        {
+            var kEvent:FocusEvent = new FocusEvent(FocusEvent.FOCUS_IN);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Focus In override was not executed",
+                    getAllText() == "FOCUSIN");
+        }
+
+        [Test]
+        [Ignore]
+        public function focusOutDerivedTest():void
+        {
+            var kEvent:FocusEvent = new FocusEvent(FocusEvent.FOCUS_OUT);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
 
-			SelManager.flushPendingOperations();
+            assertTrue("Focus Out override was not executed",
+                    getAllText() == "FOCUSOUT");
+        }
 
-			assertTrue( "Text Event override was not executed",
-						getAllText() == "TEXTEVENT" );
-   		}
+        [Test]
+        [Ignore]
+        public function activateDerivedTest():void
+        {
+            var kEvent:Event = new Event(Event.ACTIVATE);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function focusInDerivedTest():void
-   		{
-   			var kEvent:FocusEvent = new FocusEvent( FocusEvent.FOCUS_IN );
-			TestFrame.container["dispatchEvent"](kEvent);
+            SelManager.flushPendingOperations();
 
-			SelManager.flushPendingOperations();
+            assertTrue("Activate override was not executed",
+                    getAllText() == "ACTIVATE");
+        }
 
-			assertTrue( "Focus In override was not executed",
-						getAllText() == "FOCUSIN" );
-   		}
+        [Test]
+        [Ignore]
+        public function deactivateDerivedTest():void
+        {
+            var kEvent:Event = new Event(Event.DEACTIVATE);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function focusOutDerivedTest():void
-   		{
-   			var kEvent:FocusEvent = new FocusEvent( FocusEvent.FOCUS_OUT );
-			TestFrame.container["dispatchEvent"](kEvent);
+            SelManager.flushPendingOperations();
 
-			SelManager.flushPendingOperations();
+            assertTrue("Deactivate override was not executed",
+                    getAllText() == "DEACTIVATE");
+        }
 
-			assertTrue( "Focus Out override was not executed",
-						getAllText() == "FOCUSOUT" );
-   		}
+        [Test]
+        [Ignore]
+        public function deleteNextDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-   		public function activateDerivedTest():void
-   		{
-   			var kEvent:Event = new Event( Event.ACTIVATE );
-			TestFrame.container["dispatchEvent"](kEvent);
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 127, 46);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-			SelManager.flushPendingOperations();
+            SelManager.flushPendingOperations();
 
-			assertTrue( "Activate override was not executed",
-						getAllText() == "ACTIVATE" );
-   		}
+            assertTrue("Delete Next override was not executed by pressing 'Delete'",
+                    getAllText() == "DELETENEXT");
 
-   		public function deactivateDerivedTest():void
-   		{
-   			var kEvent:Event = new Event( Event.DEACTIVATE );
-			TestFrame.container["dispatchEvent"](kEvent);
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			SelManager.flushPendingOperations();
+        [Test]
+        [Ignore]
+        public function deletePreviousDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-			assertTrue( "Deactivate override was not executed",
-						getAllText() == "DEACTIVATE" );
-   		}
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8, 8);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function deleteNextDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            SelManager.flushPendingOperations();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 127, 46 );
-			TestFrame.container["dispatchEvent"](kEvent);
+            assertTrue("Delete Previous override was not executed by pressing 'Backspace'",
+                    getAllText() == "DELETEPREVIOUS");
 
-			SelManager.flushPendingOperations();
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			assertTrue( "Delete Next override was not executed by pressing 'Delete'",
-						getAllText() == "DELETENEXT" );
+        [Test]
+        [Ignore]
+        public function deleteNextWordDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 127, 46, 0, true);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function deletePreviousDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            SelManager.flushPendingOperations();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 8, 8 );
-			TestFrame.container["dispatchEvent"](kEvent);
+            assertTrue("Delete Next override was not executed by pressing 'Ctrl-Delete'",
+                    getAllText() == "DELETENEXTWORD");
 
-			SelManager.flushPendingOperations();
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			assertTrue( "Delete Previous override was not executed by pressing 'Backspace'",
-						getAllText() == "DELETEPREVIOUS" );
+        [Test]
+        [Ignore]
+        public function deletePreviousWordDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8, 8, 0, true);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function deleteNextWordDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            SelManager.flushPendingOperations();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 127, 46, 0, true );
-			TestFrame.container["dispatchEvent"](kEvent);
+            assertTrue("Delete Previous override was not executed by pressing 'Ctrl-Backspace'",
+                    getAllText() == "DELETEPREVIOUSWORD");
 
-			SelManager.flushPendingOperations();
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			assertTrue( "Delete Next override was not executed by pressing 'Ctrl-Delete'",
-						getAllText() == "DELETENEXTWORD" );
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
+        // Returns the string from begIdx through and including endIdx
+        private function getText(begIdx:int, endIdx:int):String
+        {
+            var outString:String = "";
 
-   		public function deletePreviousWordDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            var tt:String = SelManager.textFlow.getText();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 8, 8, 0, true );
-			TestFrame.container["dispatchEvent"](kEvent);
+            for (var x:int = begIdx; x < endIdx; x++)
+            {
+                outString += SelManager.textFlow.getCharAtPosition(x);
+            }
 
-			SelManager.flushPendingOperations();
+            return outString;
+        }
 
-			assertTrue( "Delete Previous override was not executed by pressing 'Ctrl-Backspace'",
-						getAllText() == "DELETEPREVIOUSWORD" );
+        // Returns the text contents of the entire textflow
+        private function getAllText():String
+        {
+            var begIdx:int = SelManager.textFlow.parentRelativeStart;
+            var endIdx:int = SelManager.textFlow.parentRelativeEnd - 1;
+            var outString:String = "";
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
-	}
+            for (var x:int = begIdx; x < endIdx; x++)
+            {
+                outString += SelManager.textFlow.getCharAtPosition(x);
+            }
+
+            return outString;
+        }
+    }
 }
 
 /********Editmanager for overriding events - Internal Helper Class**********************************/
 
-import flashx.textLayout.edit.EditManager;
-import flashx.undo.IUndoManager;
+import flash.events.Event;
+import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
 import flash.events.TextEvent;
-import flash.events.FocusEvent;
-import flash.events.Event;
+
+import flashx.textLayout.edit.EditManager;
 import flashx.textLayout.edit.SelectionState;
+import flashx.undo.IUndoManager;
 
 internal class TestEditManager extends EditManager
 {
-	public var mouseMoved:Boolean;
-	public var useDefaultKeyDown:Boolean;
-
-	public function TestEditManager(undo:IUndoManager = null)
-	{
-		super(undo);
-
-		useDefaultKeyDown = false;
-
-		// Don't react to this event and ruin a different test
-		mouseMoved = true;
-	}
-
-	public override function keyDownHandler(event:KeyboardEvent):void
-	{
-		if ( useDefaultKeyDown == true )
-			super.keyDownHandler(event);
-		else
-			insertText("KEYDOWN");
-	}
-
-	public override function mouseDownHandler(event:MouseEvent):void
-	{ insertText("MOUSEDOWN"); }
-
-	public override function mouseMoveHandler(event:MouseEvent):void
-	{
-		// Don't react to this event more than once
-		if ( !mouseMoved)
-		{
-			insertText("MOUSEMOVE");
-			mouseMoved = true;
-		}
-	}
-
-	public override function textInputHandler(event:TextEvent):void
-	{ insertText("TEXTEVENT"); }
-
-	public override function focusInHandler(event:FocusEvent):void
-	{ insertText("FOCUSIN"); }
-
-	public override function focusOutHandler(event:FocusEvent):void
-	{ insertText("FOCUSOUT"); }
-
-	public override function activateHandler(event:Event):void
-	{ insertText("ACTIVATE"); }
-
-	public override function deactivateHandler(event:Event):void
-	{ insertText("DEACTIVATE"); }
-
-	/***** EDITMANAGER OVERRIDES *****/
-
-	public override function deleteNextCharacter(operationState:SelectionState=null):void
-	{ insertText("DELETENEXT"); }
-
-	public override function deletePreviousCharacter(operationState:SelectionState=null):void
-	{ insertText("DELETEPREVIOUS"); }
-
-	public override function deleteNextWord(operationState:SelectionState=null):void
-	{ insertText("DELETENEXTWORD"); }
-
-	public override function deletePreviousWord(operationState:SelectionState=null):void
-	{ insertText("DELETEPREVIOUSWORD"); }
+    public var mouseMoved:Boolean;
+    public var useDefaultKeyDown:Boolean;
+
+    public function TestEditManager(undo:IUndoManager = null)
+    {
+        super(undo);
+
+        useDefaultKeyDown = false;
+
+        // Don't react to this event and ruin a different test
+        mouseMoved = true;
+    }
+
+    public override function keyDownHandler(event:KeyboardEvent):void
+    {
+        if (useDefaultKeyDown == true)
+            super.keyDownHandler(event);
+        else
+            insertText("KEYDOWN");
+    }
+
+    public override function mouseDownHandler(event:MouseEvent):void
+    {
+        insertText("MOUSEDOWN");
+    }
+
+    public override function mouseMoveHandler(event:MouseEvent):void
+    {
+        // Don't react to this event more than once
+        if (!mouseMoved)
+        {
+            insertText("MOUSEMOVE");
+            mouseMoved = true;
+        }
+    }
+
+    public override function textInputHandler(event:TextEvent):void
+    {
+        insertText("TEXTEVENT");
+    }
+
+    public override function focusInHandler(event:FocusEvent):void
+    {
+        insertText("FOCUSIN");
+    }
+
+    public override function focusOutHandler(event:FocusEvent):void
+    {
+        insertText("FOCUSOUT");
+    }
+
+    public override function activateHandler(event:Event):void
+    {
+        insertText("ACTIVATE");
+    }
+
+    public override function deactivateHandler(event:Event):void
+    {
+        insertText("DEACTIVATE");
+    }
+
+    /***** EDITMANAGER OVERRIDES *****/
+
+    public override function deleteNextCharacter(operationState:SelectionState = null):void
+    {
+        insertText("DELETENEXT");
+    }
+
+    public override function deletePreviousCharacter(operationState:SelectionState = null):void
+    {
+        insertText("DELETEPREVIOUS");
+    }
+
+    public override function deleteNextWord(operationState:SelectionState = null):void
+    {
+        insertText("DELETENEXTWORD");
+    }
+
+    public override function deletePreviousWord(operationState:SelectionState = null):void
+    {
+        insertText("DELETEPREVIOUSWORD");
+    }
 
 }


[07/44] git commit: [flex-tlf] [refs/heads/tables] - Merge branch 'FlexUnit4TestsTLF' into develop

Posted by pi...@apache.org.
Merge branch 'FlexUnit4TestsTLF' into develop


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

Branch: refs/heads/tables
Commit: 0b579456e44aa04488e999c6293e1f004b2ece5e
Parents: e57200c 7961f33
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:15:34 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:15:34 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |   13 +-
 automation_tests/src/MinimalTestsSuite.as       |    4 +-
 .../UnitTest/Tests/BoundsAndAlignmentTest.as    |  278 +--
 automation_tests/src/UnitTest/Tests/BoxTest.as  |   51 +-
 .../src/UnitTest/Tests/ContainerTypeTest.as     |    8 -
 .../src/UnitTest/Tests/CrossContainerTest.as    |  430 ++--
 .../src/UnitTest/Tests/ElementOperationTest.as  | 1192 +++++++++++
 .../src/UnitTest/Tests/ElementOperationTests.as | 1228 -----------
 .../src/UnitTest/Tests/EventOverrideTest.as     |  905 +++------
 .../src/UnitTest/Tests/FactoryImportTest.as     |  250 +--
 .../src/UnitTest/Tests/FloatTest.as             |   84 -
 .../src/UnitTest/Tests/FlowModelTest.as         | 1920 +++++++++---------
 12 files changed, 2845 insertions(+), 3518 deletions(-)
----------------------------------------------------------------------



[33/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-26478 CAUSE: When replacing ContainerControllers (triggered when the text changes in a TextField / TextArea), StandardFlowComposer tried to dispose of the discarded ones first. It did this by call

Posted by pi...@apache.org.
FLEX-26478
CAUSE:
When replacing ContainerControllers (triggered when the text changes in a TextField / TextArea), StandardFlowComposer tried to dispose of the discarded ones first. It did this by calling clearSelectionShapes() and setRootElement(null) on the ContainerControllers. However, if that controller was already listening for mouse scroll events (when the user selects text and moves the mouse outside the text field in such a way that causes the text to scroll), this listener wasn't removed. Which meant that the next time scrollTimerHandler() was called (on the inactive ContainerController), textFlow was null due to the call to setRootElement(null).

SOLUTION:
StandardFlowComposer now calls a new method 'discard' on the ContainerControllers which are not needed anymore. This method now also stops the selection scroll timer ('_scrollTimer').


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

Branch: refs/heads/tables
Commit: d1c83617f4a32b4c39417ed53dd26c5aa2df7503
Parents: 129ec69
Author: Mihai Chira <mi...@apache.org>
Authored: Wed Oct 22 16:23:40 2014 +0100
Committer: Mihai Chira <mi...@apache.org>
Committed: Wed Oct 22 16:23:40 2014 +0100

----------------------------------------------------------------------
 .../textLayout/compose/StandardFlowComposer.as  |  3 +-
 .../textLayout/container/ContainerController.as | 35 +++++++++++++++-----
 2 files changed, 27 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/d1c83617/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
index cb0b38e..3393d32 100644
--- a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
+++ b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
@@ -185,8 +185,7 @@ package flashx.textLayout.compose
 		  	var cont:ContainerController;
 			for each (cont in _controllerList)
 			{
-				cont.clearSelectionShapes();
-				cont.setRootElement(null);
+				cont.dispose();
 			}
 		}
 		

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/d1c83617/textLayout/src/flashx/textLayout/container/ContainerController.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/container/ContainerController.as b/textLayout/src/flashx/textLayout/container/ContainerController.as
index 4876884..de77fa7 100644
--- a/textLayout/src/flashx/textLayout/container/ContainerController.as
+++ b/textLayout/src/flashx/textLayout/container/ContainerController.as
@@ -27,6 +27,7 @@ package flashx.textLayout.container
 	import flash.events.ContextMenuEvent;
 	import flash.events.Event;
 	import flash.events.FocusEvent;
+    import flash.events.IEventDispatcher;
 	import flash.events.IMEEvent;
 	import flash.events.KeyboardEvent;
 	import flash.events.MouseEvent;
@@ -1770,6 +1771,29 @@ package flashx.textLayout.container
 			return createDefaultContextMenu();
 		}
 		
+        public function dispose():void
+        {
+            stopMouseSelectionScrolling();
+            clearSelectionShapes();
+            setRootElement(null);
+        }
+
+        private function stopMouseSelectionScrolling(containerRoot:IEventDispatcher = null):void
+        {
+            if(_scrollTimer)
+            {
+                _scrollTimer.stop();
+                _scrollTimer.removeEventListener(TimerEvent.TIMER, scrollTimerHandler);
+
+                if(!containerRoot)
+                    containerRoot = getContainerRoot();
+
+                if(containerRoot)
+                    containerRoot.removeEventListener(MouseEvent.MOUSE_UP, scrollTimerHandler);
+
+                _scrollTimer = null;
+            }
+        }
 		/** @private */
 		tlf_internal function scrollTimerHandler(event:Event):void
 		{
@@ -1785,19 +1809,12 @@ package flashx.textLayout.container
 			// We're listening for MOUSE_UP so we can cancel autoscrolling
 			if (event is MouseEvent)
 			{
-				_scrollTimer.stop();
-				_scrollTimer.removeEventListener(TimerEvent.TIMER, scrollTimerHandler);
+				stopMouseSelectionScrolling(event.currentTarget as IEventDispatcher);
 				CONFIG::debug { assert(_container.stage ==  null || getContainerRoot() == event.currentTarget,"scrollTimerHandler bad target"); }
-				event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, scrollTimerHandler);
-				_scrollTimer = null;
 			}
 			else if (!event)
 			{
-				_scrollTimer.stop();
-				_scrollTimer.removeEventListener(TimerEvent.TIMER, scrollTimerHandler);
-				if (getContainerRoot())
-					getContainerRoot().removeEventListener(	MouseEvent.MOUSE_UP, scrollTimerHandler);	
-				_scrollTimer = null;
+                stopMouseSelectionScrolling();
 			}
 			else if (_container.stage)
 			{


[26/44] git commit: [flex-tlf] [refs/heads/tables] - Try to fix build - higher values for MaxPermSize=768

Posted by pi...@apache.org.
Try to fix build - higher values for MaxPermSize=768


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

Branch: refs/heads/tables
Commit: af7ec2f9cb215be99ee148d19b88afb1476bc5a7
Parents: 1ba820c
Author: piotrz <pi...@gmail.com>
Authored: Tue Oct 21 07:59:23 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Tue Oct 21 07:59:23 2014 +0200

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/af7ec2f9/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 9f348fa..a644f8f 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx384m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx384m -XX:MaxPermSize=768m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[11/44] git commit: [flex-tlf] [refs/heads/tables] - Merge branch 'FlexUnit4TestsTLF' into develop

Posted by pi...@apache.org.
Merge branch 'FlexUnit4TestsTLF' into develop


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

Branch: refs/heads/tables
Commit: 620baf26855c28308c9f409a4fa2ce046369063d
Parents: 3a4075c 0ca7dea
Author: piotrz <pi...@gmail.com>
Authored: Mon Oct 13 07:46:29 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Mon Oct 13 07:46:29 2014 +0200

----------------------------------------------------------------------
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[02/44] Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/ElementOperationTests.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ElementOperationTests.as b/automation_tests/src/UnitTest/Tests/ElementOperationTests.as
deleted file mode 100644
index 5c3860d..0000000
--- a/automation_tests/src/UnitTest/Tests/ElementOperationTests.as
+++ /dev/null
@@ -1,1228 +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 UnitTest.Tests
-{
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.text.engine.FontWeight;
-	
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.DivElement;
-	import flashx.textLayout.elements.FlowGroupElement;
-	import flashx.textLayout.elements.LinkElement;
-	import flashx.textLayout.elements.ListElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.SpanElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.formats.TextAlign;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.operations.ApplyElementIDOperation;
-	import flashx.textLayout.operations.ApplyElementStyleNameOperation;
-	import flashx.textLayout.operations.ApplyElementTypeNameOperation;
-	import flashx.textLayout.operations.ApplyElementUserStyleOperation;
-	import flashx.textLayout.operations.ApplyFormatToElementOperation;
-
-    import org.flexunit.asserts.assertTrue;
-
-    public class ElementOperationTests extends VellumTestCase
-	{
-		public function ElementOperationTests(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super(methodName, testID, testConfig);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Editing";
-		}
-
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-			if (testConfig.writingDirection[0] == "tb" && testConfig.writingDirection[1] == "ltr")
-			{
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowIdTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphIdTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphIdTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanIdTest", testConfig ) );
-	
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowStyleNameTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphStyleNameTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphStyleNameTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanStyleNameTest", testConfig ) );
-				
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowTypeNameTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphTypeNameTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphTypeNameTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanTypeNameTest", testConfig ) );
-	
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowUserStyleTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphUserStyleTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphUserStyleTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanUserStyleTest", testConfig ) );
-	
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "deleteAcrossDivBoundaryTest", testConfig ) );
-				
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "splitStyledParagraphTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "BreaksSplitTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "splitStyledListItemTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "splitStyledAnchorTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "spanElementReplaceTextInvalidPos", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "copyErrorMassageTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "applyFormatToElementOperationFormatTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "typeNameSetGetTest", testConfig ) );
-			}
-   		}
-
-		/**
-		 */
-		public function changeTextFlowIdTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var origId:String = tf.id;
-			var newId:String = "newTFId";
-
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),tf,newId));
-			assertTrue("changeTextFlowIdTest doOperation error", tf.id == newId);
-			SelManager.undo();
-			assertTrue("changeTextFlowIdTest undo error", tf.id == origId);
-			SelManager.redo();
-			assertTrue("changeTextFlowIdTest redo error", tf.id == newId);
-		}
-
-		/**
-		 */
-		public function changeFirstParagraphIdTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var origId:String = p.id;
-			var newId:String = "newParaId";
-
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),p,newId));
-			assertTrue("changeFirstParagraphIdTest doOperation error", p.id == newId);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphIdTest undo error", p.id == origId);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphIdTest redo error", p.id == newId);
-		}
-
-		/**
-		 */
-		public function changePartialParagraphIdTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origId:String = p.id;
-			var origTextLength:int = p.textLength;
-			var newId:String = "newParaId";
-
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),p,newId,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphIdTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphIdTest doOperation error id", p.id == newId);
-			assertTrue("changePartialParagraphIdTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphIdTest doOperation error totalLength", tf.textLength == totalLength+2);
-
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphIdTest undo error", p.id == origId && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphIdTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphIdTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphIdTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphIdTest redo error", p.id == newId);
-			assertTrue("changePartialParagraphIdTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphIdTest redo error totalLength", tf.textLength == totalLength+2);
-		}
-
-		/**
-		 */
-		public function changePartialSpanIdTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanIdTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-
-			var origId:String = span.id;
-			var origSpanLength:int = span.textLength;
-			var newId:String = "newSpanId";
-
-			// splits the span
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),span,newId,10,20));
-
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanIdTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanIdTest doOperation error id", span.id == newId);
-			assertTrue("changePartialSpanIdTest doOperation error totalLength", tf.textLength == totalLength);
-
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanIdTest undo error", span.id == origId && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanIdTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanIdTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanIdTest redo error", span.id == newId);
-			assertTrue("changePartialSpanIdTest redo error totalLength", tf.textLength == totalLength);
-		}
-
-		/**
-		 */
-		public function changeTextFlowStyleNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var origStyleName:String = tf.styleName;
-			var newStyleName:String = "newTFStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),tf,newStyleName));
-			assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
-			
-			SelManager.undo();
-			assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
-			
-			// test using the replacement class
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),tf,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName})));
-			assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
-
-		}
-
-		/**
-		 */
-		public function changeFirstParagraphStyleNameTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var origStyleName:String = p.styleName;
-			var newStyleName:String = "newParaStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),p,newStyleName));
-			assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			
-			SelManager.undo();
-			assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
-
-			// test using the replacement class
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName})));
-			assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			
-		}
-		
-		/**
-		 */
-		public function changeTextFlowTypeNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var origTypeName:String = tf.typeName;
-			var newTypeName:String = "newTFTypeName";
-			
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),tf,newTypeName));
-			assertTrue("changeTextFlowTypeNameTest doOperation error", tf.typeName == newTypeName);
-			SelManager.undo();
-			assertTrue("changeTextFlowTypeNameTest undo error", tf.typeName == origTypeName);
-			SelManager.redo();
-			assertTrue("changeTextFlowTypeNameTest redo error", tf.typeName == newTypeName);
-		}
-		
-		/**
-		 */
-		public function changeFirstParagraphTypeNameTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var origTypeName:String = p.typeName;
-			var newTypeName:String = "newParaTypeName";
-			
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),p,newTypeName));
-			assertTrue("changeFirstParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphTypeNameTest undo error", p.typeName == origTypeName);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphTypeNameTest redo error", p.typeName == newTypeName);
-		}
-
-		/**
-		 */
-		public function changePartialParagraphStyleNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origStyleName:String = p.styleName;
-			var origTextLength:int = p.textLength;
-			var newStyleName:String = "newParaStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),p,newStyleName,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength+2);
-
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-
-			// cleanup
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			// test using the replacement class
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName}),10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength+2);
-			
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-
-		}
-
-		/**
-		 */
-		public function changePartialSpanStyleNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-
-			var origStyleName:String = span.styleName;
-			var origSpanLength:int = span.textLength;
-			var newStyleName:String = "newSpanStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			// splits the span
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),span,newStyleName,10,20));
-
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
-
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
-			
-			// cleanup
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			// test using the replacement function
-			
-			// splits the span
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),span,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName}),10,20));
-			
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
-			
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
-		}
-
-		/**
-		 */
-		public function changePartialParagraphTypeNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-			
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origTypeName:String = p.typeName;
-			var origTextLength:int = p.textLength;
-			var newTypeName:String = "newParaTypeName";
-			
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),p,newTypeName,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphTypeNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
-			assertTrue("changePartialParagraphTypeNameTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphTypeNameTest doOperation error totalLength", tf.textLength == totalLength+2);
-			
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphTypeNameTest undo error", p.typeName == origTypeName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphTypeNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphTypeNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphTypeNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphTypeNameTest redo error", p.typeName == newTypeName);
-			assertTrue("changePartialParagraphTypeNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphTypeNameTest redo error totalLength", tf.textLength == totalLength+2);
-		}
-		
-		/**
-		 */
-		public function changePartialSpanTypeNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-			
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-			
-			var origTypeName:String = span.typeName;
-			var origSpanLength:int = span.textLength;
-			var newTypeName:String = "newSpanTypeName";
-			
-			// splits the span
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),span,newTypeName,10,20));
-			
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanTypeNameTest doOperation error id", span.typeName == newTypeName);
-			assertTrue("changePartialSpanTypeNameTest doOperation error totalLength", tf.textLength == totalLength);
-			
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest undo error", span.typeName == origTypeName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanTypeNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanTypeNameTest redo error", span.typeName == newTypeName);
-			assertTrue("changePartialSpanTypeNameTest redo error totalLength", tf.textLength == totalLength);
-		}
-		
-		/**
-		 */
-		public function changeTextFlowUserStyleTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = tf.getStyle(styleName);
-			var newStyleValue:String = "newTFStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),tf,styleName,newStyleValue));
-			assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
-			
-			// cleanup
-			SelManager.undo();
-			assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
-
-			// test using the replacement class
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),tf,format));
-			assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
-		}
-
-		/**
-		 */
-		public function changeFirstParagraphUserStyleTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = p.getStyle(styleName);
-			var newStyleValue:String = "newParaStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),p,styleName,newStyleValue));
-			assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);
-			
-			// cleanup
-			SelManager.undo();
-			assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
-			
-			// test using the replacement class
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,format));
-			assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);			
-		}
-		/**
-		 */
-		public function changePartialParagraphUserStyleTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origTextLength:int = p.textLength;
-
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = p.getStyle(styleName);
-			var newStyleValue:String = "newParaStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),p,styleName,newStyleValue,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength+2);
-
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-			
-			// cleanup
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			// test using the replacement class
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,format,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength+2);
-			
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-			
-		}
-
-		/**
-		 */
-		public function changePartialSpanUserStyleTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-			var origSpanLength:int = span.textLength;
-
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = span.getStyle(styleName);
-			var newStyleValue:String = "newSpanStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			// splits the span
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),span,styleName,newStyleValue,10,20));
-
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
-
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);
-			
-			// cleanup
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			// splits the span
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),span,format,10,20));
-			
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
-			
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);			
-		}
-		
-		private static const divTestMarkup:String = "<TextFlow whiteSpaceCollapse='preserve' xmlns='http://ns.adobe.com/textLayout/2008'><div><p><span>asd</span></p></div><p><span>asd</span></p></TextFlow>";
-
-		/**
-		 */
-		public function deleteAcrossDivBoundaryTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var selectFlow:TextFlow = TextConverter.importToFlow(divTestMarkup,TextConverter.TEXT_LAYOUT_FORMAT);
-			
-			var div:DivElement = selectFlow.getChildAt(0) as DivElement;
-			var para:ParagraphElement = selectFlow.getChildAt(1) as ParagraphElement;
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren, div.deepCopy());
-			tf.replaceChildren(1,tf.numChildren, para.deepCopy());
-			tf.flowComposer.updateAllControllers();
-			
-			var lenBefore:int = tf.textLength;
-
-			SelManager.selectRange(3,4);
-			EditManager(SelManager).deleteText();
-			
-			assertTrue("length didn't change after delete across div boundary!", tf.textLength != lenBefore);
-			
-		}
-
-		/**
-		 */
-		//Test for bug#2948473, we will not copy the containerBreakAfter, containerBreakBefore
-		//columnBreakAfter, columnBreakBefore attribute to the new paragraph
-		public function BreaksSplitTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			// a simple styled paragraph - always copy
-			var p:ParagraphElement = new ParagraphElement();
-			p.textAlign = TextAlign.LEFT;
-			p.columnBreakAfter = 'always';
-			p.columnBreakBefore = 'always';
-			p.containerBreakAfter = 'always';
-			p.containerBreakBefore = 'always';
-			var s:SpanElement = new SpanElement();
-			s.fontWeight = FontWeight.BOLD;
-			s.text = "Hello";
-			p.addChild(s);
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("BreaksSplitTest 1: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("BreaksSplitTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("BreaksSplitTest 1: p2 is incorrect after split",p2 && !TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1 && 
-				p2.columnBreakAfter == undefined &&
-				p2.columnBreakBefore == undefined &&
-				p2.containerBreakAfter == undefined &&
-				p2.containerBreakBefore == undefined);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("BreaksSplitTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("BreaksSplitTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("BreaksSplitTest 2: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("BreaksSplitTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("BreaksSplitTest 2: p2 is incorrect after split",p2 && !TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1 &&
-				p2.columnBreakAfter == undefined &&
-				p2.columnBreakBefore == undefined &&
-				p2.containerBreakAfter == undefined &&
-				p2.containerBreakBefore == undefined);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("BreaksSplitTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("BreaksSplitTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("BreaksSplitTest 3: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("BreaksSplitTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("BreaksSplitTest 3: p2 is incorrect after split",p2 && !TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1 &&
-				p2.columnBreakAfter == undefined &&
-				p2.columnBreakBefore == undefined &&
-				p2.containerBreakAfter == undefined &&
-				p2.containerBreakBefore == undefined);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("BreaksSplitTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("BreaksSplitTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		/**
-		 */
-		public function splitStyledParagraphTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			// a simple styled paragraph - always copy
-			var p:ParagraphElement = new ParagraphElement();
-			p.textAlign = TextAlign.LEFT;
-			var s:SpanElement = new SpanElement();
-			s.fontWeight = FontWeight.BOLD;
-			s.text = "Hello";
-			p.addChild(s);
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 1: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitParagraph();
-
-			assertTrue("splitStyledParagraphTest 2: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 3: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		
-		/**
-		 */
-		public function splitStyledAnchorTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			// a simple styled paragraph - always copy
-			var p:ParagraphElement = new ParagraphElement();
-			p.textAlign = TextAlign.LEFT;
-			var s:SpanElement = new SpanElement();
-			s.fontWeight = FontWeight.BOLD;
-			s.text = "Hello";
-			var a:LinkElement = new LinkElement();
-			a.fontSize = 18;
-			a.addChild(s);
-			p.addChild(a);
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 1: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 2: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 3: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-			s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-
-			assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		
-		private static const listItemMarkup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><list listStylePosition='inside'><li><p textAlign='left'><span fontWeight='bold'>item</span></p></li></list></TextFlow>";
-		/**
-		 */
-		public function splitStyledListItemTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			var listFlow:TextFlow = TextConverter.importToFlow(listItemMarkup,TextConverter.TEXT_LAYOUT_FORMAT);
-			var list:ListElement = listFlow.getChildAt(0) as ListElement;
-			
-			var s:SpanElement = list.getFirstLeaf() as SpanElement;
-			var p:ParagraphElement = s.parent as ParagraphElement;
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			var listCopy:ListElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			listCopy = list.deepCopy(0,list.textLength) as ListElement;
-			tf.replaceChildren(0,tf.numChildren,listCopy);
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
-			
-			assertTrue("splitStyledListItemTest 1: incorrect number of children after split",listCopy.numChildren == 2);
-			p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			
-			assertTrue("splitStyledListItemTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledListItemTest 1: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledListItemTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledListItemTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			listCopy = list.deepCopy(0,list.textLength) as ListElement;
-			tf.replaceChildren(0,tf.numChildren,listCopy);
-			tf.flowComposer.updateAllControllers();	
-			
-			
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
-			
-			assertTrue("splitStyledListItemTest 2: incorrect number of children after split",listCopy.numChildren == 2);
-			p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			
-			assertTrue("splitStyledListItemTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledListItemTest 2: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledListItemTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledListItemTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			listCopy = list.deepCopy(0,list.textLength) as ListElement;
-			tf.replaceChildren(0,tf.numChildren,listCopy);
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
-			
-			assertTrue("splitStyledListItemTest 3: incorrect number of children after split",listCopy.numChildren == 2);
-			p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			
-			assertTrue("splitStyledListItemTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledListItemTest 3: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledListItemTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledListItemTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		
-		public function spanElementReplaceTextInvalidPos():void
-		{
-			SelManager.selectAll();
-			SelManager.deleteText();
-			
-			var paragraph:ParagraphElement = new ParagraphElement();
-			var span:SpanElement = new SpanElement;
-			
-			span.text = "Does this text flow need to be composed?";
-			paragraph.addChild(span);
-			SelManager.textFlow.addChild(paragraph);         	
-			SelManager.textFlow.flowComposer.updateAllControllers();
-			span.replaceText(5, 9, "your");
-			if(SelManager.textFlow.flowComposer.getControllerAt(0).isDamaged())
-			{
-				span.text += " Yes it does.";
-			}
-		
-			//try to replace text at start point <0, should return error
-			try
-			{
-				span.replaceText(-1, 2, "your");
-			} catch(e:Error)
-			{
-				assertTrue ("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
-			}
-			//try to replace text at end point > text Length, should return error
-			try
-			{
-				var len:int = SelManager.textFlow.textLength;
-				span.replaceText(5, len + 1, "your");
-			} catch(e:Error)
-			{
-				assertTrue ("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
-			}
-			//try to replace text when end point < start point, should return error
-			try
-			{
-				span.replaceText(5, 3, "your");
-			} catch(e:Error)
-			{
-				assertTrue ("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
-			}
-			SelManager.textFlow.flowComposer.updateAllControllers();   
-		}
-		
-		public function copyErrorMassageTest():void
-		{
-			SelManager.selectAll();
-			SelManager.deleteText();
-			
-			var p:ParagraphElement = new ParagraphElement();
-			var span1:SpanElement = new SpanElement();
-			var span2:SpanElement = new SpanElement();
-			span1.text = "1水z𝄞#####%23456789"; //character 水z𝄞 to make badSurrogatePairCopy error
-			
-			try{
-				span2 = span1.shallowCopy(7, 6) as SpanElement;
-			}catch (e:Error)
-			{
-				assertTrue("Invalid error message for badShallowCopyRange", e.message = "Bad range in shallowCopy");
-			}
-			try{
-				span2 = span1.shallowCopy(2, 4) as SpanElement;
-			}catch (e:Error)
-			{
-				assertTrue("Invalid error message for badSurrogatePairCopy", e.message = "Copying only half of a surrogate pair in SpanElement.shallowCopy");
-			}
-			p.fontSize = 20;
-			p.addChild(span1);
-			p.addChild(span2);
-		
-			SelManager.textFlow.addChild(p);
-			SelManager.textFlow.flowComposer.updateAllControllers();   
-		}
-		
-		public function applyFormatToElementOperationFormatTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var styleName:String = "userStyleName";
-			var newStyleValue:String = "newUserStyleValue";
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.fontSize = 10;
-			format.setStyle(styleName,newStyleValue);
-			var op:ApplyFormatToElementOperation = new ApplyFormatToElementOperation(SelManager.getSelectionState(),tf,format);
-			//test format setter
-			format.fontSize = 20;
-			op.format = format;
-			SelManager.doOperation(op);
-			//test format getter
-			assertTrue("format font size is not set correctly", op.format.fontSize == 20 &&
-			           tf.getStyle(styleName) == "newUserStyleValue" );
-		}
-		
-		public function typeNameSetGetTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var newTypeName:String = "newTFTypeName1";
-			
-			var op:ApplyElementTypeNameOperation = new ApplyElementTypeNameOperation(SelManager.getSelectionState(),tf,newTypeName);
-			op.typeName = "newTFTypeName2";
-			SelManager.doOperation(op);
-			assertTrue("ApplyElementTypeNameOperation doesn't set or get correct typeName", op.typeName == "newTFTypeName2");
-		}
-	}
-}


[13/44] Add GeneralFunctionsTest

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/d92c169e/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as b/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
index 134f99c..fd022cb 100644
--- a/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
+++ b/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
@@ -18,33 +18,30 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	import UnitTest.Fixtures.TestEditManager;
-	
-	import flash.display.Sprite;
-	import flash.events.*;
-	import flash.text.engine.FontPosture;
-	import flash.text.engine.FontWeight;
-	import flash.ui.Keyboard;
-	import flash.utils.getDefinitionByName;
-	import flash.utils.getQualifiedClassName;
-	
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.conversion.ITextImporter;
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.*;
-	import flashx.textLayout.events.FlowOperationEvent;
-	import flashx.textLayout.events.SelectionEvent;
-	import flashx.textLayout.events.StatusChangeEvent;
-	import flashx.textLayout.formats.*;
-	import flashx.textLayout.operations.FlowOperation;
-	import flashx.textLayout.operations.UndoOperation;
-	import flashx.textLayout.tlf_internal;
-	import flashx.undo.UndoManager;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+    import UnitTest.Fixtures.TestEditManager;
+
+    import flash.display.Sprite;
+    import flash.events.*;
+    import flash.text.engine.FontPosture;
+    import flash.text.engine.FontWeight;
+    import flash.ui.Keyboard;
+    import flash.utils.getQualifiedClassName;
+
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.conversion.ITextImporter;
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.elements.*;
+    import flashx.textLayout.events.FlowOperationEvent;
+    import flashx.textLayout.events.SelectionEvent;
+    import flashx.textLayout.events.StatusChangeEvent;
+    import flashx.textLayout.formats.*;
+    import flashx.textLayout.operations.FlowOperation;
+    import flashx.textLayout.operations.UndoOperation;
+    import flashx.textLayout.tlf_internal;
+    import flashx.undo.UndoManager;
 
     import org.flexunit.asserts.assertTrue;
     import org.flexunit.asserts.fail;
@@ -52,1296 +49,1336 @@ package UnitTest.Tests
     use namespace tlf_internal;
 
 
- 	public class GeneralFunctionsTest extends VellumTestCase
-	{
-		public var SelectionChanged:Boolean;
-		private var callback:Boolean;
-
-		public function GeneralFunctionsTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super(methodName, testID, testConfig);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Editing";
-		}
-
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "arrowLeft", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "arrowRight", testConfig) );
-			//ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "arrowDown", testConfig) );
-			//ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "arrowUp", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "replaceSelectionTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "backSpaceSelectionTest", testConfig) ); // KJT
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "backSpaceInsertionPointTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "backSpaceLowerLimitTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "deleteSelectionTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "deleteInsertionPointTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "deleteUpperLimitTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "splitParagraphInsertionPointTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "splitParagraphSelectionTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "splitParagraphFormatTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "unDoOp", testConfig) ); // undo redo// KJT
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "setSelectionRangeTest", testConfig) );// select range and listen for change event // KJT
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "insertTextTest", testConfig) ); // KJT
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "joinedBackspaceUndoTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "joinedDeleteUndoTest", testConfig) );
-			/* Waiting for troubleshooting -*/ ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "joinedInsertUndoTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "joinedSplitParagraphUndoTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "undoLimitTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "transParagraphDeleteTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "emptyParagraphTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "splitUTF16Test", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "splitUTF32Test", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "undoWithModelChangeTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "doubleClickTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "doubleClickHyphenTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "doubleClickPunctuationTest", testConfig) );
-			ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "undoRedoStackTest", testConfig) );
-			if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-			{
-				ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "replaceChildrenFlowTest", testConfig) );
-				ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "resolveInlinesTest", testConfig) );
-				ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "nestingTest", testConfig) );
-				ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "errorThrowing", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor(GeneralFunctionsTest, "AllNestingTest", testConfig ) );
-			}
-		}
-
-		/**
-		* selecting text from 10 to 20
-		*/
-
-		public function selChange(e:Event):void //KJT selection change event method
-		{
-			SelectionChanged = true;
-		}
-
-		public function setSelectionRangeTest():void  //KJT  test selection range and change event
-		{
-			var startIndx:int = 800;
-			var endIndx:int = 933;
-			//trace('CALL SET SELECTION');
-
-			SelManager.textFlow.addEventListener(SelectionEvent.SELECTION_CHANGE, selChange, false, 0, true);
-			SelManager.selectRange(startIndx,endIndx);
-
-			assertTrue("beginning index should be 800, but is " + SelManager.anchorPosition,
-						SelManager.anchorPosition == 800);
-			assertTrue("end index should be 933, but is " + SelManager.activePosition,
-						SelManager.activePosition == 933);
-			assertTrue("SelectionChanged returned false", SelectionChanged == true);
-		}
-		/**
- 		 * Select 40 characters and replaces them with new text
- 		 */
-		public function replaceSelectionTest():void
-		{
-			var startIndx:int = 10;
-			var endIndx:int = 50;
-
-			var attributes:TextLayoutFormat  = new TextLayoutFormat();
-			attributes.fontWeight = FontWeight.BOLD;
-			attributes.lineThrough = true;
-
-			SelManager.selectRange(startIndx,endIndx);
-			SelManager.applyLeafFormat(attributes);
-
-			SelManager.insertText("New");
-			SelManager.flushPendingOperations();
-
-			var leaf:FlowLeafElement = SelManager.textFlow.findLeaf(startIndx);
-			var attributesNew:ITextLayoutFormat = leaf.format;
-			assertTrue("Invalid point format after block deletion", TextLayoutFormat.isEqual(attributes, attributesNew));
-		}
-		/**
- 		 * Select 40 characters and delete them.
- 		 */
-		public function backSpaceSelectionTest():void
-		{
-			var startIndx:int = 10;
-			var endIndx:int = 50;
-
-			var attributes:TextLayoutFormat  = new TextLayoutFormat();
-			attributes.fontWeight = FontWeight.BOLD;
-			attributes.lineThrough = true;
-
-			SelManager.selectRange(startIndx,endIndx);
-			SelManager.applyLeafFormat(attributes);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-			SelManager.deletePreviousCharacter();
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("deleting the selection should have removed " +(endIndx - startIndx) +
-						" characters.  It actually removed " + (initLength - endLength),
-						endLength == initLength - (endIndx - startIndx) );
-
-			SelManager.insertText("New");
-			SelManager.flushPendingOperations();
-
-			var leaf:FlowLeafElement = SelManager.textFlow.findLeaf(startIndx);
-			var attributesNew:ITextLayoutFormat = leaf.format;
-			assertTrue("Invalid point format after block deletion", TextLayoutFormat.isEqual(attributes, attributesNew));
-		}
-
-		/**
- 		 * Set the cursor position back ten characters and delete the first ten characters.
- 		 */
-		public function backSpaceInsertionPointTest():void
-		{
-			var n:int = 10;
-			SelManager.selectRange(n,n);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i < n; i++){
-				SelManager.deletePreviousCharacter();
-			}
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("should have removed " + n + " characters.  Actually removed " +
-						(initLength - endLength) , endLength == initLength - n);
-		}
-
-		/**
- 		 * Set the cursor position back nine characters and delete the first ten characters.
- 		 * Ensure that only nine characters are deleted.
- 		 */
-		public function backSpaceLowerLimitTest():void
-		{
-			var n:int = 9;
-			SelManager.selectRange(n,n);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i <= n; i++){
-				SelManager.deletePreviousCharacter();
-			}
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("should have removed " + n + " characters.  Actually removed " +
-						(initLength - endLength) , endLength == initLength - n);
-		}
-
-		/**
- 		 * Select 40 characters and delete them.
- 		 */
-		public function deleteSelectionTest():void
-		{
-			var startIndx:int = 10;
-			var endIndx:int = 50;
-
-			SelManager.selectRange(startIndx,endIndx);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-			SelManager.deleteNextCharacter();
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("should have removed " + (endIndx - startIndx) + " characters.  Actually removed " +
-						(initLength - endLength) , endLength == initLength - (endIndx - startIndx) );
-		}
-
-		/**
- 		 * Delete the first ten characters.
- 		 */
-		public function deleteInsertionPointTest():void
-		{
-			var n:int = 10;
-			SelManager.selectRange(0,0);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i < n; i++){
-				SelManager.deleteNextCharacter();
-			}
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("should have removed " + n + " characters.  Actually removed " +
-						(initLength - endLength), endLength == initLength - n);
-		}
-
-		/**
- 		 * Set the cursor position back nine characters and delete the first ten characters.
- 		 * Ensure that only nine characters are deleted.
- 		 */
-		public function deleteUpperLimitTest():void
-		{
-			var n:int = 9;
-
-			var initLength:uint = SelManager.textFlow.textLength;
-			SelManager.selectRange(initLength - (n+1), initLength - (n+1));
-
-			for(var i:int = 0; i < n; i++){
-				SelManager.deleteNextCharacter();
-			}
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("should have removed " + n + " characters.  Actually removed " +
-						(initLength - endLength) , endLength == initLength - n);
-		}
+    public class GeneralFunctionsTest extends VellumTestCase
+    {
+        public static const childParentTable:Array =
+                [
+                    [ "child\parent", TextFlow, DivElement, ParagraphElement, LinkElement, TCYElement, SpanElement, InlineGraphicElement, BreakElement, TabElement, ListElement, ListItemElement, SubParagraphGroupElement ],
+                    [ TextFlow, "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no" ],
+                    [ DivElement, "yes", "yes", "no", "no", "no", "no", "no", "no", "no", "yes", "yes", "no" ],
+                    [ ParagraphElement, "yes", "yes", "no", "no", "no", "no", "no", "no", "no", "yes", "yes", "no" ],
+                    [ LinkElement, "no", "no", "yes", "no", "yes", "no", "no", "no", "no", "no", "no", "yes" ],
+                    [ TCYElement, "no", "no", "yes", "yes", "no", "no", "no", "no", "no", "no", "no", "yes" ],
+                    [ SpanElement, "no", "no", "yes", "yes", "yes", "no", "no", "no", "no", "no", "no", "yes" ],
+                    [ InlineGraphicElement, "no", "no", "yes", "yes", "yes", "no", "no", "no", "no", "no", "no", "yes" ],
+                    [ BreakElement, "no", "no", "yes", "yes", "yes", "no", "no", "no", "no", "no", "no", "yes" ],
+                    [ TabElement, "no", "no", "yes", "yes", "yes", "no", "no", "no", "no", "no", "no", "yes" ],
+                    [ ListElement, "yes", "yes", "no", "no", "no", "no", "no", "no", "no", "yes", "yes", "no" ],
+                    [ ListItemElement, "no", "no", "no", "no", "no", "no", "no", "no", "no", "yes", "no", "no" ],
+                    [ SubParagraphGroupElement, "no", "no", "yes", "yes", "yes", "no", "no", "no", "no", "no", "no", "yes" ]
+                ];
+
+        private static const customResourceDict:Object =
+        {
+            invalidFlowElementConstruct_custom: "Attempted construct of invalid FlowElement subclass",
+            badMXMLChildrenArgument_custom: "Bad element of type {0} passed to mxmlChildren",
+            malformedTag: "Malformed tag </p/>",
+            XMLParserFailure: "TypeError: Error #1090: XML parser failure: element is malformed."
+        };
+
+        /**
+         * pick up the actual operation
+         */
+        private var flowOp:FlowOperation;
+        private var SelectionChanged:Boolean;
+        private var ilgStatus:String;
+
+        public function GeneralFunctionsTest()
+        {
+            super("", "EventOverrideTest", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Editing";
+        }
+
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+
+        [Test]
+        public function setSelectionRangeTest():void  //KJT  test selection range and change event
+        {
+            var startIndx:int = 800;
+            var endIndx:int = 933;
+            //trace('CALL SET SELECTION');
+
+            SelManager.textFlow.addEventListener(SelectionEvent.SELECTION_CHANGE, selChange, false, 0, true);
+            SelManager.selectRange(startIndx, endIndx);
+
+            assertTrue("beginning index should be 800, but is " + SelManager.anchorPosition,
+                    SelManager.anchorPosition == 800);
+            assertTrue("end index should be 933, but is " + SelManager.activePosition,
+                    SelManager.activePosition == 933);
+            assertTrue("SelectionChanged returned false", SelectionChanged == true);
+        }
+
+        [Test]
+        /**
+         * Select 40 characters and replaces them with new text
+         */
+        public function replaceSelectionTest():void
+        {
+            var startIndx:int = 10;
+            var endIndx:int = 50;
+
+            var attributes:TextLayoutFormat = new TextLayoutFormat();
+            attributes.fontWeight = FontWeight.BOLD;
+            attributes.lineThrough = true;
+
+            SelManager.selectRange(startIndx, endIndx);
+            SelManager.applyLeafFormat(attributes);
+
+            SelManager.insertText("New");
+            SelManager.flushPendingOperations();
+
+            var leaf:FlowLeafElement = SelManager.textFlow.findLeaf(startIndx);
+            var attributesNew:ITextLayoutFormat = leaf.format;
+            assertTrue("Invalid point format after block deletion", TextLayoutFormat.isEqual(attributes, attributesNew));
+        }
+
+        [Test]
+        /**
+         * Select 40 characters and delete them.
+         */
+        public function backSpaceSelectionTest():void
+        {
+            var startIndx:int = 10;
+            var endIndx:int = 50;
+
+            var attributes:TextLayoutFormat = new TextLayoutFormat();
+            attributes.fontWeight = FontWeight.BOLD;
+            attributes.lineThrough = true;
+
+            SelManager.selectRange(startIndx, endIndx);
+            SelManager.applyLeafFormat(attributes);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+            SelManager.deletePreviousCharacter();
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("deleting the selection should have removed " + (endIndx - startIndx) +
+                    " characters.  It actually removed " + (initLength - endLength),
+                    endLength == initLength - (endIndx - startIndx));
+
+            SelManager.insertText("New");
+            SelManager.flushPendingOperations();
+
+            var leaf:FlowLeafElement = SelManager.textFlow.findLeaf(startIndx);
+            var attributesNew:ITextLayoutFormat = leaf.format;
+            assertTrue("Invalid point format after block deletion", TextLayoutFormat.isEqual(attributes, attributesNew));
+        }
+
+        [Test]
+        /**
+         * Set the cursor position back ten characters and delete the first ten characters.
+         */
+        public function backSpaceInsertionPointTest():void
+        {
+            var n:int = 10;
+            SelManager.selectRange(n, n);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+            for (var i:int = 0; i < n; i++)
+            {
+                SelManager.deletePreviousCharacter();
+            }
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("should have removed " + n + " characters.  Actually removed " +
+                    (initLength - endLength), endLength == initLength - n);
+        }
+
+        [Test]
+        /**
+         * Set the cursor position back nine characters and delete the first ten characters.
+         * Ensure that only nine characters are deleted.
+         */
+        public function backSpaceLowerLimitTest():void
+        {
+            var n:int = 9;
+            SelManager.selectRange(n, n);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+            for (var i:int = 0; i <= n; i++)
+            {
+                SelManager.deletePreviousCharacter();
+            }
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("should have removed " + n + " characters.  Actually removed " +
+                    (initLength - endLength), endLength == initLength - n);
+        }
+
+        [Test]
+        /**
+         * Select 40 characters and delete them.
+         */
+        public function deleteSelectionTest():void
+        {
+            var startIndx:int = 10;
+            var endIndx:int = 50;
+
+            SelManager.selectRange(startIndx, endIndx);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+            SelManager.deleteNextCharacter();
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("should have removed " + (endIndx - startIndx) + " characters.  Actually removed " +
+                    (initLength - endLength), endLength == initLength - (endIndx - startIndx));
+        }
+
+        [Test]
+        /**
+         * Delete the first ten characters.
+         */
+        public function deleteInsertionPointTest():void
+        {
+            var n:int = 10;
+            SelManager.selectRange(0, 0);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+            for (var i:int = 0; i < n; i++)
+            {
+                SelManager.deleteNextCharacter();
+            }
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("should have removed " + n + " characters.  Actually removed " +
+                    (initLength - endLength), endLength == initLength - n);
+        }
+
+        [Test]
+        /**
+         * Set the cursor position back nine characters and delete the first ten characters.
+         * Ensure that only nine characters are deleted.
+         */
+        public function deleteUpperLimitTest():void
+        {
+            var n:int = 9;
+
+            var initLength:uint = SelManager.textFlow.textLength;
+            SelManager.selectRange(initLength - (n + 1), initLength - (n + 1));
+
+            for (var i:int = 0; i < n; i++)
+            {
+                SelManager.deleteNextCharacter();
+            }
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("should have removed " + n + " characters.  Actually removed " +
+                    (initLength - endLength), endLength == initLength - n);
+        }
+
+        [Test]
+        /**
+         * Splits the paragraph after the first fifty characters.
+         * Verifies that there is one more line in the textFlow than it started with.
+         * Verifies that the first leaf has only 50 characters in it.
+         */
+        public function splitParagraphInsertionPointTest():void
+        {
+            var insertPoint:int = 50;
+
+            SelManager.selectRange(insertPoint, insertPoint);
+
+            var initLines:int = SelManager.textFlow.flowComposer.numLines;
+            SelManager.splitParagraph();
+            var endLines:int = SelManager.textFlow.flowComposer.numLines;
+
+            assertTrue("expected one additional line after splitting the paragraph.  Actually found " +
+                    (endLines - initLines), initLines = endLines - 1);
+
+            var lengthFirst:int = SelManager.textFlow.getFirstLeaf().textLength;
+
+            assertTrue("expected the first paragraph would have " + insertPoint +
+                    " characters.  Actually found " + lengthFirst, lengthFirst = insertPoint);
+        }
+
+        [Test]
+        /**
+         * 1. Sets attributes before (A, B), after (B', C) and at (B'', D) at split point.
+         * Splits paragraphs, adds new text and verifies that it has attributes (A, B'', C, D)
+         * 2. Tests special case for splitting a paragraph at the end of a link; point format is reset in this case
+         */
+        public function splitParagraphFormatTest():void
+        {
+            var insertPoint:int = 50;
+
+            var attributes:TextLayoutFormat = new TextLayoutFormat();
+
+            attributes.fontWeight = FontWeight.BOLD;
+            attributes.lineThrough = true;
+            SelManager.selectRange(insertPoint - 5, insertPoint);
+            SelManager.applyLeafFormat(attributes);
+
+            attributes.fontWeight = undefined;
+            attributes.textDecoration = TextDecoration.UNDERLINE;
+            attributes.fontSize = 72;
+            SelManager.selectRange(insertPoint, insertPoint + 5);
+            SelManager.applyLeafFormat(attributes);
+
+            attributes.textDecoration = TextDecoration.UNDERLINE;
+            attributes.lineThrough = true;
+            attributes.fontFamily = "Verdana";
+            SelManager.selectRange(insertPoint, insertPoint);
+            SelManager.applyLeafFormat(attributes);
+
+            SelManager.splitParagraph();
+
+            SelManager.insertText("New");
+            SelManager.flushPendingOperations();
+
+            var leaf:FlowLeafElement = SelManager.textFlow.findLeaf(insertPoint + 1);
+            attributes = new TextLayoutFormat(leaf.format);
+
+            assertTrue("Invalid point format for start of a new paragraph", attributes.fontWeight = FontWeight.BOLD);
+            assertTrue("Invalid point format for start of a new paragraph", attributes.fontSize = 72);
+            assertTrue("Invalid point format for start of a new paragraph", attributes.fontFamily = "Verdana");
+            assertTrue("Invalid point format for start of a new paragraph", attributes.textDecoration == TextDecoration.UNDERLINE && attributes.lineThrough);
+
+            insertPoint = 40;
+
+            SelManager.selectRange(insertPoint - 10, insertPoint);
+            SelManager.applyLink("http://www.google.com", "_self", false);
+
+            SelManager.selectRange(insertPoint, insertPoint);
+            SelManager.splitParagraph();
+
+            SelManager.insertText("New");
+            SelManager.flushPendingOperations();
+
+            leaf = SelManager.textFlow.findLeaf(insertPoint + 1);
+            attributes = new TextLayoutFormat(leaf.format);
+            assertTrue("Invalid point format for start of a new paragraph after a link", TextLayoutFormat.isEqual(attributes, TextLayoutFormat.emptyTextLayoutFormat));
+        }
+
+        [Test]
+        /**
+         * Selects the characters between the 10th and 50th characters and splits the paragraph.
+         * Verifies that there is one more line in the textFlow than it started with.
+         * Verifies that the first leaf has only 10 characters in it.
+         * Verifies that the final length has 39 less characters in it.
+         */
+        public function splitParagraphSelectionTest():void
+        {
+            var startIndx:int = 10;
+            var endIndx:int = 50;
+
+
+            SelManager.selectRange(startIndx, endIndx);
+
+            var initLength:int = SelManager.textFlow.textLength;
+            var initLines:int = SelManager.textFlow.flowComposer.numLines;
+
+            SelManager.splitParagraph();
+
+            var endLength:int = SelManager.textFlow.textLength;
+            var endLines:int = SelManager.textFlow.flowComposer.numLines;
+
+            assertTrue("expected one additional line after splitting the paragraph.  Actually found " +
+                    (endLines - initLines), initLines = endLines - 1);
+
+            var lengthFirst:int = SelManager.textFlow.getFirstLeaf().textLength;
+
+            assertTrue("expected the first paragraph would have " + startIndx +
+                    " characters.  Actually found " + lengthFirst, lengthFirst = startIndx);
+            assertTrue("expected the entire flow would have " + (initLength - (endIndx - startIndx) + 1) +
+                    " characters.  Actually found " + endLength,
+                    endLength == initLength - (endIndx - startIndx) + 1);
+        }
+
+        [Test]
+        /**
+         * Creates a selection area of six characters at the last index of the flow root
+         * then inserts " BOOGA" into the selection area and verifies the length of the
+         * flow root has increased by 6.
+         */
+        public function insertTextTest():void //KJT
+        {
+            var textLength:uint = SelManager.textFlow.textLength;
+            SelManager.selectRange(textLength - 1, textLength + 5);
+
+            SelManager.insertText(" BOOGA");
+            SelManager.selectRange(textLength - 1, textLength + 5);
+
+            assertTrue("expected to find " + (textLength + 6) + " characters.  Actually found " +
+                    SelManager.textFlow.textLength, SelManager.textFlow.textLength == textLength + 6);
+        }
+
+        [Test]
+        /**
+         * Sets the insertion point at 50, then generates the "0" keyboard event
+         * and verifies that the selBegIdx is 49.
+         */
+        public function arrowLeft():void
+        {
+            var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.LEFT);
+            SelManager.selectRange(50, 50);
+            SelManager.keyDownHandler(event);
+
+            if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL)
+            {
+                //				assertTrue("expected insertion point at position 87. Actually found + " +
+                //	    				SelManager.anchorPosition, SelManager.anchorPosition == 87);
+            }
+            else
+            {
+                if (SelManager.textFlow.computedFormat.direction == Direction.LTR)
+                {
+                    assertTrue("expected insertion point at position 49. Actually found + " +
+                            SelManager.activePosition, SelManager.activePosition == 49);
+                }
+                else
+                {
+                    assertTrue("expected insertion point at position 51. Actually found + " +
+                            SelManager.activePosition, SelManager.activePosition == 51);
+                }
+            }
+        }
+
+        [Test]
+        /**
+         * Sets the insertion point at 50, then generates the "0" keyboard event
+         * and verifies that the selBegIdx is 51.
+         */
+        public function arrowRight():void
+        {
+            var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.RIGHT);
+            SelManager.selectRange(50, 50);
+            SelManager.keyDownHandler(event);
+            if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL)
+            {
+                //				assertTrue("expected insertion point at position 11. Actually found + " +
+                //	    				SelManager.anchorPosition, SelManager.anchorPosition == 11);
+            }
+            else
+            {
+                if (SelManager.textFlow.computedFormat.direction == Direction.LTR)
+                {
+                    assertTrue("expected insertion point at position 51. Actually found " +
+                            SelManager.activePosition, SelManager.activePosition == 51);
+                }
+                else
+                {
+                    assertTrue("expected insertion point at position 49. Actually found " +
+                            SelManager.activePosition, SelManager.activePosition == 49);
+                }
+            }
+        }
+
+        [Test]
+        /**
+         * Sets the insertion point at 0, then generates the "40" keyboard event
+         * and verifies that the cursor is on the second line.
+         */
+        public function arrowDown():void
+        {
+            var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 40);
+            SelManager.selectRange(0, 0);
+            SelManager.keyDownHandler(event);
+            if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+            {
+                //NYI
+            }
+            else
+            {
+                var ap:int = SelManager.activePosition;
+                var index:int = SelManager.textFlow.findChildIndexAtPosition(ap);
+                assertTrue("expected index at 2. Actually found " + index, index == 2);
+            }
+        }
+
+        [Test]
+        /**
+         * Sets the insertion point at the last char, then generates the "38" keyboard event
+         * and verifies that the cursor is on the second to last line.
+         */
+        public function arrowUp():void
+        {
+            var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 38);
+            var lastChar:int = SelManager.absoluteEnd;
+            var lastLine:int = SelManager.textFlow.findChildIndexAtPosition(lastChar);
+            SelManager.selectRange(lastChar, lastChar);
+            SelManager.keyDownHandler(event);
+            if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+            {
+                //NYI
+            }
+            else
+            {
+                var index:int = SelManager.textFlow.findChildIndexAtPosition(SelManager.activePosition);
+                assertTrue("expected index at " + (lastChar - 1) +
+                        ". Actually found " + index,
+                        index == (lastChar - 1)
+                );
+            }
+        }
+
+        [Test]
+        /**
+         * Tests the undo and redo stacks by applying typeface changes by undoing
+         * and redoing them.
+         */
+        public function unDoOp():void  //KJT
+        {
+            var ca:TextLayoutFormat = new TextLayoutFormat();
+            ca.fontWeight = FontWeight.BOLD;
+            SelManager.applyLeafFormat(ca);
+
+            SelManager.undo();
+            Redo();
+
+            ca.fontStyle = FontPosture.ITALIC;
+            SelManager.applyLeafFormat(ca);
+
+            SelManager.undo();
+            SelManager.undo();
+        }
+
+        [Test]
+        /**
+         * Performs successive backspaces and one undo to see if all the deleted content
+         * is returned, then performs a redo to see if the content is correctly removed
+         * again.
+         */
+        public function joinedBackspaceUndoTest():void
+        {
+            var n:int = 10;
+            SelManager.selectRange(10, 10);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+            for (var i:int = 0; i < n; i++)
+            {
+                var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8);
+                dispatchEvent(event);
+            }
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            SelManager.undo();
+
+            var undoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected text length before undo to be " + n + " less.  Was actually " +
+                    (endLength - initLength) + " less.", endLength == initLength - n);
+            assertTrue("expected text length after undo to be identical to the start, but it was off by " +
+                    (undoLength - initLength), undoLength == initLength);
+
+            Redo();
+
+            var redoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected redo length to equal undo length, but found " +
+                    redoLength + " and " + endLength, redoLength == endLength);
+        }
+
+        [Test]
+        /**
+         * Performs successive deletes and one undo to see if all the deleted content
+         * is returned, then performs a redo to see if the content is correctly removed
+         * again.
+         */
+        public function joinedDeleteUndoTest():void
+        {
+            var n:int = 10;
+            SelManager.selectRange(10, 10);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+            for (var i:int = 0; i < n; i++)
+            {
+                var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 127, Keyboard.DELETE);
+                dispatchEvent(event);
+            }
+            SelManager.flushPendingOperations();
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            SelManager.undo();
+
+            var undoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected text length before undo to be " + n + " less.  Was actually " +
+                    (endLength - initLength) + " less.", endLength == initLength - n);
+            assertTrue("expected text length after undo to be identical to the start, but it was off by " +
+                    (undoLength - initLength), undoLength == initLength);
+
+            Redo();
+
+            var redoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected redo length to equal undo length, but found " +
+                    redoLength + " and " + endLength, redoLength == endLength);
+        }
+
+        [Test]
+        /**
+         * Places a series of letter a's in and does one undo to see if all the a's
+         * are removed, then performs a redo to see if they're returned.
+         */
+        public function joinedInsertUndoTest():void
+        {
+            var n:int = 10;
+            SelManager.selectRange(10, 10);
+
+            var initLength:uint = SelManager.textFlow.textLength;
 
-		/**
-		 * Splits the paragraph after the first fifty characters.
-		 * Verifies that there is one more line in the textFlow than it started with.
-		 * Verifies that the first leaf has only 50 characters in it.
-		 */
-		public function splitParagraphInsertionPointTest():void
-		{
-			var insertPoint:int = 50;
-
-			SelManager.selectRange(insertPoint, insertPoint);
-
-			var initLines:int = SelManager.textFlow.flowComposer.numLines;
-			SelManager.splitParagraph();
-			var endLines:int = SelManager.textFlow.flowComposer.numLines;
-
-			assertTrue("expected one additional line after splitting the paragraph.  Actually found " +
-						(endLines - initLines), initLines = endLines - 1);
-
-			var lengthFirst:int = SelManager.textFlow.getFirstLeaf().textLength;
-
-			assertTrue("expected the first paragraph would have " + insertPoint +
-						" characters.  Actually found " + lengthFirst, lengthFirst = insertPoint);
-		}
-
-		/**
-		 * 1. Sets attributes before (A, B), after (B', C) and at (B'', D) at split point.
-		 * Splits paragraphs, adds new text and verifies that it has attributes (A, B'', C, D)
-	     * 2. Tests special case for splitting a paragraph at the end of a link; point format is reset in this case
-		 */
-		public function splitParagraphFormatTest():void
-		{
-			var insertPoint:int = 50;
-
-			var attributes:TextLayoutFormat  = new TextLayoutFormat();
-
-			attributes.fontWeight = FontWeight.BOLD;
-			attributes.lineThrough = true;
-			SelManager.selectRange(insertPoint-5, insertPoint);
-			SelManager.applyLeafFormat(attributes);
-
-			attributes.fontWeight = undefined;
-			attributes.textDecoration = flashx.textLayout.formats.TextDecoration.UNDERLINE;
-			attributes.fontSize = 72;
-			SelManager.selectRange(insertPoint, insertPoint+5);
-			SelManager.applyLeafFormat(attributes);
-
-			attributes.textDecoration = flashx.textLayout.formats.TextDecoration.UNDERLINE;
-			attributes.lineThrough = true;
-			attributes.fontFamily = "Verdana";
-			SelManager.selectRange(insertPoint, insertPoint);
-			SelManager.applyLeafFormat(attributes);
-
-			SelManager.splitParagraph();
-
-			SelManager.insertText("New");
-			SelManager.flushPendingOperations();
-
-			var leaf:FlowLeafElement = SelManager.textFlow.findLeaf(insertPoint+1);
-			attributes = new TextLayoutFormat(leaf.format);
-
-			assertTrue("Invalid point format for start of a new paragraph", attributes.fontWeight = FontWeight.BOLD);
-			assertTrue("Invalid point format for start of a new paragraph", attributes.fontSize = 72);
-			assertTrue("Invalid point format for start of a new paragraph", attributes.fontFamily = "Verdana");
-			assertTrue("Invalid point format for start of a new paragraph", attributes.textDecoration == flashx.textLayout.formats.TextDecoration.UNDERLINE && attributes.lineThrough);
-
-			insertPoint = 40;
-
-			SelManager.selectRange(insertPoint-10, insertPoint);
-			SelManager.applyLink("http://www.google.com", "_self", false);
-
-			SelManager.selectRange(insertPoint, insertPoint);
-			SelManager.splitParagraph();
-
-			SelManager.insertText("New");
-			SelManager.flushPendingOperations();
-
-			leaf = SelManager.textFlow.findLeaf(insertPoint+1);
-			attributes = new TextLayoutFormat(leaf.format);
-			assertTrue("Invalid point format for start of a new paragraph after a link", TextLayoutFormat.isEqual(attributes, TextLayoutFormat.emptyTextLayoutFormat));
-		}
-
-		/**
-		 * Selects the characters between the 10th and 50th characters and splits the paragraph.
-		 * Verifies that there is one more line in the textFlow than it started with.
-		 * Verifies that the first leaf has only 10 characters in it.
-		 * Verifies that the final length has 39 less characters in it.
-		 */
-		public function splitParagraphSelectionTest():void
-		{
-			var startIndx:int = 10;
-			var endIndx:int = 50;
-
-
-			SelManager.selectRange(startIndx, endIndx);
-
-			var initLength:int = SelManager.textFlow.textLength;
-			var initLines:int = SelManager.textFlow.flowComposer.numLines;
-
-			SelManager.splitParagraph();
-
-			var endLength:int = SelManager.textFlow.textLength;
-			var endLines:int = SelManager.textFlow.flowComposer.numLines;
-
-			assertTrue("expected one additional line after splitting the paragraph.  Actually found " +
-						(endLines - initLines), initLines = endLines - 1);
-
-			var lengthFirst:int = SelManager.textFlow.getFirstLeaf().textLength;
-
-			assertTrue("expected the first paragraph would have " + startIndx +
-						" characters.  Actually found " + lengthFirst, lengthFirst = startIndx);
-			assertTrue("expected the entire flow would have " + (initLength - (endIndx - startIndx) + 1) +
-						" characters.  Actually found " + endLength,
-						endLength == initLength - (endIndx - startIndx) + 1);
-		}
-
-		/**
-		 * Creates a selection area of six characters at the last index of the flow root
-		 * then inserts " BOOGA" into the selection area and verifies the length of the
-		 * flow root has increased by 6.
-		 */
-		public function insertTextTest():void //KJT
-		{
-			var textLength:uint = SelManager.textFlow.textLength;
-			SelManager.selectRange(textLength - 1, textLength + 5);
-
-			SelManager.insertText(" BOOGA");
-			SelManager.selectRange(textLength - 1,textLength + 5);
-
-		 	assertTrue("expected to find " + (textLength + 6) + " characters.  Actually found " +
-		 				SelManager.textFlow.textLength, SelManager.textFlow.textLength == textLength + 6);
-		}
-
-		/**
-		 * Sets the insertion point at 50, then generates the "0" keyboard event
-		 * and verifies that the selBegIdx is 49.
-		 */
-		public function arrowLeft():void
-		{
-			var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.LEFT);
-			SelManager.selectRange(50,50);
-			SelManager.keyDownHandler(event);
-
-			if(SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL)
-			{
-//				assertTrue("expected insertion point at position 87. Actually found + " +
-//	    				SelManager.anchorPosition, SelManager.anchorPosition == 87);
-			}
-			else
-	    		{
-	    			if(SelManager.textFlow.computedFormat.direction == Direction.LTR)
-	    			{
-	    				assertTrue("expected insertion point at position 49. Actually found + " +
-	    				SelManager.activePosition, SelManager.activePosition == 49);
-	    			}
-	    			else
-	    			{
-	    				assertTrue("expected insertion point at position 51. Actually found + " +
-	    				SelManager.activePosition, SelManager.activePosition == 51);
-	    			}
-	    		}
-		}
-
-		/**
-		 * Sets the insertion point at 50, then generates the "0" keyboard event
-		 * and verifies that the selBegIdx is 51.
-		 */
-		public function arrowRight():void
-		{
-			var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.RIGHT);
-			SelManager.selectRange(50,50);
-			SelManager.keyDownHandler(event);
-			if(SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL)
-			{
-//				assertTrue("expected insertion point at position 11. Actually found + " +
-//	    				SelManager.anchorPosition, SelManager.anchorPosition == 11);
-			}
-			else
-    		{
-    			if(SelManager.textFlow.computedFormat.direction == Direction.LTR)
-    			{
-	    			assertTrue("expected insertion point at position 51. Actually found " +
-	    				SelManager.activePosition, SelManager.activePosition == 51);
-    			}
-    			else
-    			{
-    				assertTrue("expected insertion point at position 49. Actually found " +
-	    				SelManager.activePosition, SelManager.activePosition == 49);
-    			}
-    		}
-		}
-
-		/**
-		 * Sets the insertion point at 0, then generates the "40" keyboard event
-		 * and verifies that the cursor is on the second line.
-		 */
-		public function arrowDown():void
-		{
-			var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false,40);
-			SelManager.selectRange(0,0);
-			SelManager.keyDownHandler(event);
-			if(SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
-			{
-				//NYI
-			}
-			else
-    		{
-    			var ap:int = SelManager.activePosition;
-    			var index:int = SelManager.textFlow.findChildIndexAtPosition(ap);
-    			assertTrue("expected index at 2. Actually found " + index, index == 2);
-    		}
-		}
-
-		/**
-		 * Sets the insertion point at the last char, then generates the "38" keyboard event
-		 * and verifies that the cursor is on the second to last line.
-		 */
-		public function arrowUp():void
-		{
-			var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_UP, true, false,38);
-			var lastChar:int = SelManager.absoluteEnd;
-			var lastLine:int = SelManager.textFlow.findChildIndexAtPosition(lastChar);
-			SelManager.selectRange(lastChar,lastChar);
-			SelManager.keyDownHandler(event);
-			if(SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
-			{
-				//NYI
-			}
-			else
-    		{
-    			var index:int = SelManager.textFlow.findChildIndexAtPosition(SelManager.activePosition);
-    			assertTrue("expected index at " + (lastChar - 1) +
-    						". Actually found " + index,
-    						index == (lastChar - 1)
-    			);
-    		}
-		}
-
-		/**
- 		 * Tests the undo and redo stacks by applying typeface changes by undoing
- 		 * and redoing them.
- 		 */
-		public function unDoOp():void  //KJT
-		{
-			var ca:TextLayoutFormat = new TextLayoutFormat();
-			ca.fontWeight = FontWeight.BOLD;
-			SelManager.applyLeafFormat(ca);
-
-			SelManager.undo();
-			Redo();
-
-			ca.fontStyle = FontPosture.ITALIC;
-			SelManager.applyLeafFormat(ca);
-
-			SelManager.undo();
-			SelManager.undo();
-		}
-
-		/**
-		 * Performs successive backspaces and one undo to see if all the deleted content
-		 * is returned, then performs a redo to see if the content is correctly removed
-		 * again.
-		 */
-		public function joinedBackspaceUndoTest():void
-		{
-			var n:int = 10;
-			SelManager.selectRange(10,10);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i < n; i++){
-				var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8);
-				dispatchEvent(event);
-			}
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			SelManager.undo();
-
-			var undoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected text length before undo to be " + n + " less.  Was actually " +
-						(endLength - initLength) + " less.", endLength == initLength - n );
-			assertTrue("expected text length after undo to be identical to the start, but it was off by " +
-						(undoLength-initLength), undoLength == initLength);
-
-			Redo();
-
-			var redoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected redo length to equal undo length, but found " +
-						redoLength + " and " + endLength, redoLength == endLength);
-		}
-
-		/**
-		 * Performs successive deletes and one undo to see if all the deleted content
-		 * is returned, then performs a redo to see if the content is correctly removed
-		 * again.
-		 */
-		public function joinedDeleteUndoTest():void
-		{
-			var n:int = 10;
-			SelManager.selectRange(10,10);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i < n; i++){
-				var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 127, Keyboard.DELETE);
-				dispatchEvent(event);
-			}
-			SelManager.flushPendingOperations();
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			SelManager.undo();
-
-			var undoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected text length before undo to be " + n + " less.  Was actually " +
-						(endLength - initLength) + " less.", endLength == initLength - n );
-			assertTrue("expected text length after undo to be identical to the start, but it was off by " +
-						(undoLength-initLength), undoLength == initLength);
-
-			Redo();
-
-			var redoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected redo length to equal undo length, but found " +
-						redoLength + " and " + endLength, redoLength == endLength);
-		}
-
-		/**
-		 * Places a series of letter a's in and does one undo to see if all the a's
-		 * are removed, then performs a redo to see if they're returned.
-		 */
-		public function joinedInsertUndoTest():void
-		{
-			var n:int = 10;
-			SelManager.selectRange(10,10);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i < n; i++){
-				var event:TextEvent = new TextEvent(TextEvent.TEXT_INPUT,false,false,"a");
-				dispatchEvent(event);
-			}
-
-			SelManager.flushPendingOperations();
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			SelManager.undo();
-
-			var undoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected text length before undo to be " + n + " more.  Was actually " +
-						(endLength - initLength) + " less.", endLength == initLength + n );
-			assertTrue("expected text length after undo to be identical to the start, but it was off by " +
-						(undoLength-initLength), undoLength == initLength);
-			Redo();
-
-			var redoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected redo length to equal undo length, but found " +
-						redoLength + " and " + endLength, redoLength == endLength);
-		}
-
-		/**
-		 * Performs successive enters and one undo to see if all paragraph splits are
-		 * undone, then performs a redo to see if they're all redone.
-		 */
-		public function joinedSplitParagraphUndoTest():void
-		{
-			var n:int = 10;
-			SelManager.selectRange(10,10);
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-			for(var i:int = 0; i < n; i++){
-				var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13);
-				dispatchEvent(event);
-			}
-
-			var endLength:uint = SelManager.textFlow.textLength;
-
-			SelManager.undo();
-
-			var undoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected text length before undo to be " + n + " more.  Was actually " +
-						(endLength - initLength) + " less.", endLength == initLength + n );
-			assertTrue("expected text length after undo to be identical to the start, but it was off by " +
-						(undoLength-initLength), undoLength == initLength);
-
-			Redo();
-
-			var redoLength:uint = SelManager.textFlow.textLength;
-
-			assertTrue("expected redo length to equal undo length, but found " +
-						redoLength + " and " + endLength, redoLength == endLength);
-		}
-
-		/**
-		 * Create a new undo manager with an undo limit of ten, then perform eleven
-		 * undoable operations and see how many times it will let you undo.
-		 */
-		public function undoLimitTest():void
-		{
-			var undo:UndoManager = new UndoManager();
-			var n:int = 10;
-			undo.undoAndRedoItemLimit = n;
-
-			var newSM:EditManager = new EditManager(undo);
-			SelManager = newSM;
-			TestFrame.rootElement.getTextFlow().interactionManager = newSM;
-
-			//SelManager.selectRange(n,n);
-
-			for(var i:int = 0; i < n + 1; i++){
-				SelManager.selectRange(n,n+i);
-				var event:KeyboardEvent = (i % 2 == 0) ?
-					new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13):
-					new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8);
-				dispatchEvent(event);
-				SelManager.selectRange(-1,-1);
-			}
-
-			var u:int = 0;
-			while(undo.canUndo()){
-				SelManager.undo();
-				u++;
-			}
-
-			assertTrue("expected only " + n + " undos but found " + u, u == n);
-		}
-		
-		
-		public function undoRedoStackTest():void
-		{
-			var undo:UndoManager = new UndoManager();
-			var n:int = 10;
-			undo.undoAndRedoItemLimit = n;
-			
-			var newSM:EditManager = new EditManager(undo);
-			SelManager = newSM;
-			TestFrame.rootElement.getTextFlow().interactionManager = newSM;
-			
-			//do n operations
-			for(var i:int = 0; i < n + 1; i++){
-				SelManager.selectRange(n,n+i);
-				var event:KeyboardEvent = (i % 2 == 0) ?
-					new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13):
-					new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8);
-				dispatchEvent(event);
-				SelManager.selectRange(-1,-1);
-			}
-			var testManager:TestEditManager = new TestEditManager(undo);
-			var stackItemNum:int = testManager.UndoRedoEntireStack(undo);
-
-			assertTrue("expected only " + n + " undos but found " + stackItemNum, stackItemNum == n);
-		}
-
-		/**
-		 * Select a section of text that spans paragraphs then delete it and see if the
-		 * size of the flow goes down by the appropriate amount.
-		 */
-		public function transParagraphDeleteTest():void
-		{
-			var startLength:int = TestFrame.rootElement.textLength;
-
-			var flow1:FlowElement;
-			var flow2:FlowElement;
-
-			var start:int = 0;
-			var finish:int = 0;
-
-			var origParas:int = TestFrame.rootElement.numChildren;
-
-			//Look for two back to back paragraphs.
-			for(var i:int = 0; i < TestFrame.rootElement.numChildren-1; i++){
-				flow1 = TestFrame.rootElement.getChildAt(i);
-				flow2 = TestFrame.rootElement.getChildAt(i+1);
-
-				if(flow1 is ParagraphElement && flow2 is ParagraphElement){
-					finish = start + flow1.textLength + flow2.textLength/2;
-					start = start + flow1.textLength/2;
-					break;
-				}else{
-					start = start + flow1.textLength;
-				}
-			}
-
-			assertTrue("expected finish to be in the middle of the second para, but it's still 0", finish != 0);
-
-			var para1:ParagraphElement = flow1 as ParagraphElement;
-			var para2:ParagraphElement = flow2 as ParagraphElement;
-
-			var attrib1:ITextLayoutFormat = para1.computedFormat;
-			var pa:TextLayoutFormat = new TextLayoutFormat();
-			if(attrib1.textAlign == TextAlign.CENTER)
-				pa.textAlign = TextAlign.LEFT;
-			else
-				pa.textAlign = TextAlign.CENTER;
-
-
-			SelManager.selectRange(para2.getAbsoluteStart(),para2.getAbsoluteStart() + 1);
-
-			SelManager.applyParagraphFormat(pa);
-
-			var attrib2:ITextLayoutFormat = para2.computedFormat;
-			assertTrue("para1 and para2 paraAttrs must be different for this test to work!",
-				!TextLayoutFormat.isEqual(attrib1,attrib2)
-			);
-
-			SelManager.selectRange(start,finish);
-			SelManager.deleteNextCharacter();
-			var finishLength:int = TestFrame.rootElement.textLength;
-
-			assertTrue("expected " + (finish-start) + " less characters but found " +
-						(startLength - finishLength) + " less", startLength - finishLength == finish - start);
-
-			/*
-			 * TODO: this tests current behavior. Proper behavior would be only one
-			 * remaining paragraph.
-			 */
-
-			assertTrue("number of paragraphs should have decreased!", origParas > TestFrame.rootElement.numChildren);
-
-			var finalPara:ParagraphElement = TestFrame.rootElement.getChildAt(i) as ParagraphElement;
-			var finalAttrs:ITextLayoutFormat = finalPara.computedFormat;
-
-			assertTrue("paragraph attributes changed and should be the same!",TextLayoutFormat.isEqual(attrib1,finalAttrs));
-		}
-
-		/**
-		 * Create an empty paragraph and select the 0 position in it.
-		 * Then delete all the content on the flow and see if the position selected is 0.
-		 */
-		public function emptyParagraphTest():void
-		{
-			SelManager.selectRange(0,0);
-
-			var returnevent:KeyboardEvent =
-				new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13);
-			dispatchEvent(returnevent);
-
-			SelManager.selectRange(0,0);
-			assertTrue("did not start with selection at 0,0", SelManager.anchorPosition == 0 && SelManager.activePosition == 0);
-			SelManager.selectAll();
-			SelManager.deleteNextCharacter();
-			assertTrue("did not end with selection at 0,0 after delete all", SelManager.anchorPosition == 0 && SelManager.activePosition == 0);
-		}
-
-		public function splitUTF16Test():void
-		{
-			// remove all text
-			SelManager.selectAll();
-			SelManager.deleteNextCharacter();
-
-			var a:uint = 0xD866; var b:uint = 0xDDC1;
-			var c:uint = 0xD869; var d:uint = 0xDED6;
-			var e:uint = 0xD8BF; var f:uint = 0xDFFD;
-
-			var y:String = String.fromCharCode(a,b,c,d,e,f);
-			SelManager.insertText(y);
-			SelManager.flushPendingOperations();
-
-			var begin:int = 0;
-			var end:int = SelManager.textFlow.textLength;
-			var middle:int = ((end-1) - begin)/2;
-			SelManager.selectRange(middle, middle);
-
-			var gotRangeError:Boolean = false;
-			try
-			{
-				SelManager.splitParagraph();
-				SelManager.flushPendingOperations();
-			}
-			catch ( e:RangeError )
-			{
-				gotRangeError = true;
-			}
-			/* See bug #1798067 */
-			assertTrue( "Spliting a surrogate pair did not throw an error", gotRangeError );
-
-			SelManager.selectAll();
-
-			var charAttr:TextLayoutFormat = new TextLayoutFormat();
-			charAttr.fontFamily = "Adobe Song Std L";
-
-			SelManager.applyLeafFormat(charAttr);
-			SelManager.flushPendingOperations();
-
-			//trace(begin + ", " + middle + ", " + end);
-		}
-
-		public function splitUTF32Test():void
-		{
-			// remove all text
-			SelManager.selectAll();
-			SelManager.deleteNextCharacter();
-
-			var y:String = String.fromCharCode(0x00028023);
-			y = y + y + y;
-
-			SelManager.insertText(y);
-			SelManager.flushPendingOperations();
-
-			var begin:int = 0;
-			var end:int = SelManager.textFlow.textLength;
-			var middle:int = ((end-1) - begin)/2;
-			SelManager.selectRange(middle, middle);
-
-			SelManager.splitParagraph();
-			SelManager.flushPendingOperations();
-
-			SelManager.selectAll();
-
-			var charAttr:TextLayoutFormat = new TextLayoutFormat();
-			charAttr.fontFamily = "Adobe Song Std L";
-
-			SelManager.applyLeafFormat(charAttr);
-			SelManager.flushPendingOperations();
-
-			//trace(begin + ", " + middle + ", " + end);
-		}
-
-
-		// pick up the actual operation
-		private var flowOp:FlowOperation;
-
-		private function listenForOpBegin(opEvent:FlowOperationEvent):void
-		{
-			flowOp = opEvent.operation;
-		}
-
-		/**
-		 * Performs an operation, clear the selection manager and then make sure the operation doesn't undo
-		 */
-		public function undoWithModelChangeTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var selManager:EditManager = SelManager;
-
-			selManager.selectAll();
-
-			var initLength:uint = SelManager.textFlow.textLength;
-
-
-			flowOp = null;
-			tf.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN,listenForOpBegin,false,0,true);
-
-			// now do an operation
-			var ca:TextLayoutFormat = new TextLayoutFormat();
-			ca.color = 0xff;
-			selManager.applyFormatToElement(tf, ca);
-
-			assertTrue("no begin operation event",flowOp != null);
-			assertTrue("textFlow characterFormat.color should be 0xff",tf.format && tf.format.color == 0xff);
-
-			// clear the selection manager
-			tf.interactionManager = null;
-			// now I've got a hold of the operation.  do an out of bounds model modification and then attempt an undo
-			tf.color = 0xff00;
-			assertTrue("textFlow characterFormat.color should be 0xff",tf.format.color == 0xff00);
-
-			// now restore the interactionManager
-			tf.interactionManager = selManager;
-			// CONFIG::debug { trace("GeneralFunctionsTest.undoWithModelChangeTest: expect to see message regarding skipping undo due to mismatched generation numbers."); }
-			// try to do an undo
-			selManager.undo();
-
-			// it should be skipped
-			assertTrue("no begin operation event",flowOp != null);
-			assertTrue("wrong begin operation event",flowOp is UndoOperation);
-			assertTrue("textFlow characterFormat.color should be 0xff00",tf.format && tf.format.color == 0xff00);
-
-			selManager.selectRange(0,0);	// prevent assert in tearDown
-		}
-
-		private function Redo():void // KJT
-		{
-			try {
-				SelManager.redo();
-			}
-			catch(e:Error){
-				fail("Redo operation failed.");
-			}
-		}
-
-		private function dispatchEvent(event:Event):void
-		{
-			// assume containers support dispatchEvent.  Otherwise we get an error
-			TestFrame.container["dispatchEvent"](event);
-		}
-
-		public function doubleClickTest():void
-		{
-			SelManager.selectRange( 68, 68 );
-			var mEvent:MouseEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			assertTrue( "Double click failed to correctly select word",
-						SelManager.anchorPosition == 65 &&
-						SelManager.activePosition == 72 );
-
-			SelManager.selectRange( 955, 955 );
-			mEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			assertTrue( "Double click failed to correctly select word",
-						SelManager.anchorPosition == 954 &&
-						SelManager.activePosition == 957 );
-		}
-
-		public function doubleClickHyphenTest():void
-		{
-			SelManager.selectRange( 24, 24 );
-			var mEvent:MouseEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			assertTrue( "Double click failed on a hyphen",
-						SelManager.anchorPosition == 24 &&
-						SelManager.activePosition == 25 );
-
-			SelManager.selectRange( 498, 498 );
-			mEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			assertTrue( "Double click failed on a hyphenated word",
-						SelManager.anchorPosition == 496 &&
-						SelManager.activePosition == 502 );
-		}
-
-		public function doubleClickPunctuationTest():void
-		{
-			SelManager.selectRange( 951, 951 );
-			var mEvent:MouseEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			assertTrue( "Double click failed on a word next to punctuation",
-						SelManager.anchorPosition == 945 &&
-						SelManager.activePosition == 952 );
-
-			SelManager.selectRange( 1964, 1964 );
-			mEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			assertTrue( "Double click failed on punctuation",
-						SelManager.anchorPosition == 1963 &&
-						SelManager.activePosition == 1966 );
-		}
-
-		public function replaceChildrenFlowTest():void
-		{
-			var caught:Boolean = false;
-
-			try
-			{
-				SelManager.textFlow.replaceChildren( 0,0, new TextFlow() );
-			}
-			catch ( err:ArgumentError )
-			{
-				caught = true;
-			}
-
-			assertTrue( "TextFlow.replaceChildren with a TextFlow argument should throw an error", caught );
-		}
-		private function resolveInlines(ilg:InlineGraphicElement):Object
-		{
-			return ilg.source == "placeholder" ? new Sprite() : ilg.source;
-		}
-
-		private var _ilgStatus:String;
-		private function graphicStatusChangeEvent(e:StatusChangeEvent):void
-		{
-			_ilgStatus = e.status;
-		}
-
-		public function resolveInlinesTest():void
-		{
-			var textFlow:TextFlow;
-			const markup:String = "<flow:TextFlow xmlns:flow='http://ns.adobe.com/textLayout/2008'><flow:p><flow:img source='placeholder'/></flow:p></flow:TextFlow>";
-
-			var config:Configuration = new Configuration();
-			config.inlineGraphicResolverFunction = resolveInlines;
-			textFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT, config);
-
-			textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,graphicStatusChangeEvent);
-
-			textFlow.flowComposer.addController(new ContainerController(new Sprite(), 400, 200));
-			textFlow.flowComposer.updateAllControllers();
-
-			assertTrue( "Inline Graphic resolution failed",	_ilgStatus == InlineGraphicElementStatus.READY ); //
-
-		}
-
-		public function nestingTest():void
-		{
-			var link1:LinkElement = new LinkElement();
-			var tcy1:TCYElement = new TCYElement();
-			var link2:LinkElement = new LinkElement();
-
-			var exceptionThrown:Boolean = false;
-			try
-			{
-				link1.addChild(link2);
-			}
-			catch (e:*)
-			{
-				exceptionThrown = true;
-			}
-			assertTrue("Should not be able to add a link child to a link", exceptionThrown);
-
-			exceptionThrown = false;
-			link1.addChild(tcy1);
-
-			try
-			{
-				tcy1.addChild(link2);
-			}
-			catch (e:*)
-			{
-				exceptionThrown = true;
-			}
-			assertTrue("Should not be able to add a link child to a TCY if the latter is contained in a link", exceptionThrown);
-
-			exceptionThrown = false;
-			link1.removeChild (tcy1);
-			tcy1.addChild(link2);
-
-			try
-			{
-				link1.addChild(tcy1);
-			}
-			catch (e:*)
-			{
-				exceptionThrown = true;
-			}
-			assertTrue("Should not be able to add a TCY child to a link if the former contains a link", exceptionThrown);
-
-		}
-
-		private static const customResourceDict:Object = 
-		{
-			invalidFlowElementConstruct_custom:	"Attempted construct of invalid FlowElement subclass",
-			badMXMLChildrenArgument_custom: "Bad element of type {0} passed to mxmlChildren",
-			malformedTag:	"Malformed tag </p/>",
-			XMLParserFailure:	"TypeError: Error #1090: XML parser failure: element is malformed."
-		}
-		
-		tlf_internal static function customResourceStringFunction(resourceName:String, parameters:Array = null):String
-		{
-			var value:String = String(customResourceDict[resourceName]);
-			
-			if (value == null)
-			{
-				value = String(customResourceDict["missingStringResource"]);
-				parameters = [ resourceName ];
-			}
-			
-			if (parameters)
-				value = customSubstitute(value, parameters);
-			
-			return value;
-		}
-		
-		/** @private */
-		tlf_internal static function customSubstitute(str:String, ... rest):String
-		{
-			if (str == null) 
-				return '';
-			
-			// Replace all of the parameters in the msg string.
-			var len:uint = rest.length;
-			var args:Array;
-			if (len == 1 && rest[0] is Array)
-			{
-				args = rest[0] as Array;
-				len = args.length;
-			}
-			else
-			{
-				args = rest;
-			}
-			
-			for (var i:int = 0; i < len; i++)
-			{
-				str = str.replace(new RegExp("\\{"+i+"\\}", "g"), args[i]);
-			}
-			
-			return str;
-		}
-			
-		/** Generate errors and make sure we get the right string */
-		public function errorThrowing():void
-		{
-			var exceptionThrown:Boolean;
-			
-			//use defaultResourceStringFunction to check the error message
-			// Invalid flowElement
-			exceptionThrown = false;
-			try
-			{
-				new FlowGroupElement();
-			}
-			catch (e:Error)
-			{
-				exceptionThrown = true;
-				var invalidFlowElementConstruct_message:String = e.message;
-				assertTrue("errorThrowing: Error thrown but message is incorrect",e.message == GlobalSettings.resourceStringFunction("invalidFlowElementConstruct"));
-				
-			}
-			assertTrue("errorThrowing: Expected error on new FlowGroupElement did not occur", exceptionThrown);
-			
-			// invalid mxmlchildren assignment
-			exceptionThrown = false;
-			try
-			{
-				var s:Sprite = new Sprite();
-				new DivElement().mxmlChildren = [ s ];
-			}
-			catch (e:Error)
-			{
-				exceptionThrown = true;
-				var badMXMLChildrenArgument_message:String = e.message;
-				assertTrue("errorThrowing: Error thrown but message is incorrect",e.message == GlobalSettings.resourceStringFunction("badMXMLChildrenArgument",[ getQualifiedClassName(s) ]));
-			}
-			assertTrue("errorThrowing: Expected error on bad MXMLChildren argument did not occur", exceptionThrown);
-			
-			//use customResourceStringFunction to check the error message
-			try
-			{
-				GlobalSettings.resourceStringFunction= customResourceStringFunction;
-				
-				//check Invalid flowElement and invalid mxmlchildren assignment
-				assertTrue("errorThrowing: Error thrown but message is incorrect", GlobalSettings.resourceStringFunction("invalidFlowElementConstruct_custom") == invalidFlowElementConstruct_message);
-				assertTrue("errorThrowing: Error thrown but message is incorrect", GlobalSettings.resourceStringFunction("badMXMLChildrenArgument_custom",[ getQualifiedClassName(s) ]) == badMXMLChildrenArgument_message);
-				
-				//use custom resource string function to test HTML importer error
-				exceptionThrown = false;
-				var textImporter:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT);
-				var textFlow:TextFlow;
-				
-				var markup:String = '<p>Malformed tag next</p/>';
-				textFlow = textImporter.importToFlow(markup);
-				
-				if (textImporter.errors)
-				{
-					exceptionThrown = true;
-					assertTrue("errorThrowing: Error thrown but message is incorrect",textImporter.errors == GlobalSettings.resourceStringFunction("malformedTag"));
-				}
-				assertTrue("errorThrowing: Expected error on importer did not occur", exceptionThrown);
-				
-				//use custom resource string function to test Text importer error
-				exceptionThrown = false;
-				markup = "<TextFlow columnCount='inherit'" 
-					+ "<span>Ethan Brand</span></a></p></TextFlow>";
-				
-		        textImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
-				textFlow = textImporter.importToFlow(markup);
-			
-				if (textImporter.errors)
-				{
-					exceptionThrown = true;
-					assertTrue("errorThrowing: Error thrown but message is incorrect",textImporter.errors == GlobalSettings.resourceStringFunction("XMLParserFailure"));
-				}
-				assertTrue("errorThrowing: Expected error on XML Parser Failure did not occur", exceptionThrown);
-			}
-			finally
-			{
-				GlobalSettings.resourceStringFunction = GlobalSettings.defaultResourceStringFunction;
-			}
-		
-		}
-		
-		public static const childParentTable:Array = 
-		[
-			[ "child\parent",			TextFlow,	DivElement, ParagraphElement, LinkElement, TCYElement, SpanElement, InlineGraphicElement, BreakElement, TabElement, ListElement, ListItemElement, SubParagraphGroupElement ],
-			[ TextFlow,					"no",		"no",		"no",				"no",		"no",		"no",			"no",				"no",			"no",		"no",		"no",			"no" ],
-			[ DivElement,				"yes",		"yes",		"no",				"no",		"no",		"no",			"no",				"no",			"no",		"yes",		"yes",			"no" ],
-			[ ParagraphElement,			"yes",		"yes",		"no",				"no",		"no",		"no",			"no",				"no",			"no",		"yes",		"yes",			"no" ],
-			[ LinkElement,				"no",		"no",		"yes",				"no",		"yes",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ],
-			[ TCYElement,				"no",		"no",		"yes",				"yes",		"no",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ],
-			[ SpanElement,				"no",		"no",		"yes",				"yes",		"yes",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ],
-			[ InlineGraphicElement,		"no",		"no",		"yes",				"yes",		"yes",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ],
-			[ BreakElement,				"no",		"no",		"yes",				"yes",		"yes",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ],
-			[ TabElement,				"no",		"no",		"yes",				"yes",		"yes",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ],
-			[ ListElement,				"yes",		"yes",		"no",				"no",		"no",		"no",			"no",				"no",			"no",		"yes",		"yes",			"no" ],
-			[ ListItemElement,			"no",		"no",		"no",				"no",		"no",		"no",			"no",				"no",			"no",		"yes",		"no",			"no" ],
-			[ SubParagraphGroupElement,	"no",		"no",		"yes",				"yes",		"yes",		"no",			"no",				"no",			"no",		"no",		"no",			"yes" ]
-		];
-		
-		/** Using above table for permitted child/parent relationships verify that canOwnFlowElement matches the table. */
-		public function AllNestingTest():void
-		{			
-			var parentRow:Array = childParentTable[0].slice(1);
-			var childRow:Array;
-			var childClassName:String;
-			var childClass:Class;
-			
-			for each (childRow in childParentTable.slice(1))
-			{
-				childClassName = "flashx.textLayout.elements." + childRow[0];
-				childClass = childRow[0] as Class;
-				var childElement:FlowElement = new childClass as FlowElement;
-				assertTrue(childElement.defaultTypeName != null,"Bad defaultTypeName in " + childClassName);
-
-				childRow = childRow.slice(1);
-				for (var idx:int = 0; idx < childRow.length; idx++)
-				{
-					var parentClass:Class = parentRow[idx] as Class
-					var parentElement:FlowElement = new parentClass as FlowElement;
-					
-					// trace(parentClass.toString(),childClass.toString(),childRow[idx]);
-					
-					if (parentElement is FlowGroupElement)
-					{
-						if (FlowGroupElement(parentElement).canOwnFlowElement(childElement))
-							assertTrue("Bad canOwnFlowElement value for expected allowed "+parentClass.toString()+" "+childClass.toString(),childRow[idx] == "yes");
-						else
-							assertTrue("Bad canOwnFlowElement value for expected not allowed "+parentClass.toString()+" "+childClass.toString(), childRow[idx] == "no");
-					}
-					else 
-						assertTrue("Bad canOwnFlowElement value for a non FlowGroupElement parent "+parentClass.toString()+" "+childClass.toString(),childRow[idx] == "no");
-				}
-			}
-			
-			// Check for indirect nesting of SubParagraphGroupElements
-			var textFlow:TextFlow = new TextFlow();
-			var paragraph:ParagraphElement = new ParagraphElement();
-			textFlow.replaceChildren(0, 0, paragraph);
-			var parentGroup:SubParagraphGroupElement = new SubParagraphGroupElement();
-			paragraph.replaceChildren(0, 0, parentGroup);
-			for each (childRow in childParentTable.slice(1))
-			{
-				childClassName = "flashx.textLayout.elements." + childRow[0];
-				childClass = childRow[0] as Class;
-				var spgeChildElement:SubParagraphGroupElementBase = new childClass as SubParagraphGroupElementBase;
-				if (spgeChildElement)
-				{
-					var groupElement:SubParagraphGroupElement = new SubParagraphGroupElement();
-					groupElement.replaceChildren(0, 0, new SubParagraphGroupElement());
-
-					groupElement.replaceChildren(0, 0, spgeChildElement);
-					
-					assertTrue (parentGroup.canOwnFlowElement(groupElement), "Expected this nesting to work");
-					
-					if (!spgeChildElement.allowNesting)
-					{
-						var nestingParent:SubParagraphGroupElementBase = new childClass as SubParagraphGroupElementBase;
-						parentGroup.replaceChildren(parentGroup.numChildren, parentGroup.numChildren, nestingParent);
-						var nestingGroup:SubParagraphGroupElement = new SubParagraphGroupElement();
-						nestingParent.replaceChildren(nestingParent.numChildren, nestingParent.numChildren, nestingGroup);
-						assertTrue("Expected this nesting to fail because of nesting of Link or TCY", !nestingGroup.canOwnFlowElement(groupElement));
-					}
-				}
-			}
-		}
-	}
+            for (var i:int = 0; i < n; i++)
+            {
+                var event:TextEvent = new TextEvent(TextEvent.TEXT_INPUT, false, false, "a");
+                dispatchEvent(event);
+            }
+
+            SelManager.flushPendingOperations();
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            SelManager.undo();
+
+            var undoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected text length before undo to be " + n + " more.  Was actually " +
+                    (endLength - initLength) + " less.", endLength == initLength + n);
+            assertTrue("expected text length after undo to be identical to the start, but it was off by " +
+                    (undoLength - initLength), undoLength == initLength);
+            Redo();
+
+            var redoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected redo length to equal undo length, but found " +
+                    redoLength + " and " + endLength, redoLength == endLength);
+        }
+
+        [Test]
+        /**
+         * Performs successive enters and one undo to see if all paragraph splits are
+         * undone, then performs a redo to see if they're all redone.
+         */
+        public function joinedSplitParagraphUndoTest():void
+        {
+            var n:int = 10;
+            SelManager.selectRange(10, 10);
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+            for (var i:int = 0; i < n; i++)
+            {
+                var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13);
+                dispatchEvent(event);
+            }
+
+            var endLength:uint = SelManager.textFlow.textLength;
+
+            SelManager.undo();
+
+            var undoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected text length before undo to be " + n + " more.  Was actually " +
+                    (endLength - initLength) + " less.", endLength == initLength + n);
+            assertTrue("expected text length after undo to be identical to the start, but it was off by " +
+                    (undoLength - initLength), undoLength == initLength);
+
+            Redo();
+
+            var redoLength:uint = SelManager.textFlow.textLength;
+
+            assertTrue("expected redo length to equal undo length, but found " +
+                    redoLength + " and " + endLength, redoLength == endLength);
+        }
+
+        [Test]
+        /**
+         * Create a new undo manager with an undo limit of ten, then perform eleven
+         * undoable operations and see how many times it will let you undo.
+         */
+        public function undoLimitTest():void
+        {
+            var undo:UndoManager = new UndoManager();
+            var n:int = 10;
+            undo.undoAndRedoItemLimit = n;
+
+            var newSM:EditManager = new EditManager(undo);
+            SelManager = newSM;
+            TestFrame.rootElement.getTextFlow().interactionManager = newSM;
+
+            //SelManager.selectRange(n,n);
+
+            for (var i:int = 0; i < n + 1; i++)
+            {
+                SelManager.selectRange(n, n + i);
+                var event:KeyboardEvent = (i % 2 == 0) ?
+                        new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13) :
+                        new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8);
+                dispatchEvent(event);
+                SelManager.selectRange(-1, -1);
+            }
+
+            var u:int = 0;
+            while (undo.canUndo())
+            {
+                SelManager.undo();
+                u++;
+            }
+
+            assertTrue("expected only " + n + " undos but found " + u, u == n);
+        }
+
+        [Test]
+        public function undoRedoStackTest():void
+        {
+            var undo:UndoManager = new UndoManager();
+            var n:int = 10;
+            undo.undoAndRedoItemLimit = n;
+
+            var newSM:EditManager = new EditManager(undo);
+            SelManager = newSM;
+            TestFrame.rootElement.getTextFlow().interactionManager = newSM;
+
+            //do n operations
+            for (var i:int = 0; i < n + 1; i++)
+            {
+                SelManager.selectRange(n, n + i);
+                var event:KeyboardEvent = (i % 2 == 0) ?
+                        new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13) :
+                        new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8);
+                dispatchEvent(event);
+                SelManager.selectRange(-1, -1);
+            }
+            var testManager:TestEditManager = new TestEditManager(undo);
+            var stackItemNum:int = testManager.UndoRedoEntireStack(undo);
+
+            assertTrue("expected only " + n + " undos but found " + stackItemNum, stackItemNum == n);
+        }
+
+        [Test]
+        /**
+         * Select a section of text that spans paragraphs then delete it and see if the
+         * size of the flow goes down by the appropriate amount.
+         */
+        public function transParagraphDeleteTest():void
+        {
+            var startLength:int = TestFrame.rootElement.textLength;
+
+            var flow1:FlowElement;
+            var flow2:FlowElement;
+
+            var start:int = 0;
+            var finish:int = 0;
+
+            var origParas:int = TestFrame.rootElement.numChildren;
+
+            //Look for two back to back paragraphs.
+            for (var i:int = 0; i < TestFrame.rootElement.numChildren - 1; i++)
+            {
+                flow1 = TestFrame.rootElement.getChildAt(i);
+                flow2 = TestFrame.rootElement.getChildAt(i + 1);
+
+                if (flow1 is ParagraphElement && flow2 is ParagraphElement)
+                {
+                    finish = start + flow1.textLength + flow2.textLength / 2;
+                    start = start + flow1.textLength / 2;
+                    break;
+                } else
+                {
+                    start = start + flow1.textLength;
+                }
+            }
+
+            assertTrue("expected finish to be in the middle of the second para, but it's still 0", finish != 0);
+
+            var para1:ParagraphElement = flow1 as ParagraphElement;
+            var para2:ParagraphElement = flow2 as ParagraphElement;
+
+            var attrib1:ITextLayoutFormat = para1.computedFormat;
+            var pa:TextLayoutFormat = new TextLayoutFormat();
+            if (attrib1.textAlign == TextAlign.CENTER)
+                pa.textAlign = TextAlign.LEFT;
+            else
+                pa.textAlign = TextAlign.CENTER;
+
+
+            SelManager.selectRange(para2.getAbsoluteStart(), para2.getAbsoluteStart() + 1);
+
+            SelManager.applyParagraphFormat(pa);
+
+            var attrib2:ITextLayoutFormat = para2.computedFormat;
+            assertTrue("para1 and para2 paraAttrs must be different for this test to work!",
+                    !TextLayoutFormat.isEqual(attrib1, attrib2)
+            );
+
+            SelManager.selectRange(start, finish);
+            SelManager.deleteNextCharacter();
+            var finishLength:int = TestFrame.rootElement.textLength;
+
+            assertTrue("expected " + (finish - start) + " less characters but found " +
+                    (startLength - finishLength) + " less", startLength - finishLength == finish - start);
+
+            /*
+             * TODO: this tests current behavior. Proper behavior would be only one
+             * remaining paragraph.
+             */
+
+            assertTrue("number of paragraphs should have decreased!", origParas > TestFrame.rootElement.numChildren);
+
+            var finalPara:ParagraphElement = TestFrame.rootElement.getChildAt(i) as ParagraphElement;
+            var finalAttrs:ITextLayoutFormat = finalPara.computedFormat;
+
+            assertTrue("paragraph attributes changed and should be the same!", TextLayoutFormat.isEqual(attrib1, finalAttrs));
+        }
+
+        [Test]
+        /**
+         * Create an empty paragraph and select the 0 position in it.
+         * Then delete all the content on the flow and see if the position selected is 0.
+         */
+        public function emptyParagraphTest():void
+        {
+            SelManager.selectRange(0, 0);
+
+            var returnevent:KeyboardEvent =
+                    new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 13);
+            dispatchEvent(returnevent);
+
+            SelManager.selectRange(0, 0);
+            assertTrue("did not start with selection at 0,0", SelManager.anchorPosition == 0 && SelManager.activePosition == 0);
+            SelManager.selectAll();
+            SelManager.deleteNextCharacter();
+            assertTrue("did not end with selection at 0,0 after delete all", SelManager.anchorPosition == 0 && SelManager.activePosition == 0);
+        }
+
+        [Test]
+        public function splitUTF16Test():void
+        {
+            // remove all text
+            SelManager.selectAll();
+            SelManager.deleteNextCharacter();
+
+            var a:uint = 0xD866;
+            var b:uint = 0xDDC1;
+            var c:uint = 0xD869;
+            var d:uint = 0xDED6;
+            var e:uint = 0xD8BF;
+            var f:uint = 0xDFFD;
+
+            var y:String = String.fromCharCode(a, b, c, d, e, f);
+            SelManager.insertText(y);
+            SelManager.flushPendingOperations();
+
+            var begin:int = 0;
+            var end:int = SelManager.textFlow.textLength;
+            var middle:int = ((end - 1) - begin) / 2;
+            SelManager.selectRange(middle, middle);
+
+            var gotRangeError:Boolean = false;
+            try
+            {
+                SelManager.splitParagraph();
+                SelManager.flushPendingOperations();
+            }
+            catch (e:RangeError)
+            {
+                gotRangeError = true;
+            }
+            /* See bug #1798067 */
+            assertTrue("Spliting a surrogate pair did not throw an error", gotRangeError);
+
+            SelManager.selectAll();
+
+            var charAttr:TextLayoutFormat = new TextLayoutFormat();
+            charAttr.fontFamily = "Adobe Song Std L";
+
+            SelManager.applyLeafFormat(charAttr);
+            SelManager.flushPendingOperations();
+
+            //trace(begin + ", " + middle + ", " + end);
+        }
+
+        [Test]
+        public function splitUTF32Test():void
+        {
+            // remove all text
+            SelManager.selectAll();
+            SelManager.deleteNextCharacter();
+
+            var y:String = String.fromCharCode(0x00028023);
+            y = y + y + y;
+
+            SelManager.insertText(y);
+            SelManager.flushPendingOperations();
+
+            var begin:int = 0;
+            var end:int = SelManager.textFlow.textLength;
+            var middle:int = ((end - 1) - begin) / 2;
+            SelManager.selectRange(middle, middle);
+
+            SelManager.splitParagraph();
+            SelManager.flushPendingOperations();
+
+            SelManager.selectAll();
+
+            var charAttr:TextLayoutFormat = new TextLayoutFormat();
+            charAttr.fontFamily = "Adobe Song Std L";
+
+            SelManager.applyLeafFormat(charAttr);
+            SelManager.flushPendingOperations();
+
+            //trace(begin + ", " + middle + ", " + end);
+        }
+
+        [Test]
+        /**
+         * Performs an operation, clear the selection manager and then make sure the operation doesn't undo
+         */
+        public function undoWithModelChangeTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var selManager:EditManager = SelManager;
+
+            selManager.selectAll();
+
+            var initLength:uint = SelManager.textFlow.textLength;
+
+
+            flowOp = null;
+            tf.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN, listenForOpBegin, false, 0, true);
+
+            // now do an operation
+            var ca:TextLayoutFormat = new TextLayoutFormat();
+            ca.color = 0xff;
+            selManager.applyFormatToElement(tf, ca);
+
+            assertTrue("no begin operation event", flowOp != null);
+            assertTrue("textFlow characterFormat.color should be 0xff", tf.format && tf.format.color == 0xff);
+
+            // clear the selection manager
+            tf.interactionManager = null;
+            // now I've got a hold of the operation.  do an out of bounds model modification and then attempt an undo
+            tf.color = 0xff00;
+            assertTrue("textFlow characterFormat.color should be 0xff", tf.format.color == 0xff00);
+
+            // now restore the interactionManager
+            tf.interactionManager = selManager;
+            // CONFIG::debug { trace("GeneralFunctionsTest.undoWithModelChangeTest: expect to see message regarding skipping undo due to mismatched generation numbers."); }
+            // try to do an undo
+            selManager.undo();
+
+            // it should be skipped
+            assertTrue("no begin operation event", flowOp != null);
+            assertTrue("wrong begin operation event", flowOp is UndoOperation);
+            assertTrue("textFlow characterFormat.color should be 0xff00", tf.format && tf.format.color == 0xff00);
+
+            selManager.selectRange(0, 0);	// prevent assert in tearDown
+        }
+
+        [Test]
+        public function doubleClickTest():void
+        {
+            SelManager.selectRange(68, 68);
+            var mEvent:MouseEvent = new MouseEve

<TRUNCATED>

[16/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-34403 - fix "Right arrow never works when text selected in TextInput" (credit: Neil Madsen)

Posted by pi...@apache.org.
FLEX-34403 - fix "Right arrow never works when text selected in TextInput" (credit: Neil Madsen)

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


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

Branch: refs/heads/tables
Commit: 80f3042db978557183109deb8231a6d84853d657
Parents: 553c899
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Wed Oct 15 08:53:26 2014 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Wed Oct 15 08:53:26 2014 +0200

----------------------------------------------------------------------
 textLayout/src/flashx/textLayout/utils/NavigationUtil.as | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/80f3042d/textLayout/src/flashx/textLayout/utils/NavigationUtil.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/utils/NavigationUtil.as b/textLayout/src/flashx/textLayout/utils/NavigationUtil.as
index 2ebb985..091ceda 100644
--- a/textLayout/src/flashx/textLayout/utils/NavigationUtil.as
+++ b/textLayout/src/flashx/textLayout/utils/NavigationUtil.as
@@ -1112,7 +1112,8 @@ package flashx.textLayout.utils
 			if (range.absoluteEnd >= flowComposer.damageAbsoluteStart - 1)
 			{
 				clampToFit(range, flowComposer.damageAbsoluteStart - 1);
-				return true;
+				return false;
+				//return true;
 			}
 			if (flowComposer && flowComposer.numControllers)
 			{


[30/44] git commit: [flex-tlf] [refs/heads/tables] - Attempt to fix build - set forkValue to true

Posted by pi...@apache.org.
Attempt to fix build - set forkValue to true


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

Branch: refs/heads/tables
Commit: 83490edf936c9cb8473e373c58ce9f791ad1f4a2
Parents: b9cecc6
Author: piotrz <pi...@gmail.com>
Authored: Tue Oct 21 20:28:36 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Tue Oct 21 20:28:36 2014 +0200

----------------------------------------------------------------------
 build.properties | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/83490edf/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 4a30a49..a698964 100644
--- a/build.properties
+++ b/build.properties
@@ -26,6 +26,8 @@ local.d32 =
 src.depend = true
 src.debug = on
 
+forkValue = true
+
 # JVM options for <compc> and <mxmlc> tasks
 jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)


[14/44] git commit: [flex-tlf] [refs/heads/tables] - Add GeneralFunctionsTest

Posted by pi...@apache.org.
Add GeneralFunctionsTest


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

Branch: refs/heads/tables
Commit: d92c169e5887ebda8a16daab6d678777ae2cbe58
Parents: 620baf2
Author: piotrz <pi...@gmail.com>
Authored: Wed Oct 15 07:48:57 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Wed Oct 15 07:48:57 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |    2 +
 .../src/UnitTest/Tests/GeneralFunctionsTest.as  | 2673 +++++++++---------
 2 files changed, 1357 insertions(+), 1318 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/d92c169e/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index f6f8045..e7f603d 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -36,6 +36,7 @@ package
     import UnitTest.Tests.FactoryImportTest;
     import UnitTest.Tests.FloatTest;
     import UnitTest.Tests.FlowModelTest;
+    import UnitTest.Tests.GeneralFunctionsTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
 
@@ -62,6 +63,7 @@ package
         public var elementOperationTest:ElementOperationTest;
         public var eventOverrideTest:EventOverrideTest;
         public var flowModelTest:FlowModelTest;
+        public var generalFunctionsTest:GeneralFunctionsTest;
     }
 
 }


[08/44] git commit: [flex-tlf] [refs/heads/tables] - Add missing imports to AutomationCoreClasses

Posted by pi...@apache.org.
Add missing imports to AutomationCoreClasses


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

Branch: refs/heads/tables
Commit: 895152c0c5f2b82dd278cfe19c7db999f112c2fb
Parents: 7961f33
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:51:06 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:51:06 2014 +0200

----------------------------------------------------------------------
 automation_core/src/AutomationCoreClasses.as                   | 2 ++
 automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/895152c0/automation_core/src/AutomationCoreClasses.as
----------------------------------------------------------------------
diff --git a/automation_core/src/AutomationCoreClasses.as b/automation_core/src/AutomationCoreClasses.as
index f2da5aa..c7a3faa 100644
--- a/automation_core/src/AutomationCoreClasses.as
+++ b/automation_core/src/AutomationCoreClasses.as
@@ -31,6 +31,8 @@ package
         import UnitTest.Validation.FlowElementMouseEventValidator; FlowElementMouseEventValidator;
         import UnitTest.Validation.EventValidator; EventValidator;
         import UnitTest.Validation.UpdateCompleteEventValidator; UpdateCompleteEventValidator;
+        import UnitTest.Fixtures.TestEditManager; TestEditManager;
+        import UnitTest.Fixtures.MeasureConstants; MeasureConstants;
 
 		/*import UnitTest.ExtendedClasses.TestDescriptor; TestDescriptor;
 		import UnitTest.ExtendedClasses.TestSuiteExtended; TestSuiteExtended;

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/895152c0/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
----------------------------------------------------------------------
diff --git a/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as b/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
index d15c275..d1fca70 100644
--- a/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
+++ b/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
@@ -34,7 +34,6 @@ package UnitTest.ExtendedClasses
     import flash.display.IBitmapDrawable;
     import flash.display.Sprite;
     import flash.utils.ByteArray;
-    import flash.utils.getTimer;
 
     import flashx.textLayout.container.ContainerController;
     import flashx.textLayout.container.ScrollPolicy;


[21/44] git commit: [flex-tlf] [refs/heads/tables] - another attempt to fix builds

Posted by pi...@apache.org.
another attempt to fix builds


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

Branch: refs/heads/tables
Commit: 8983e244496ec15992bf64ffbca398fcaabb9b10
Parents: 4a5a32b
Author: Alex Harui <ah...@apache.org>
Authored: Sun Oct 19 08:11:41 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Oct 19 08:11:41 2014 -0700

----------------------------------------------------------------------
 build.properties | 2 +-
 build.xml        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/8983e244/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 0441d4a..c544d1f 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx512m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx512m -XX:MaxPermSize=128m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/8983e244/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 761f299..4a6cc6e 100644
--- a/build.xml
+++ b/build.xml
@@ -194,6 +194,7 @@
      </target>
 
 	<target name="testApps" description="Builds TLF test application">
+        <echo>testApps jvm.args: ${jvm.args}</echo>
 		<mxmlc fork="${forkValue}" 	file="${testApps.dir}/src/flowCss.css" 
 				keep-generated-actionscript="false"
 				output="${output.dir}/apps/automation_apps/bin/Flow.swf">


[28/44] git commit: [flex-tlf] [refs/heads/tables] - Try to fix build with really high values -Xmx1024m -XX:MaxPermSize=1024m

Posted by pi...@apache.org.
Try to fix build with really high values -Xmx1024m -XX:MaxPermSize=1024m


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

Branch: refs/heads/tables
Commit: 2007b425a8a58d527bfba53f399c3a406533e0c0
Parents: 4abd0a6
Author: Piotr Zarzycki <pi...@grapeup.com>
Authored: Tue Oct 21 10:48:37 2014 +0200
Committer: Piotr Zarzycki <pi...@grapeup.com>
Committed: Tue Oct 21 10:48:37 2014 +0200

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/2007b425/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 65b4e52..9fc0620 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx512m -XX:MaxPermSize=768m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[31/44] git commit: [flex-tlf] [refs/heads/tables] - revert these to see if they made a difference

Posted by pi...@apache.org.
revert these to see if they made a difference


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

Branch: refs/heads/tables
Commit: af6e63dff10c118b42c1ed7991717c1619d5ead1
Parents: 83490ed
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 21 12:07:28 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 21 12:07:28 2014 -0700

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/af6e63df/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index a698964..1d9647b 100644
--- a/build.properties
+++ b/build.properties
@@ -29,7 +29,7 @@ src.debug = on
 forkValue = true
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[32/44] git commit: [flex-tlf] [refs/heads/tables] - Revert "revert these to see if they made a difference"

Posted by pi...@apache.org.
Revert "revert these to see if they made a difference"

This reverts commit af6e63dff10c118b42c1ed7991717c1619d5ead1.


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

Branch: refs/heads/tables
Commit: 129ec697e06416b21d681f8895b848b598303813
Parents: af6e63d
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 21 14:29:45 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 21 14:29:45 2014 -0700

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/129ec697/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 1d9647b..a698964 100644
--- a/build.properties
+++ b/build.properties
@@ -29,7 +29,7 @@ src.debug = on
 forkValue = true
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[17/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-34609 removed superfluous null checks for _container.

Posted by pi...@apache.org.
FLEX-34609 removed superfluous null checks for _container.


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

Branch: refs/heads/tables
Commit: 1a9f875cd3be40741c20ebe62613a7870517ffe4
Parents: 80f3042
Author: Mihai Chira <mi...@apache.org>
Authored: Wed Oct 15 17:23:19 2014 +0100
Committer: Mihai Chira <mi...@apache.org>
Committed: Wed Oct 15 17:23:19 2014 +0100

----------------------------------------------------------------------
 .../textLayout/container/ContainerController.as | 129 +++++++++----------
 1 file changed, 58 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1a9f875c/textLayout/src/flashx/textLayout/container/ContainerController.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/container/ContainerController.as b/textLayout/src/flashx/textLayout/container/ContainerController.as
index a4e63f1..4876884 100644
--- a/textLayout/src/flashx/textLayout/container/ContainerController.as
+++ b/textLayout/src/flashx/textLayout/container/ContainerController.as
@@ -514,7 +514,7 @@ package flashx.textLayout.container
 				if (_rootElement)
 					formatChanged();
 
-				if (_container && Configuration.playerEnablesSpicyFeatures)
+				if (Configuration.playerEnablesSpicyFeatures)
 					_container["needsSoftKeyboard"] = (interactionManager && interactionManager.editingMode == EditingMode.READ_WRITE);
 			}
 		}
@@ -924,7 +924,7 @@ package flashx.textLayout.container
 			}
 
 			// Called when the bounds have changed and they now exceed the composition area, to see if we need to attach a mouse wheel listener for scrolling
-			if (textFlow && _container && !_minListenersAttached)
+			if (textFlow && !_minListenersAttached)
 			{
 				var needToScroll:Boolean = !measuring && newHeight > visibleHeight;
 				if (needToScroll != _mouseWheelListenerAttached)
@@ -1536,44 +1536,41 @@ package flashx.textLayout.container
 			if ((_minListenersAttached || _mouseWheelListenerAttached) && attachTransparentBackground)
 			{
 				var s:Sprite = _container;
-				if (s)
-				{
-					if (justClear)
-					{
-						s.graphics.clear();
-						CONFIG::debug { Debugging.traceFTECall(null,s,"clearTransparentBackground()"); }
-						_transparentBGX = _transparentBGY = _transparentBGWidth = _transparentBGHeight = NaN;
-					}
-					else
-					{		
-						var bgwidth:Number = _measureWidth ? _contentWidth : _compositionWidth;
-						var bgheight:Number = _measureHeight ? _contentHeight : _compositionHeight;
-						
-						var adjustHorizontalScroll:Boolean = effectiveBlockProgression == BlockProgression.RL && _horizontalScrollPolicy != ScrollPolicy.OFF;
-						var bgx:Number = adjustHorizontalScroll ? _xScroll - bgwidth : _xScroll;
-						var bgy:Number = _yScroll;
-						
-						CONFIG::debug { assert(!isNaN(bgx) && !isNaN(bgy) && !isNaN(bgwidth) && ! isNaN(bgheight),"Bad background rectangle"); }
-						
-						if (bgx != _transparentBGX || bgy != _transparentBGY || bgwidth != _transparentBGWidth || bgheight != _transparentBGHeight)
-						{
-							s.graphics.clear();
-							CONFIG::debug { Debugging.traceFTECall(null,s,"clearTransparentBackground()"); }
-							if (bgwidth != 0 && bgheight != 0 )
-							{
-								s.graphics.beginFill(0, 0);
-								s.graphics.drawRect(bgx, bgy, bgwidth, bgheight);
-								s.graphics.endFill();
-								CONFIG::debug { Debugging.traceFTECall(null,s,"drawTransparentBackground",bgx, bgy, bgwidth, bgheight); }
-							}
-							_transparentBGX = bgx;
-							_transparentBGY = bgy;
-							_transparentBGWidth = bgwidth;
-							_transparentBGHeight = bgheight;
-						}
-					}
-				}
-			} 
+                if (justClear)
+                {
+                    s.graphics.clear();
+                    CONFIG::debug { Debugging.traceFTECall(null,s,"clearTransparentBackground()"); }
+                    _transparentBGX = _transparentBGY = _transparentBGWidth = _transparentBGHeight = NaN;
+                }
+                else
+                {
+                    var bgwidth:Number = _measureWidth ? _contentWidth : _compositionWidth;
+                    var bgheight:Number = _measureHeight ? _contentHeight : _compositionHeight;
+
+                    var adjustHorizontalScroll:Boolean = effectiveBlockProgression == BlockProgression.RL && _horizontalScrollPolicy != ScrollPolicy.OFF;
+                    var bgx:Number = adjustHorizontalScroll ? _xScroll - bgwidth : _xScroll;
+                    var bgy:Number = _yScroll;
+
+                    CONFIG::debug { assert(!isNaN(bgx) && !isNaN(bgy) && !isNaN(bgwidth) && ! isNaN(bgheight),"Bad background rectangle"); }
+
+                    if (bgx != _transparentBGX || bgy != _transparentBGY || bgwidth != _transparentBGWidth || bgheight != _transparentBGHeight)
+                    {
+                        s.graphics.clear();
+                        CONFIG::debug { Debugging.traceFTECall(null,s,"clearTransparentBackground()"); }
+                        if (bgwidth != 0 && bgheight != 0 )
+                        {
+                            s.graphics.beginFill(0, 0);
+                            s.graphics.drawRect(bgx, bgy, bgwidth, bgheight);
+                            s.graphics.endFill();
+                            CONFIG::debug { Debugging.traceFTECall(null,s,"drawTransparentBackground",bgx, bgy, bgwidth, bgheight); }
+                        }
+                        _transparentBGX = bgx;
+                        _transparentBGY = bgy;
+                        _transparentBGWidth = bgwidth;
+                        _transparentBGHeight = bgheight;
+                    }
+                }
+			}
 		}
 		
 		/** @private */
@@ -1592,7 +1589,7 @@ package flashx.textLayout.container
 			// We have to tell the Player to bring up the soft keyboard on a
 			// keyboard edit gesture. Note that needsSoftKeyboard is new with 10.2, so 
 			// have to check for it. This is a change to the container, but unavoidable
-			if (_container && Configuration.playerEnablesSpicyFeatures)
+			if (Configuration.playerEnablesSpicyFeatures)
 				_container["needsSoftKeyboard"] = (interactionManager && interactionManager.editingMode == EditingMode.READ_WRITE);
 		}
 		
@@ -1608,18 +1605,14 @@ package flashx.textLayout.container
 			{
 				_minListenersAttached = true;
 				
-				if (_container)
-				{
-					_container.addEventListener(FocusEvent.FOCUS_IN, requiredFocusInHandler);
-					_container.addEventListener(MouseEvent.MOUSE_OVER, requiredMouseOverHandler);
+                _container.addEventListener(FocusEvent.FOCUS_IN, requiredFocusInHandler);
+                _container.addEventListener(MouseEvent.MOUSE_OVER, requiredMouseOverHandler);
 
-					attachTransparentBackgroundForHit(false);
-					
-					// If the container already has focus, we have to attach all listeners
-					if (_container.stage && _container.stage.focus == _container)
-						attachAllListeners();
-					
-				}
+                attachTransparentBackgroundForHit(false);
+
+                // If the container already has focus, we have to attach all listeners
+                if (_container.stage && _container.stage.focus == _container)
+                    attachAllListeners();
 			}
 		}
 		
@@ -1688,20 +1681,17 @@ package flashx.textLayout.container
 		{
 			if (_minListenersAttached)
 			{
-				if (_container)
-				{
-					_container.removeEventListener(FocusEvent.FOCUS_IN, requiredFocusInHandler);
-					_container.removeEventListener(MouseEvent.MOUSE_OVER, requiredMouseOverHandler);
-					
-					if(_allListenersAttached)
-					{
-						removeInteractionHandlers();				
-						removeContextMenu();
-						
-						attachTransparentBackgroundForHit(true);
-						_allListenersAttached = false;
-					}
-				}
+                _container.removeEventListener(FocusEvent.FOCUS_IN, requiredFocusInHandler);
+                _container.removeEventListener(MouseEvent.MOUSE_OVER, requiredMouseOverHandler);
+
+                if(_allListenersAttached)
+                {
+                    removeInteractionHandlers();
+                    removeContextMenu();
+
+                    attachTransparentBackgroundForHit(true);
+                    _allListenersAttached = false;
+                }
 				_minListenersAttached = false;
 			}
 			removeMouseWheelListener();
@@ -1714,11 +1704,8 @@ package flashx.textLayout.container
 			{
 				CONFIG::debug { assert(_minListenersAttached,"Bad call to attachAllListeners - won't detach"); }
 				_allListenersAttached = true;
-				if (_container)
-				{
-					attachContextMenu();
-					attachInteractionHandlers();
-				}
+                attachContextMenu();
+                attachInteractionHandlers();
 			}
 		}
 		


[25/44] git commit: [flex-tlf] [refs/heads/tables] - Back to the original values for jvm.args

Posted by pi...@apache.org.
Back to the original values for jvm.args


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

Branch: refs/heads/tables
Commit: 1ba820c555fdfbec6df9eb9f973df3c7c7e95134
Parents: 251c27a
Author: piotrz <pi...@gmail.com>
Authored: Mon Oct 20 21:13:21 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Mon Oct 20 21:13:21 2014 +0200

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1ba820c5/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 9652e52..9f348fa 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx512m -XX:MaxPermSize=512m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx384m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[15/44] git commit: [flex-tlf] [refs/heads/tables] - Merge remote-tracking branch 'remotes/origin/develop' into FlexUnit4TestsTLF

Posted by pi...@apache.org.
Merge remote-tracking branch 'remotes/origin/develop' into FlexUnit4TestsTLF


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

Branch: refs/heads/tables
Commit: 02fcc722c5e29f9a30555e4602c54dfb79d8d343
Parents: d92c169 553c899
Author: piotrz <pi...@gmail.com>
Authored: Wed Oct 15 08:03:24 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Wed Oct 15 08:03:24 2014 +0200

----------------------------------------------------------------------
 textLayout/src/flashx/textLayout/edit/TextClipboard.as | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[20/44] git commit: [flex-tlf] [refs/heads/tables] - try to set jvm.args to fix builds

Posted by pi...@apache.org.
try to set jvm.args to fix builds


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

Branch: refs/heads/tables
Commit: 4a5a32b1b62e78cceafed38c6eeda6a31af47485
Parents: 486ebe3
Author: Alex Harui <ah...@apache.org>
Authored: Sat Oct 18 22:09:07 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sat Oct 18 22:09:07 2014 -0700

----------------------------------------------------------------------
 build.properties | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/4a5a32b1/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
new file mode 100644
index 0000000..0441d4a
--- /dev/null
+++ b/build.properties
@@ -0,0 +1,37 @@
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+# For Java 7 on Mac OS X, you need an Intel-based Mac running Mac OS X version 10.7.3 
+# (Lion) and above.  Only the 64-bit data model is available so leave this blank.
+# Since ant properties are immutable, if this property is set in the build file before
+# this file is included, setting it to nothing here is a no-op.
+local.d32 =
+
+src.depend = true
+src.debug = on
+
+# JVM options for <compc> and <mxmlc> tasks
+jvm.args = ${local.d32} -Xms64m -Xmx512m -ea -Dapple.awt.UIElement=true
+    # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
+	# -Xms64m: start out with a 64 MB heap
+	# -Xmx512m: allow the heap to grow to 512 MB
+	# -ea: enable Java assertions
+compc.jvm.args = ${jvm.args}
+mxmlc.jvm.args = ${jvm.args}
+


[05/44] Add FactoryImportTest.as and FlowModelTest.as

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/UnitTest/Tests/FlowModelTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/FlowModelTest.as b/automation_tests/src/UnitTest/Tests/FlowModelTest.as
index ea0d482..0af28df 100644
--- a/automation_tests/src/UnitTest/Tests/FlowModelTest.as
+++ b/automation_tests/src/UnitTest/Tests/FlowModelTest.as
@@ -18,967 +18,985 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.display.Bitmap;
-	import flash.display.BitmapData;
-	import flash.display.DisplayObjectContainer;
-	import flash.display.Sprite;
-	import flash.geom.Rectangle;
-	import flash.text.engine.FontDescription;
-	import flash.text.engine.FontWeight;
-	import flash.text.engine.TextLine;
-	import flash.utils.ByteArray;
-	import flash.utils.getTimer;
-	
-	import flashx.textLayout.compose.StandardFlowComposer;
-	import flashx.textLayout.compose.TextFlowLine;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.edit.IEditManager;
-	import flashx.textLayout.elements.Configuration;
-	import flashx.textLayout.elements.DivElement;
-	import flashx.textLayout.elements.FlowElement;
-	import flashx.textLayout.elements.FlowLeafElement;
-	import flashx.textLayout.elements.GlobalSettings;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.LinkElement;
-	import flashx.textLayout.elements.ListElement;
-	import flashx.textLayout.elements.ListItemElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.SpanElement;
-	import flashx.textLayout.elements.TCYElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Direction;
-	import flashx.textLayout.formats.FormatValue;
-	import flashx.textLayout.formats.ITextLayoutFormat;
-	import flashx.textLayout.formats.ListStyleType;
-	import flashx.textLayout.formats.TextAlign;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.property.*;
-	import flashx.textLayout.tlf_internal;
-	import flashx.undo.IUndoManager;
-	import flashx.undo.UndoManager;
-	
-	import mx.core.FTETextField;
-	import mx.utils.LoaderUtil;
+    import UnitTest.ExtendedClasses.TestDescriptor;
+    import UnitTest.ExtendedClasses.TestSuiteExtended;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flash.display.Bitmap;
+    import flash.display.BitmapData;
+    import flash.display.DisplayObjectContainer;
+    import flash.display.Sprite;
+    import flash.geom.Rectangle;
+    import flash.text.engine.FontDescription;
+    import flash.text.engine.FontWeight;
+    import flash.text.engine.TextLine;
+    import flash.utils.ByteArray;
+    import flash.utils.getTimer;
+
+    import flashx.textLayout.compose.StandardFlowComposer;
+    import flashx.textLayout.compose.TextFlowLine;
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.edit.IEditManager;
+    import flashx.textLayout.elements.Configuration;
+    import flashx.textLayout.elements.DivElement;
+    import flashx.textLayout.elements.FlowElement;
+    import flashx.textLayout.elements.FlowLeafElement;
+    import flashx.textLayout.elements.GlobalSettings;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.LinkElement;
+    import flashx.textLayout.elements.ListElement;
+    import flashx.textLayout.elements.ListItemElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.SpanElement;
+    import flashx.textLayout.elements.TCYElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Direction;
+    import flashx.textLayout.formats.FormatValue;
+    import flashx.textLayout.formats.ITextLayoutFormat;
+    import flashx.textLayout.formats.ListStyleType;
+    import flashx.textLayout.formats.TextAlign;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.property.*;
+    import flashx.textLayout.tlf_internal;
+    import flashx.undo.IUndoManager;
+    import flashx.undo.UndoManager;
+
+    import mx.core.FTETextField;
+    import mx.utils.LoaderUtil;
 
     import org.flexunit.asserts.assertTrue;
 
     use namespace tlf_internal;
 
-	public class FlowModelTest extends VellumTestCase
-	{
-		public function FlowModelTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super(methodName, testID, testConfig);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Text Container";
-			metaData.productSubArea = "Flow";
-		}
-
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-			if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-			{
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest1", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest2", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest3", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest4", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest5", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "textFlowHostCharacterFormat", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "iterateParagraphForward", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "iterateParagraphBackward", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "cascadeValidation", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "elementMovingTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "emptyTextFlowTests", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "emptyElementCopyTests", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "fontMappingTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "insertLinkNoUpdateAPI", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "insertLinkNoUpdateViaEditManager", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "testUndo", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "testFindControllerIndexAtPosition", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "testFTETextField", testConfig ) );
-				
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "listItemInsertion", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "replaceChildrenTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "resolveFontLookupTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "bindableSpan", testConfig ) );
-				//ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "softKeyboardFlagTest", testConfig ) );
-			}
-   		}
-
-   		private var beginTime:int;
-   		private function beginAPITest():void
-   		{
-   			beginTime = getTimer();
-			SelManager.selectRange(-1,-1);
-   		}
-   		private function endAPITest():void
-   		{
-			SelManager.selectRange(0,0);
-			SelManager.textFlow.flowComposer.updateAllControllers();
-   		}
-
-		/**
-		 * Direct usage of the flow APIs. No validation - just look for crashes.
-		 * This test changes the color of the entire text.
-		 */
-		public function basicAPITest1():void
-		{
-			// set the color on the entire flow
-			beginAPITest();
-			SelManager.textFlow.color = 0xff0000;
-			endAPITest();
-		}
-
-		/**
-		 * Direct usage of the flow APIs. No validation - just look for crashes.
-		 * This test deletes every other character in the entire text.
-		 */
-		public function basicAPITest2():void
-		{
-			// delete every other character in the textflow
-			beginAPITest();
-
-			var idx:int = 0;
-			while (idx < SelManager.textFlow.textLength)
-			{
-				var span:SpanElement = SelManager.textFlow.findLeaf(idx) as SpanElement;
-				if (span)
-				{
-					var spanStart:int = span.getAbsoluteStart();
-					span.replaceText(idx-spanStart,idx-spanStart+1,null);
-				}
-				idx++;
-
-			}
-			endAPITest();
-		}
-
-		/**
-		 * Direct usage of the flow APIs. No validation - just look for crashes.
-		 * This test adds another paragraph to the flow containing the text "Hello World"
-		 * in 24 point font.
-		 */
-		public function basicAPITest3():void
-		{
-			// add a paragraph
-			beginAPITest();
-			var p:ParagraphElement = new ParagraphElement();
-			var s:SpanElement = new SpanElement();
-			s.text = "Hello world";
-			s.fontSize = 24;
-			p.replaceChildren(0,0,s);
-			SelManager.textFlow.replaceChildren(SelManager.textFlow.numChildren,SelManager.textFlow.numChildren,p);
-			endAPITest();
-		}
-
-		/**
-		 * This test performs a series of changes and validates the changes after they're performed.
-		 */
-		public function basicAPITest4():void
-		{
-			// more comprehensive set of tests - several manipulations to the flow and then display it
-
-			// generic begin to an API test
-			beginAPITest();
-
-			// get the textflow
-			var textFlow:TextFlow = SelManager.textFlow;
-
-			// remove all the textflow children
-			textFlow.replaceChildren(0,textFlow.numChildren);
-			assertTrue("expected no elements on the flow, but found " + textFlow.numChildren,
-						textFlow.numChildren == 0);
-
-			// create a paragraph
-			var p:ParagraphElement = new ParagraphElement();
-
-			// create a span
-			var s:SpanElement = new SpanElement();
-			s.text = "Hello world. ";
-			s.fontSize = 24;
-
-			// split the span
-			var nextSpan:SpanElement = s.splitAtPosition(6) as SpanElement;
-			// set the color - color can be a string or an unsigned integer
-			nextSpan.color = "0xff";
-			assertTrue("expected that the color would be 255, but found " + uint(nextSpan.format.color),
-						uint(nextSpan.format.color) == 255);
-
-			// put the two spans in the paragraph
-			p.replaceChildren(0,0,s);
-			/*CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding one span",
-										p.debugCheckFlowElement() == 0); }     */
-			p.replaceChildren(1,1,nextSpan);
-			/*CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding second span",
-										p.debugCheckFlowElement() == 0); }  */
-			assertTrue("expected the element count to be 2, but it was " + p.numChildren,
-						p.numChildren == 2);
-
-			// add another span
-			s = new SpanElement();
-			s.text = "Start:"
-			p.replaceChildren(0,0,s);
-		/*	CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding third span",
-										p.debugCheckFlowElement() == 0); }      */
-
-			// put the paragraph in the TextFlow
-			textFlow.replaceChildren(0,0,p);
-			assertTrue("text flow should have one element but has " + textFlow.numChildren,
-						textFlow.numChildren == 1);
-		/*	CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding para to flow",
-										textFlow.debugCheckFlowElement() == 0) }   */
-
-			// make another paragraph
-			p = new ParagraphElement();
-			s = new SpanElement();
-			p.replaceChildren(0,0,s);
-			s.text="NEW FIRST PARAGRAPH";
-
-			// set the paragraph attributes directly
-			p.textIndent = 20;
-			// set the paragraph attributes via clone and set
-			var pa:TextLayoutFormat = new TextLayoutFormat(p.format);
-			pa.textAlign = TextAlign.RIGHT;
-			p.format = pa;
-
-			// into the textFlow at the beginning
-			textFlow.replaceChildren(0,0,p);
-			/*CONFIG::debug {assertTrue("debugCheckFlowElement() failed after adding para to beginning",
-										textFlow.debugCheckFlowElement() == 0); }     */
-
-			// generic end to an API test
-			endAPITest();
-		}
-
-		/**
-		 * This test inserts an FE in the middle of a paragraph
-		 */
-		public function basicAPITest5():void
-		{
-			// more comprehensive set of tests - several manipulations to the flow and then display it
-
-			// generic begin to an API test
-			beginAPITest();
-
-			// get the textflow
-			var textFlow:TextFlow = SelManager.textFlow;
-
-			// create a paragraph empty the flow and insert it
-			var p:ParagraphElement = new ParagraphElement();
-			textFlow.replaceChildren(0,textFlow.numChildren,p);
-
-			// create a span
-			var s:SpanElement = new SpanElement();
-			s.text = "Hello world. ";
-			s.fontSize = 24;
-
-			// put it in the paragraph
-			p.replaceChildren(0,0,s);
-
-			// split the span
-			var nextSpanElement:SpanElement = s.splitAtPosition(6) as SpanElement;
-			assertTrue("Incorrect elementCount after split", p.numChildren == 2);
-
-			// create and insert an image between the spans
-			var image:InlineGraphicElement = new InlineGraphicElement();
-			image.width = 19;
-			image.height = 19;
-			image.source = LoaderUtil.createAbsoluteURL(baseURL,"../../test/testFiles/assets/surprised.png");
-			p.replaceChildren(1,1,image);
-
-			assertTrue("failed length on new InlineGraphicElement", image.textLength == 1);
-			assertTrue("failed elementCount after image insert", p.numChildren == 3);
-			assertTrue("bad first child",p.getChildAt(0) is SpanElement);
-			assertTrue("bad first child",p.getChildAt(1) is InlineGraphicElement);
-			assertTrue("bad first child",p.getChildAt(2) is SpanElement);
-			
-			// set a userStyle on a ContainerController
-			var saveFormat:ITextLayoutFormat = ContainerController.containerControllerInitialFormat;
-			try
-			{
-				ContainerController.containerControllerInitialFormat = null;
-				var controller:ContainerController = new ContainerController(new Sprite());
-				controller.setStyle("foo","blah");
-			}
-			catch (e:Error)
-			{
-				ContainerController.containerControllerInitialFormat = saveFormat;
-				throw(e);			
-			}
-			ContainerController.containerControllerInitialFormat = saveFormat;
-
-			// generic end to an API test
-			endAPITest();
-		}
-
-		/** Test setting hostCharacterFormat on the TextFlow */
-		public function textFlowHostCharacterFormat():void
-		{
-			// generic begin to an API test
-			beginAPITest();
-
-			// get the textflow
-			var textFlow:TextFlow = SelManager.textFlow;
-			var leaf:FlowLeafElement = textFlow.getFirstLeaf();
-
-			// make it red
-			var cf:TextLayoutFormat = new TextLayoutFormat();
-			cf.color = 0xff0000;
-			textFlow.hostFormat = cf;
-			assertTrue("host character format set color failed",leaf.computedFormat.color == 0xff0000);
-
-			// make it blue
-			textFlow.color = 0xff;
-			assertTrue("textFlow character format color override failed",leaf.computedFormat.color == 0xff);
-
-			// clear the blue
-			textFlow.color = undefined;
-			assertTrue("textFlow color clear failed",leaf.computedFormat.color == 0xff0000);
-
-			// clear the hostCharacterFormat
-			textFlow.hostFormat = null;
-			assertTrue("host character format clear failed",leaf.computedFormat.color == 0);
-
-			endAPITest();
-		}
-
-		private function initTextFlowAAA():TextFlow
-		{
-			var textFlow:TextFlow = new TextFlow();
-			var p:ParagraphElement = new ParagraphElement();
-			var span:SpanElement = new SpanElement();
-			span.text = "aaa";
-			p.replaceChildren(0, 0, span);
-			textFlow.replaceChildren(0, 0, p);
-			return textFlow;
-		}
-
-		// Insert a link to a paragraph that hasn't ever been updated.
-		public function insertLinkNoUpdateAPI():void
-		{
-			var textFlow:TextFlow = new TextFlow();
-			var p:ParagraphElement = new ParagraphElement();
-			var link:LinkElement = new LinkElement();
-			link.href = "http://www.cnn.com";
-			link.target = "_self";
-			var span:SpanElement = new SpanElement();
-			span.text = "aaa";
-			link.replaceChildren(0, 0, span);
-			p.replaceChildren(0, 0, link);
-			textFlow.replaceChildren(0, 0, p);
-		}
-
-		// Insert a link to a paragraph that hasn't ever been updated.
-		public function insertLinkNoUpdateViaEditManager():void
-		{
-			var textFlow:TextFlow = initTextFlowAAA();
-			var editManager:IEditManager = new EditManager();
-			textFlow.interactionManager = editManager;
-
-			editManager.selectRange(1,2);
-			editManager.applyLink("http://livedocs.adobe.com/", "_self", true);
-		}
-
-		// undo in a flow that has no controllers
-		public function testUndo():void
-		{
-			var textFlow:TextFlow = initTextFlowAAA();
-			var undoManager:IUndoManager = new UndoManager();
-			var editManager:IEditManager = new EditManager(undoManager);
-			textFlow.interactionManager = editManager;
-
-			editManager.selectRange(1,2);
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.fontWeight = FontWeight.BOLD;
-			editManager.applyLeafFormat(format);
-
-			undoManager.undo();
-		}
-
-		private function createParaIterationModel():TextFlow
-		{
-			// Creates 3 divs, each have 4 paras
-			const paraTotal:int = 4;
-			var paraCount:int;
-			const divTotal:int = 3;
-			var divCount:int;
-
-			var flow:TextFlow = new TextFlow();
-			for (var j:int = 0; j < divTotal; j++)
-			{
-				var div:DivElement = new DivElement();
-				for (var i:int = 0; i < paraTotal; i++)
-				{
-					var para:ParagraphElement = new ParagraphElement();
-					var span:SpanElement = new SpanElement();
-					span.text = paraCount.toString();
-					para.addChild(span);
-					div.addChild(para);
-					paraCount++;
-				}
-				flow.addChild(div);
-			}
-			return flow;
-		}
-
-		public function iterateParagraphForward():void
-		{
-			var flow:TextFlow = createParaIterationModel();
-			var para:ParagraphElement = flow.getFirstLeaf().getParagraph();
-			var i:int = 0;
-			while (para != null)
-			{
-				var cStr:String = para.getText();
-				assertTrue("Text not as expected", int(cStr) == i);
-				para = para.getNextParagraph();
-				i++;
-			}
-			assertTrue("Unexpected paragraph count", i == 12);
-		}
-
-		public function iterateParagraphBackward():void
-		{
-			//const kParaTerminator:String = '\u2029';
-
-			var flow:TextFlow = createParaIterationModel();
-			var para:ParagraphElement = flow.getLastLeaf().getParagraph();
-			var i:int = 11;
-			//These two tests are no longer valid due to PARB changes to removed the terminator
-			//parameter from getText on a paragraph element.
-			//
-			//var terminatorTestStr:String = para.getText("\n");
-			//assertTrue("Should have newline as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == '\n');
-			//terminatorTestStr = para.getText();
-			//assertTrue("Should have paragraph terminator as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == kParaTerminator);
-			while (para != null)
-			{
-				var cStr:String = para.getText();
-				assertTrue("Text not as expected", int(cStr) == i);
-				para = para.getPreviousParagraph();
-				i--;
-			}
-			assertTrue("Unexpected paragraph count", i == -1);
-		}
-		public function cascadeValidation():void
-		{
-			var flow:TextFlow = new TextFlow();
-			var para:ParagraphElement = new ParagraphElement();
-			var span:SpanElement = new SpanElement();
-			flow.addChild(para);
-			para.addChild(span);
-			flow.backgroundColor = 0xff;
-			assertTrue("backgroundColor should not inherit",TextLayoutFormat.backgroundColorProperty.inherited == false);
-			assertTrue("bad flow backGroundColor", flow.computedFormat.backgroundColor == 0xff);
-			assertTrue("bad para backGroundColor", para.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
-			assertTrue("bad span backGroundColor", span.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
-		}
-
-		// tests api change to automatically remove a flowelements children when using replaceChildren
-		public function elementMovingTest():void
-		{
-			var lengthBefore:int;
-
-			// this flow should have two paragraphs as children
-			var flow:TextFlow = SelManager.textFlow.deepCopy() as TextFlow;	// clone the flow
-
-			var firstPara:FlowElement = flow.getChildAt(0);
-			lengthBefore = flow.textLength;
-			//firstPara.parent.removeChild(firstPara);	// soon to no longer be needed
-			//assertTrue("elementMovingTest: removing para incorrect lengths",flow.textLength == lengthBefore-firstPara.textLength);
-
-			lengthBefore = SelManager.textFlow.textLength;
-			SelManager.textFlow.addChild(firstPara);
-			assertTrue("elementMovingTest: adding para incorrect lengths",SelManager.textFlow.textLength == lengthBefore+firstPara.textLength);
-
-			var lastLeaf:FlowElement = flow.getLastLeaf();
-			var lastLeafLength:int = lastLeaf.textLength;
-			//lastLeaf.parent.removeChild(lastLeaf);	// soon to no longer be needed
-			lengthBefore = SelManager.textFlow.textLength;
-			SelManager.textFlow.getLastLeaf().parent.addChild(lastLeaf);
-			assertTrue("elementMovingTest: adding span incorrect lengths",SelManager.textFlow.textLength == lengthBefore+lastLeafLength-1);
-		}
-
-		// Empty Flow Tests - verify that empty/partially empty TextFlow's are normalized correctly
-		public function emptyTextFlowTests():void
-		{
-			var tf:TextFlow;
-
-			// just an empty TextFlow
-			tf = new TextFlow();
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph
-			tf = new TextFlow();
-			tf.addChild(new ParagraphElement());
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph and ILG
-			tf = new TextFlow();
-			var p:ParagraphElement = new ParagraphElement();
-			p.addChild(new InlineGraphicElement());
-			tf.addChild(p);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph and empty LinkElement
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			p.addChild(new LinkElement());
-			tf.addChild(p);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph and empty TCYElement
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			p.addChild(new TCYElement());
-			tf.addChild(p);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// a more complex example
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			var tcy:TCYElement = new TCYElement();
-			tcy.addChild(new InlineGraphicElement());
-			tcy.addChild(new SpanElement());
-			p.addChild(tcy);
-			tf.addChild(p);
-			tcy.removeChildAt(1);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// several empty spans
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			tf.addChild(p);
-			p.addChild(new SpanElement());
-			p.addChild(new SpanElement());
-			p.addChild(new SpanElement());
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-		}
-		
-		public function emptyElementCopyTests():void
-		{
-			var elemList:Array = GeneralFunctionsTest.childParentTable[0];
-			for (var idx:int = 1; idx < elemList.length; idx++)
-			{
-				var elem:FlowElement = new elemList[idx];
-				elem.shallowCopy();
-				elem.deepCopy();
-			}
-		}
-
-		private function validateBitmap(actual:Bitmap, expected:Bitmap):Boolean
-		{
-			actual.bitmapData.draw(expected, null, null, "difference");
-			var bounds:Rectangle = new Rectangle(0, 0, actual.width, actual.height);
-			var diffPixels:ByteArray = actual.bitmapData.getPixels(bounds);
-			diffPixels.position = 0;
-			while (diffPixels.bytesAvailable > 0)
-			{
-				if (diffPixels.readByte() > 0)
-					return false;
-			}
-
-			return true;
-		}
-
-		private function myFontMapper(fd:FontDescription):void
-		{
-			if (fd.fontName == "Arial Black")
-			{
-				fd.fontName = "Arial";
-				fd.fontWeight = FontWeight.BOLD;
-			}
-		}
-
-		/** Tests fontMapping */
-		public function fontMappingTest():void
-		{
-			var textFlow:TextFlow = SelManager.textFlow;
-			var container:DisplayObjectContainer = DisplayObjectContainer(textFlow.flowComposer.getControllerAt(0).container);
-
-			textFlow.fontFamily = "Arial";
-			textFlow.fontWeight = FontWeight.BOLD;
-			textFlow.flowComposer.updateAllControllers();
-
-			var arialBoldBits:BitmapData = new BitmapData(container.width,container.height);
-			arialBoldBits.draw(container as DisplayObjectContainer);
-			var arialBoldData:Bitmap = new Bitmap(arialBoldBits);
-
-			textFlow.fontFamily = "Arial Black";
-			textFlow.fontWeight = undefined;
-			textFlow.flowComposer.updateAllControllers();
-
-			var arialBlackBits:BitmapData = new BitmapData(container.width,container.height);
-			arialBlackBits.draw(container as DisplayObjectContainer);
-			var arialBlackData:Bitmap = new Bitmap(arialBlackBits);
-
-			GlobalSettings.fontMapperFunction = myFontMapper;
-			textFlow.invalidateAllFormats();
-
-			try
-			{
-				textFlow.flowComposer.updateAllControllers();
-			}
-			finally
-			{
-				GlobalSettings.fontMapperFunction = null;
-				textFlow.invalidateAllFormats();
-			}
-
-			var mappedBits:BitmapData = new BitmapData(container.width,container.height);
-			mappedBits.draw(container as DisplayObjectContainer);
-			var mappedData:Bitmap = new Bitmap(mappedBits);
-
-			assertTrue("font mapping failed", validateBitmap(mappedData, arialBoldData));
-
-			textFlow.flowComposer.updateAllControllers();
-
-			var mappingClearedBits:BitmapData = new BitmapData(container.width,container.height);
-			mappingClearedBits.draw(container as DisplayObjectContainer);
-			var mappingClearedData:Bitmap = new Bitmap(mappingClearedBits);
-
-			assertTrue("clearing font mapping failed", validateBitmap(mappingClearedData, arialBlackData));
-
-		}
-
-		/** test the binary search algorithm which in findControllerIndexAtPosition - tricky bits wrt handling of zero length containers */
-		public function testFindControllerIndexAtPosition():void
-		{
-			var s:Sprite = new Sprite();	// scratch
-			var controller:ContainerController;	// scratch
-			var composer:StandardFlowComposer = new StandardFlowComposer();
-			// ideally shouldn't need TextFlow but because containercontrollers find their owning composer via the textflow its needed
-			var textFlow:TextFlow = new TextFlow();
-			textFlow.flowComposer = composer;
-			textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
-
-			controller = new ContainerController(s);
-			controller.verticalScrollPolicy = "off";
-			composer.addController(controller);
-			controller.setTextLength(100);
-			controller.verticalScrollPolicy = "off";
-
-			assertTrue("Bad result in findControllerIndexAtPosition 9",composer.findControllerIndexAtPosition(0)== 0);
-			assertTrue("Bad result in findControllerIndexAtPosition 10",composer.findControllerIndexAtPosition(100,true)== 0);
-			assertTrue("Bad result in findControllerIndexAtPosition 11",composer.findControllerIndexAtPosition(100,false)== -1);
-
-			for (var idx1:int  = 0; idx1 < 4; idx1++)
-			{
-				for (var idx2:int = 0; idx2 < 4 ; idx2++)
-				{
-					var idx:int;
-
-					composer = new StandardFlowComposer();
-					textFlow = new TextFlow();
-					textFlow.flowComposer = composer;
-					textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
-
-					// add some empties
-					for (idx = 0; idx < idx1; idx++)
-						composer.addController(new ContainerController(s));
-					// add one of length one
-					controller = new ContainerController(s);
-					controller.verticalScrollPolicy = "off";	// scrolling confuses it
-					composer.addController(controller);
-					controller.setTextLength(100);				// internal API
-					// add some empties
-					for (idx = 0; idx < idx2; idx++)
-						composer.addController(new ContainerController(s));
-					assertTrue("Bad result in findControllerIndexAtPosition 1",composer.findControllerIndexAtPosition(0)== 0);
-					assertTrue("Bad result in findControllerIndexAtPosition 2",composer.findControllerIndexAtPosition(0,true)== 0);
-					assertTrue("Bad result in findControllerIndexAtPosition 3",composer.findControllerIndexAtPosition(100,true)== idx1);
-					assertTrue("Bad result in findControllerIndexAtPosition 4",composer.findControllerIndexAtPosition(100,false)== -1);
-					// add one with some length
-					textFlow.mxmlChildren = [ "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
-					controller.setTextLength(100);
-					controller = new ContainerController(s);
-					controller.verticalScrollPolicy = "off";	// scrolling confuses it
-					composer.addController(controller);
-					controller.setTextLength(100);				// internal API
-					assertTrue("Bad result in findControllerIndexAtPosition 5",composer.findControllerIndexAtPosition(100,true)== idx1);
-					assertTrue("Bad result in findControllerIndexAtPosition 6",composer.findControllerIndexAtPosition(100,false)== idx1+1);
-					assertTrue("Bad result in findControllerIndexAtPosition 7",composer.findControllerIndexAtPosition(200,true)== idx1+idx2+1);
-					assertTrue("Bad result in findControllerIndexAtPosition 8",composer.findControllerIndexAtPosition(200,false)== -1);
-				}
-			}
-
-		}
-
-		
-		private static function checkListLines(textFlow:TextFlow,numLines:int,prefix:String):void
-		{
-			for (var idx:int = 0; idx < numLines; idx++)
-			{
-				var tfl:TextFlowLine = textFlow.flowComposer.getLineAt(idx);
-				assertTrue(prefix+": Missing TextFlowLine: "+idx,tfl != null);
-				var textLine:TextLine = tfl.getTextLine();
-				assertTrue(prefix+": Missing TextLine: "+idx,textLine != null);
-				var numberLine:TextLine = textLine.getChildAt(0) as TextLine;
-				assertTrue(prefix+": Missing NumberLine: "+idx,numberLine != null);
-				/* var numberString:String = numberLine.userData as String;
-				var expectedString:String = (idx+1).toString() + ".";	// for numeric lists
-				assertTrue(prefix+": NumberLine missing userData: "+idx,numberString != null);
-				assertTrue(prefix+": Incorrect NumberLine userData: "+idx,numberLine.userData as String == expectedString); 
-				assertTrue(prefix+": Incorrect NumberLine rawTextLength: "+idx,numberString.length+1 == numberLine.rawTextLength); */
-			}
-		}
-		
-		public function listItemInsertion():void
-		{
-			// some validations that ensure ListElement is correctly setup for list processing
-			
-			// every ListStyleType must have an entry in ListElement.listSuffixes
-			var handler:EnumPropertyHandler = TextLayoutFormat.listStyleTypeProperty.findHandler(EnumPropertyHandler) as EnumPropertyHandler;
-			assertTrue("listItemInsertion: missing handler for ListStyleType", handler != null && handler.range != null);
-
-			var	range:Object = handler.range;
-			var value:String;
-			
-			var numberedListStyles:Object = { };
-			for (value in ListElement.algorithmicListStyles)
-			{
-				assertTrue("listItemInsertion: table entry duplicated",numberedListStyles[value] === undefined);
-				numberedListStyles[value] = ListElement.algorithmicListStyles[value];
-			}
-			for (value in ListElement.numericListStyles)
-			{
-				assertTrue("listItemInsertion: table entry duplicated",numberedListStyles[value] === undefined);
-				numberedListStyles[value] = ListElement.numericListStyles[value];
-			}
-			for (value in ListElement.alphabeticListStyles)
-			{
-				assertTrue("listItemInsertion: table entry duplicated",numberedListStyles[value] === undefined);
-				numberedListStyles[value] = ListElement.alphabeticListStyles[value];
-			}
-			
-			for (value in range)
-			{
-				if (value != FormatValue.INHERIT)
-				{
-					// must be a numbered list or an unnumbered list but not both
-					assertTrue("listItemInsertion: listStyleType must be numbered or unnumbered but not both: "+value,
-						numberedListStyles[value] !== undefined && ListElement.constantListStyles[value] === undefined
-						|| numberedListStyles[value] === undefined && ListElement.constantListStyles[value] !== undefined)
-					// numbered lists must have a suffix
-					if ( ListElement.constantListStyles[value] === undefined)
-						assertTrue("listItemInsertion: missing suffix property: " + value,ListElement.listSuffixes[value] !== undefined);
-				}
-			}
-			
-			// verify that all constantListStyles are in range
-			for (value in ListElement.constantListStyles)
-				assertTrue("listItemInsertion: invalid value in constantListStyles: " + value, range[value] !== undefined);
-			// verify that all numberedListStyles are in range
-			for (value in numberedListStyles)
-				assertTrue("listItemInsertion: invalid value in numberedListStyles: " + value, range[value] !== undefined);
-			// verify that all listSuffixes are in range
-			for (value in ListElement.listSuffixes)
-				assertTrue("listItemInsertion: invalid value in listSuffixes: " + value, range[value] !== undefined);			
-				
-			SelManager.selectRange(0,0);
-
-			// remove all the children and put in a list
-			var textFlow:TextFlow = SelManager.textFlow;
-			
-			textFlow.replaceChildren(0,textFlow.numChildren);
-			
-			var list:ListElement = new ListElement();
-			list.listStyleType = ListStyleType.DECIMAL;
-			
-			textFlow.addChild(list);
-			var item:ListItemElement = new ListItemElement();
-			list.addChild(item);
-			
-			textFlow.flowComposer.updateAllControllers();
-			
-			assertTrue("listItemInsertion: incorrect normalize",textFlow.findAbsoluteParagraph(0).parent == item);
-			
-			// append two items and compose
-			list.addChild(new ListItemElement());
-			list.addChild(new ListItemElement());
-			textFlow.flowComposer.updateAllControllers();
-			
-			// check the three textlines
-			checkListLines(textFlow,3,"listItemInsertion1");
-			
-			// now insert a brand new ListItem at the head and verify
-			list.replaceChildren(0,0,new ListItemElement());
-			textFlow.flowComposer.updateAllControllers();
-			
-			// check four textlines
-			checkListLines(textFlow,4,"listItemInsertion2");
-			
-			// remove a list item
-			list.removeChildAt(1);
-			textFlow.flowComposer.updateAllControllers();
-			
-			// check three textLines
-			checkListLines(textFlow,3,"listItemInsertion3");
-			
-			// add another list in the first ListItemElement
-			item = list.getChildAt(0) as ListItemElement;
-			var newList:ListElement = new ListElement();
-			item.addChild(newList);
-			textFlow.flowComposer.updateAllControllers();
-			
-			// assert the empty list is deleted
-			assertTrue("listItemInsertion: newList not normalized",newList.numChildren == 1);
-
-		}
-		
-		public function testFTETextField():void
-		{
-			// use the TextFlow's container
-			var fieldParent:Sprite = SelManager.textFlow.flowComposer.getControllerAt(0).container;
-			// remove the controller so the the textFlow isn't displayed in it
-			SelManager.textFlow.flowComposer.removeControllerAt(0);
-			
-			var field:FTETextField = new FTETextField();
-			field.htmlText = "Hello world";
-			fieldParent.addChild(field);
-		}
-		
-		public function replaceChildrenTest():void
-		{
-			SelManager.selectRange(0,0);
-			
-			// remove all the children 
-			var textFlow:TextFlow = SelManager.textFlow;
-			textFlow.replaceChildren(0,textFlow.numChildren);
-			
-			var p:ParagraphElement = new ParagraphElement();
-			textFlow.addChild(p);
-			
-			var link:LinkElement = new LinkElement();
-			link.href = "XXX";
-			p.addChild(link);
-			var span:SpanElement = new SpanElement();
-			span.text = "Hello, ";
-			span.fontSize = 24;
-			link.addChild(span);
-			
-			var link2:LinkElement = new LinkElement();
-			link2.href = "YYY";
-			p.addChild(link2);
-			
-			var span2:SpanElement = new SpanElement();
-			span2.text = "world ";
-			span2.fontSize = 24;
-			link2.addChild(span2);
-			
-			textFlow.flowComposer.updateAllControllers();
-			
-			link.replaceChildren(link2.numChildren,link2.numChildren,link2.mxmlChildren);
-			p.removeChild(link2);
-			textFlow.flowComposer.updateAllControllers();
-			
-			assertTrue("replaceChildrenTest: extra line - look for extra terminator",textFlow.flowComposer.numLines == 1);
-		}
-		
-		private function myFontLookup(context:mySwfContext, tlf:ITextLayoutFormat):Function
-		{
-			return myFontLookup;
-		}
-		
-		public function resolveFontLookupTest():void
-		{
-			var textFlow:TextFlow = SelManager.textFlow;
-			
-			textFlow.fontFamily = "Arial";
-			textFlow.fontWeight = FontWeight.BOLD;
-			textFlow.fontLookup = "device";
-			textFlow.flowComposer.updateAllControllers();
-			
-			var swfContext:mySwfContext = new mySwfContext();
-			try
-			{
-				GlobalSettings.resolveFontLookupFunction = myFontLookup(swfContext, textFlow.format);
-				textFlow.flowComposer.updateAllControllers();
-				assertTrue ("fontLookup not matched.", textFlow.fontLookup = swfContext.myFontlookup);
-			}
-			finally
-			{
-				GlobalSettings.resolveFontLookupFunction = null;
-			}
-		}
-		
-		public function bindableSpan():void
-		{
-			// Bindable span should not lose its formatting
-			var textFlow:TextFlow = new TextFlow();
-			var paragraph:ParagraphElement =  new ParagraphElement();
-			var span1:SpanElement = new SpanElement();
-			var span2:SpanElement = new SpanElement();
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.fontWeight = FontWeight.BOLD;
-			span2.format = format;
-			paragraph.mxmlChildren = [ span1, span2 ];
-			textFlow.mxmlChildren = [ paragraph ];
-			textFlow.flowComposer.addController(new ContainerController(new Sprite()));
-			textFlow.flowComposer.compose();		// force normalize
-			assertTrue("Spans should not be merged!", span2.parent == span1.parent && paragraph.numChildren == 2);
-			assertTrue("Formatting on second span should be preserved!", span2.fontWeight == FontWeight.BOLD);
-		}
-		
-		// This test does not work in our current build environment, since playerEnablesSpicyFeatures will always be false.
-		// Once we have a method of compiling VellumUnit as a 10.2 swf, this test should be enabled.
-		public function softKeyboardFlagTest():void
-		{
-			if (Configuration.playerEnablesSpicyFeatures)	// only run the rest of the test if we're in 10.2 or higher
-			{
-				// test 1 - add controller, then interaction manager
-				var sprite:Sprite = new Sprite();
-				var textFlow:TextFlow = new TextFlow();
-				textFlow.flowComposer.addController(new ContainerController(sprite));
-				textFlow.interactionManager = new EditManager();
-				assertTrue("needsSoftKeyboard should be true after adding EditManager", sprite["needsSoftKeyboard"] == true);
-				// test 2 - add another controller
-				var sprite1:Sprite = new Sprite();
-				textFlow.flowComposer.addController(new ContainerController(sprite1));
-				assertTrue("needsSoftKeyboard should be true for a second container", sprite1["needsSoftKeyboard"] == true);		
-
-				// test 3 - add interaction manager, then controller
-				var sprite2:Sprite = new Sprite();
-				var textFlow2:TextFlow = new TextFlow();
-				textFlow2.interactionManager = new EditManager();
-				textFlow2.flowComposer.addController(new ContainerController(sprite2));
-				assertTrue("needsSoftKeyboard should be true after adding controller", sprite2["needsSoftKeyboard"] == true);
-			}
-		}
-	}
+    public class FlowModelTest extends VellumTestCase
+    {
+        private var beginTime:int;
+
+        public function FlowModelTest()
+        {
+            super("", "FlowModelTest", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Text Container";
+            metaData.productSubArea = "Flow";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        /**
+         * Direct usage of the flow APIs. No validation - just look for crashes.
+         * This test changes the color of the entire text.
+         */
+        public function basicAPITest1():void
+        {
+            // set the color on the entire flow
+            beginAPITest();
+            SelManager.textFlow.color = 0xff0000;
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Direct usage of the flow APIs. No validation - just look for crashes.
+         * This test deletes every other character in the entire text.
+         */
+        public function basicAPITest2():void
+        {
+            // delete every other character in the textflow
+            beginAPITest();
+
+            var idx:int = 0;
+            while (idx < SelManager.textFlow.textLength)
+            {
+                var span:SpanElement = SelManager.textFlow.findLeaf(idx) as SpanElement;
+                if (span)
+                {
+                    var spanStart:int = span.getAbsoluteStart();
+                    span.replaceText(idx - spanStart, idx - spanStart + 1, null);
+                }
+                idx++;
+
+            }
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Direct usage of the flow APIs. No validation - just look for crashes.
+         * This test adds another paragraph to the flow containing the text "Hello World"
+         * in 24 point font.
+         */
+        public function basicAPITest3():void
+        {
+            // add a paragraph
+            beginAPITest();
+            var p:ParagraphElement = new ParagraphElement();
+            var s:SpanElement = new SpanElement();
+            s.text = "Hello world";
+            s.fontSize = 24;
+            p.replaceChildren(0, 0, s);
+            SelManager.textFlow.replaceChildren(SelManager.textFlow.numChildren, SelManager.textFlow.numChildren, p);
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * This test performs a series of changes and validates the changes after they're performed.
+         */
+        public function basicAPITest4():void
+        {
+            // more comprehensive set of tests - several manipulations to the flow and then display it
+
+            // generic begin to an API test
+            beginAPITest();
+
+            // get the textflow
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            // remove all the textflow children
+            textFlow.replaceChildren(0, textFlow.numChildren);
+            assertTrue("expected no elements on the flow, but found " + textFlow.numChildren,
+                    textFlow.numChildren == 0);
+
+            // create a paragraph
+            var p:ParagraphElement = new ParagraphElement();
+
+            // create a span
+            var s:SpanElement = new SpanElement();
+            s.text = "Hello world. ";
+            s.fontSize = 24;
+
+            // split the span
+            var nextSpan:SpanElement = s.splitAtPosition(6) as SpanElement;
+            // set the color - color can be a string or an unsigned integer
+            nextSpan.color = "0xff";
+            assertTrue("expected that the color would be 255, but found " + uint(nextSpan.format.color),
+                    uint(nextSpan.format.color) == 255);
+
+            // put the two spans in the paragraph
+            p.replaceChildren(0, 0, s);
+            p.replaceChildren(1, 1, nextSpan);
+
+            assertTrue("expected the element count to be 2, but it was " + p.numChildren,
+                    p.numChildren == 2);
+
+            // add another span
+            s = new SpanElement();
+            s.text = "Start:"
+            p.replaceChildren(0, 0, s);
+
+            // put the paragraph in the TextFlow
+            textFlow.replaceChildren(0, 0, p);
+            assertTrue("text flow should have one element but has " + textFlow.numChildren,
+                    textFlow.numChildren == 1);
+
+            // make another paragraph
+            p = new ParagraphElement();
+            s = new SpanElement();
+            p.replaceChildren(0, 0, s);
+            s.text = "NEW FIRST PARAGRAPH";
+
+            // set the paragraph attributes directly
+            p.textIndent = 20;
+            // set the paragraph attributes via clone and set
+            var pa:TextLayoutFormat = new TextLayoutFormat(p.format);
+            pa.textAlign = TextAlign.RIGHT;
+            p.format = pa;
+
+            // into the textFlow at the beginning
+            textFlow.replaceChildren(0, 0, p);
+
+            // generic end to an API test
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * This test inserts an FE in the middle of a paragraph
+         */
+        public function basicAPITest5():void
+        {
+            // more comprehensive set of tests - several manipulations to the flow and then display it
+
+            // generic begin to an API test
+            beginAPITest();
+
+            // get the textflow
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            // create a paragraph empty the flow and insert it
+            var p:ParagraphElement = new ParagraphElement();
+            textFlow.replaceChildren(0, textFlow.numChildren, p);
+
+            // create a span
+            var s:SpanElement = new SpanElement();
+            s.text = "Hello world. ";
+            s.fontSize = 24;
+
+            // put it in the paragraph
+            p.replaceChildren(0, 0, s);
+
+            // split the span
+            var nextSpanElement:SpanElement = s.splitAtPosition(6) as SpanElement;
+            assertTrue("Incorrect elementCount after split", p.numChildren == 2);
+
+            // create and insert an image between the spans
+            var image:InlineGraphicElement = new InlineGraphicElement();
+            image.width = 19;
+            image.height = 19;
+            image.source = LoaderUtil.createAbsoluteURL(baseURL, "../../test/testFiles/assets/surprised.png");
+            p.replaceChildren(1, 1, image);
+
+            assertTrue("failed length on new InlineGraphicElement", image.textLength == 1);
+            assertTrue("failed elementCount after image insert", p.numChildren == 3);
+            assertTrue("bad first child", p.getChildAt(0) is SpanElement);
+            assertTrue("bad first child", p.getChildAt(1) is InlineGraphicElement);
+            assertTrue("bad first child", p.getChildAt(2) is SpanElement);
+
+            // set a userStyle on a ContainerController
+            var saveFormat:ITextLayoutFormat = ContainerController.containerControllerInitialFormat;
+            try
+            {
+                ContainerController.containerControllerInitialFormat = null;
+                var controller:ContainerController = new ContainerController(new Sprite());
+                controller.setStyle("foo", "blah");
+            }
+            catch (e:Error)
+            {
+                ContainerController.containerControllerInitialFormat = saveFormat;
+                throw(e);
+            }
+            ContainerController.containerControllerInitialFormat = saveFormat;
+
+            // generic end to an API test
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Test setting hostCharacterFormat on the TextFlow
+         */
+        public function textFlowHostCharacterFormat():void
+        {
+            // generic begin to an API test
+            beginAPITest();
+
+            // get the textflow
+            var textFlow:TextFlow = SelManager.textFlow;
+            var leaf:FlowLeafElement = textFlow.getFirstLeaf();
+
+            // make it red
+            var cf:TextLayoutFormat = new TextLayoutFormat();
+            cf.color = 0xff0000;
+            textFlow.hostFormat = cf;
+            assertTrue("host character format set color failed", leaf.computedFormat.color == 0xff0000);
+
+            // make it blue
+            textFlow.color = 0xff;
+            assertTrue("textFlow character format color override failed", leaf.computedFormat.color == 0xff);
+
+            // clear the blue
+            textFlow.color = undefined;
+            assertTrue("textFlow color clear failed", leaf.computedFormat.color == 0xff0000);
+
+            // clear the hostCharacterFormat
+            textFlow.hostFormat = null;
+            assertTrue("host character format clear failed", leaf.computedFormat.color == 0);
+
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Insert a link to a paragraph that hasn't ever been updated.
+         */
+        public function insertLinkNoUpdateAPI():void
+        {
+            var textFlow:TextFlow = new TextFlow();
+            var p:ParagraphElement = new ParagraphElement();
+            var link:LinkElement = new LinkElement();
+            link.href = "http://www.cnn.com";
+            link.target = "_self";
+            var span:SpanElement = new SpanElement();
+            span.text = "aaa";
+            link.replaceChildren(0, 0, span);
+            p.replaceChildren(0, 0, link);
+            textFlow.replaceChildren(0, 0, p);
+        }
+
+        [Test]
+        /**
+         *
+         */
+        public function insertLinkNoUpdateViaEditManager():void
+        {
+            var textFlow:TextFlow = initTextFlowAAA();
+            var editManager:IEditManager = new EditManager();
+            textFlow.interactionManager = editManager;
+
+            editManager.selectRange(1, 2);
+            editManager.applyLink("http://livedocs.adobe.com/", "_self", true);
+        }
+
+        [Test]
+        /**
+         * undo in a flow that has no controllers
+         */
+        public function testUndo():void
+        {
+            var textFlow:TextFlow = initTextFlowAAA();
+            var undoManager:IUndoManager = new UndoManager();
+            var editManager:IEditManager = new EditManager(undoManager);
+            textFlow.interactionManager = editManager;
+
+            editManager.selectRange(1, 2);
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.fontWeight = FontWeight.BOLD;
+            editManager.applyLeafFormat(format);
+
+            undoManager.undo();
+        }
+
+        [Test]
+        public function iterateParagraphForward():void
+        {
+            var flow:TextFlow = createParaIterationModel();
+            var para:ParagraphElement = flow.getFirstLeaf().getParagraph();
+            var i:int = 0;
+            while (para != null)
+            {
+                var cStr:String = para.getText();
+                assertTrue("Text not as expected", int(cStr) == i);
+                para = para.getNextParagraph();
+                i++;
+            }
+            assertTrue("Unexpected paragraph count", i == 12);
+        }
+
+        [Test]
+        public function iterateParagraphBackward():void
+        {
+            //const kParaTerminator:String = '\u2029';
+
+            var flow:TextFlow = createParaIterationModel();
+            var para:ParagraphElement = flow.getLastLeaf().getParagraph();
+            var i:int = 11;
+            //These two tests are no longer valid due to PARB changes to removed the terminator
+            //parameter from getText on a paragraph element.
+            //
+            //var terminatorTestStr:String = para.getText("\n");
+            //assertTrue("Should have newline as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == '\n');
+            //terminatorTestStr = para.getText();
+            //assertTrue("Should have paragraph terminator as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == kParaTerminator);
+            while (para != null)
+            {
+                var cStr:String = para.getText();
+                assertTrue("Text not as expected", int(cStr) == i);
+                para = para.getPreviousParagraph();
+                i--;
+            }
+            assertTrue("Unexpected paragraph count", i == -1);
+        }
+
+        [Test]
+        public function cascadeValidation():void
+        {
+            var flow:TextFlow = new TextFlow();
+            var para:ParagraphElement = new ParagraphElement();
+            var span:SpanElement = new SpanElement();
+            flow.addChild(para);
+            para.addChild(span);
+            flow.backgroundColor = 0xff;
+            assertTrue("backgroundColor should not inherit", TextLayoutFormat.backgroundColorProperty.inherited == false);
+            assertTrue("bad flow backGroundColor", flow.computedFormat.backgroundColor == 0xff);
+            assertTrue("bad para backGroundColor", para.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
+            assertTrue("bad span backGroundColor", span.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
+        }
+
+        [Test]
+        /**
+         * tests api change to automatically remove a flowelements children when using replaceChildren
+         */
+        public function elementMovingTest():void
+        {
+            var lengthBefore:int;
+
+            // this flow should have two paragraphs as children
+            var flow:TextFlow = SelManager.textFlow.deepCopy() as TextFlow;	// clone the flow
+
+            var firstPara:FlowElement = flow.getChildAt(0);
+            lengthBefore = flow.textLength;
+            //firstPara.parent.removeChild(firstPara);	// soon to no longer be needed
+            //assertTrue("elementMovingTest: removing para incorrect lengths",flow.textLength == lengthBefore-firstPara.textLength);
+
+            lengthBefore = SelManager.textFlow.textLength;
+            SelManager.textFlow.addChild(firstPara);
+            assertTrue("elementMovingTest: adding para incorrect lengths", SelManager.textFlow.textLength == lengthBefore + firstPara.textLength);
+
+            var lastLeaf:FlowElement = flow.getLastLeaf();
+            var lastLeafLength:int = lastLeaf.textLength;
+            //lastLeaf.parent.removeChild(lastLeaf);	// soon to no longer be needed
+            lengthBefore = SelManager.textFlow.textLength;
+            SelManager.textFlow.getLastLeaf().parent.addChild(lastLeaf);
+            assertTrue("elementMovingTest: adding span incorrect lengths", SelManager.textFlow.textLength == lengthBefore + lastLeafLength - 1);
+        }
+
+        [Test]
+        /**
+         * Empty Flow Tests - verify that empty/partially empty TextFlow's are normalized correctly
+         */
+        public function emptyTextFlowTests():void
+        {
+            var tf:TextFlow;
+
+            // just an empty TextFlow
+            tf = new TextFlow();
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph
+            tf = new TextFlow();
+            tf.addChild(new ParagraphElement());
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph and ILG
+            tf = new TextFlow();
+            var p:ParagraphElement = new ParagraphElement();
+            p.addChild(new InlineGraphicElement());
+            tf.addChild(p);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph and empty LinkElement
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            p.addChild(new LinkElement());
+            tf.addChild(p);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph and empty TCYElement
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            p.addChild(new TCYElement());
+            tf.addChild(p);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // a more complex example
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            var tcy:TCYElement = new TCYElement();
+            tcy.addChild(new InlineGraphicElement());
+            tcy.addChild(new SpanElement());
+            p.addChild(tcy);
+            tf.addChild(p);
+            tcy.removeChildAt(1);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // several empty spans
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            tf.addChild(p);
+            p.addChild(new SpanElement());
+            p.addChild(new SpanElement());
+            p.addChild(new SpanElement());
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+        }
+
+        [Test]
+        public function emptyElementCopyTests():void
+        {
+            var elemList:Array = GeneralFunctionsTest.childParentTable[0];
+            for (var idx:int = 1; idx < elemList.length; idx++)
+            {
+                var elem:FlowElement = new elemList[idx];
+                elem.shallowCopy();
+                elem.deepCopy();
+            }
+        }
+
+        [Test]
+        /**
+         * Tests fontMapping
+         */
+        public function fontMappingTest():void
+        {
+            var textFlow:TextFlow = SelManager.textFlow;
+            var container:DisplayObjectContainer = DisplayObjectContainer(textFlow.flowComposer.getControllerAt(0).container);
+
+            textFlow.fontFamily = "Arial";
+            textFlow.fontWeight = FontWeight.BOLD;
+            textFlow.flowComposer.updateAllControllers();
+
+            var arialBoldBits:BitmapData = new BitmapData(container.width, container.height);
+            arialBoldBits.draw(container as DisplayObjectContainer);
+            var arialBoldData:Bitmap = new Bitmap(arialBoldBits);
+
+            textFlow.fontFamily = "Arial Black";
+            textFlow.fontWeight = undefined;
+            textFlow.flowComposer.updateAllControllers();
+
+            var arialBlackBits:BitmapData = new BitmapData(container.width, container.height);
+            arialBlackBits.draw(container as DisplayObjectContainer);
+            var arialBlackData:Bitmap = new Bitmap(arialBlackBits);
+
+            GlobalSettings.fontMapperFunction = myFontMapper;
+            textFlow.invalidateAllFormats();
+
+            try
+            {
+                textFlow.flowComposer.updateAllControllers();
+            }
+            finally
+            {
+                GlobalSettings.fontMapperFunction = null;
+                textFlow.invalidateAllFormats();
+            }
+
+            var mappedBits:BitmapData = new BitmapData(container.width, container.height);
+            mappedBits.draw(container as DisplayObjectContainer);
+            var mappedData:Bitmap = new Bitmap(mappedBits);
+
+            assertTrue("font mapping failed", validateBitmap(mappedData, arialBoldData));
+
+            textFlow.flowComposer.updateAllControllers();
+
+            var mappingClearedBits:BitmapData = new BitmapData(container.width, container.height);
+            mappingClearedBits.draw(container as DisplayObjectContainer);
+            var mappingClearedData:Bitmap = new Bitmap(mappingClearedBits);
+
+            assertTrue("clearing font mapping failed", validateBitmap(mappingClearedData, arialBlackData));
+
+        }
+
+        [Test]
+        /**
+         * test the binary search algorithm which in findControllerIndexAtPosition - tricky bits wrt handling of zero length containers
+         */
+        public function testFindControllerIndexAtPosition():void
+        {
+            var s:Sprite = new Sprite();	// scratch
+            var controller:ContainerController;	// scratch
+            var composer:StandardFlowComposer = new StandardFlowComposer();
+            // ideally shouldn't need TextFlow but because containercontrollers find their owning composer via the textflow its needed
+            var textFlow:TextFlow = new TextFlow();
+            textFlow.flowComposer = composer;
+            textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
+
+            controller = new ContainerController(s);
+            controller.verticalScrollPolicy = "off";
+            composer.addController(controller);
+            controller.setTextLength(100);
+            controller.verticalScrollPolicy = "off";
+
+            assertTrue("Bad result in findControllerIndexAtPosition 9", composer.findControllerIndexAtPosition(0) == 0);
+            assertTrue("Bad result in findControllerIndexAtPosition 10", composer.findControllerIndexAtPosition(100, true) == 0);
+            assertTrue("Bad result in findControllerIndexAtPosition 11", composer.findControllerIndexAtPosition(100, false) == -1);
+
+            for (var idx1:int = 0; idx1 < 4; idx1++)
+            {
+                for (var idx2:int = 0; idx2 < 4; idx2++)
+                {
+                    var idx:int;
+
+                    composer = new StandardFlowComposer();
+                    textFlow = new TextFlow();
+                    textFlow.flowComposer = composer;
+                    textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
+
+                    // add some empties
+                    for (idx = 0; idx < idx1; idx++)
+                        composer.addController(new ContainerController(s));
+                    // add one of length one
+                    controller = new ContainerController(s);
+                    controller.verticalScrollPolicy = "off";	// scrolling confuses it
+                    composer.addController(controller);
+                    controller.setTextLength(100);				// internal API
+                    // add some empties
+                    for (idx = 0; idx < idx2; idx++)
+                        composer.addController(new ContainerController(s));
+                    assertTrue("Bad result in findControllerIndexAtPosition 1", composer.findControllerIndexAtPosition(0) == 0);
+                    assertTrue("Bad result in findControllerIndexAtPosition 2", composer.findControllerIndexAtPosition(0, true) == 0);
+                    assertTrue("Bad result in findControllerIndexAtPosition 3", composer.findControllerIndexAtPosition(100, true) == idx1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 4", composer.findControllerIndexAtPosition(100, false) == -1);
+                    // add one with some length
+                    textFlow.mxmlChildren = [ "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
+                    controller.setTextLength(100);
+                    controller = new ContainerController(s);
+                    controller.verticalScrollPolicy = "off";	// scrolling confuses it
+                    composer.addController(controller);
+                    controller.setTextLength(100);				// internal API
+                    assertTrue("Bad result in findControllerIndexAtPosition 5", composer.findControllerIndexAtPosition(100, true) == idx1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 6", composer.findControllerIndexAtPosition(100, false) == idx1 + 1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 7", composer.findControllerIndexAtPosition(200, true) == idx1 + idx2 + 1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 8", composer.findControllerIndexAtPosition(200, false) == -1);
+                }
+            }
+
+        }
+
+        [Test]
+        public function listItemInsertion():void
+        {
+            // some validations that ensure ListElement is correctly setup for list processing
+
+            // every ListStyleType must have an entry in ListElement.listSuffixes
+            var handler:EnumPropertyHandler = TextLayoutFormat.listStyleTypeProperty.findHandler(EnumPropertyHandler) as EnumPropertyHandler;
+            assertTrue("listItemInsertion: missing handler for ListStyleType", handler != null && handler.range != null);
+
+            var range:Object = handler.range;
+            var value:String;
+
+            var numberedListStyles:Object = { };
+            for (value in ListElement.algorithmicListStyles)
+            {
+                assertTrue("listItemInsertion: table entry duplicated", numberedListStyles[value] === undefined);
+                numberedListStyles[value] = ListElement.algorithmicListStyles[value];
+            }
+            for (value in ListElement.numericListStyles)
+            {
+                assertTrue("listItemInsertion: table entry duplicated", numberedListStyles[value] === undefined);
+                numberedListStyles[value] = ListElement.numericListStyles[value];
+            }
+            for (value in ListElement.alphabeticListStyles)
+            {
+                assertTrue("listItemInsertion: table entry duplicated", numberedListStyles[value] === undefined);
+                numberedListStyles[value] = ListElement.alphabeticListStyles[value];
+            }
+
+            for (value in range)
+            {
+                if (value != FormatValue.INHERIT)
+                {
+                    // must be a numbered list or an unnumbered list but not both
+                    assertTrue("listItemInsertion: listStyleType must be numbered or unnumbered but not both: " + value,
+                            numberedListStyles[value] !== undefined && ListElement.constantListStyles[value] === undefined
+                                    || numberedListStyles[value] === undefined && ListElement.constantListStyles[value] !== undefined)
+                    // numbered lists must have a suffix
+                    if (ListElement.constantListStyles[value] === undefined)
+                        assertTrue("listItemInsertion: missing suffix property: " + value, ListElement.listSuffixes[value] !== undefined);
+                }
+            }
+
+            // verify that all constantListStyles are in range
+            for (value in ListElement.constantListStyles)
+                assertTrue("listItemInsertion: invalid value in constantListStyles: " + value, range[value] !== undefined);
+            // verify that all numberedListStyles are in range
+            for (value in numberedListStyles)
+                assertTrue("listItemInsertion: invalid value in numberedListStyles: " + value, range[value] !== undefined);
+            // verify that all listSuffixes are in range
+            for (value in ListElement.listSuffixes)
+                assertTrue("listItemInsertion: invalid value in listSuffixes: " + value, range[value] !== undefined);
+
+            SelManager.selectRange(0, 0);
+
+            // remove all the children and put in a list
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            textFlow.replaceChildren(0, textFlow.numChildren);
+
+            var list:ListElement = new ListElement();
+            list.listStyleType = ListStyleType.DECIMAL;
+
+            textFlow.addChild(list);
+            var item:ListItemElement = new ListItemElement();
+            list.addChild(item);
+
+            textFlow.flowComposer.updateAllControllers();
+
+            assertTrue("listItemInsertion: incorrect normalize", textFlow.findAbsoluteParagraph(0).parent == item);
+
+            // append two items and compose
+            list.addChild(new ListItemElement());
+            list.addChild(new ListItemElement());
+            textFlow.flowComposer.updateAllControllers();
+
+            // check the three textlines
+            checkListLines(textFlow, 3, "listItemInsertion1");
+
+            // now insert a brand new ListItem at the head and verify
+            list.replaceChildren(0, 0, new ListItemElement());
+            textFlow.flowComposer.updateAllControllers();
+
+            // check four textlines
+            checkListLines(textFlow, 4, "listItemInsertion2");
+
+            // remove a list item
+            list.removeChildAt(1);
+            textFlow.flowComposer.updateAllControllers();
+
+            // check three textLines
+            checkListLines(textFlow, 3, "listItemInsertion3");
+
+            // add another list in the first ListItemElement
+            item = list.getChildAt(0) as ListItemElement;
+            var newList:ListElement = new ListElement();
+            item.addChild(newList);
+            textFlow.flowComposer.updateAllControllers();
+
+            // assert the empty list is deleted
+            assertTrue("listItemInsertion: newList not normalized", newList.numChildren == 1);
+
+        }
+
+        [Test]
+        public function testFTETextField():void
+        {
+            // use the TextFlow's container
+            var fieldParent:Sprite = SelManager.textFlow.flowComposer.getControllerAt(0).container;
+            // remove the controller so the the textFlow isn't displayed in it
+            SelManager.textFlow.flowComposer.removeControllerAt(0);
+
+            var field:FTETextField = new FTETextField();
+            field.htmlText = "Hello world";
+            fieldParent.addChild(field);
+        }
+
+        [Test]
+        public function replaceChildrenTest():void
+        {
+            SelManager.selectRange(0, 0);
+
+            // remove all the children
+            var textFlow:TextFlow = SelManager.textFlow;
+            textFlow.replaceChildren(0, textFlow.numChildren);
+
+            var p:ParagraphElement = new ParagraphElement();
+            textFlow.addChild(p);
+
+            var link:LinkElement = new LinkElement();
+            link.href = "XXX";
+            p.addChild(link);
+            var span:SpanElement = new SpanElement();
+            span.text = "Hello, ";
+            span.fontSize = 24;
+            link.addChild(span);
+
+            var link2:LinkElement = new LinkElement();
+            link2.href = "YYY";
+            p.addChild(link2);
+
+            var span2:SpanElement = new SpanElement();
+            span2.text = "world ";
+            span2.fontSize = 24;
+            link2.addChild(span2);
+
+            textFlow.flowComposer.updateAllControllers();
+
+            link.replaceChildren(link2.numChildren, link2.numChildren, link2.mxmlChildren);
+            p.removeChild(link2);
+            textFlow.flowComposer.updateAllControllers();
+
+            assertTrue("replaceChildrenTest: extra line - look for extra terminator", textFlow.flowComposer.numLines == 1);
+        }
+
+        [Test]
+        public function resolveFontLookupTest():void
+        {
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            textFlow.fontFamily = "Arial";
+            textFlow.fontWeight = FontWeight.BOLD;
+            textFlow.fontLookup = "device";
+            textFlow.flowComposer.updateAllControllers();
+
+            var swfContext:mySwfContext = new mySwfContext();
+            try
+            {
+                GlobalSettings.resolveFontLookupFunction = myFontLookup(swfContext, textFlow.format);
+                textFlow.flowComposer.updateAllControllers();
+                assertTrue("fontLookup not matched.", textFlow.fontLookup = swfContext.myFontlookup);
+            }
+            finally
+            {
+                GlobalSettings.resolveFontLookupFunction = null;
+            }
+        }
+
+        [Test]
+        public function bindableSpan():void
+        {
+            // Bindable span should not lose its formatting
+            var textFlow:TextFlow = new TextFlow();
+            var paragraph:ParagraphElement = new ParagraphElement();
+            var span1:SpanElement = new SpanElement();
+            var span2:SpanElement = new SpanElement();
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.fontWeight = FontWeight.BOLD;
+            span2.format = format;
+            paragraph.mxmlChildren = [ span1, span2 ];
+            textFlow.mxmlChildren = [ paragraph ];
+            textFlow.flowComposer.addController(new ContainerController(new Sprite()));
+            textFlow.flowComposer.compose();		// force normalize
+            assertTrue("Spans should not be merged!", span2.parent == span1.parent && paragraph.numChildren == 2);
+            assertTrue("Formatting on second span should be preserved!", span2.fontWeight == FontWeight.BOLD);
+        }
+
+        [Test]
+        /**
+         *  This test does not work in our current build environment, since playerEnablesSpicyFeatures will always be false.
+         *  Once we have a method of compiling VellumUnit as a 10.2 swf, this test should be enabled.
+         */
+        public function softKeyboardFlagTest():void
+        {
+            if (Configuration.playerEnablesSpicyFeatures)	// only run the rest of the test if we're in 10.2 or higher
+            {
+                // test 1 - add controller, then interaction manager
+                var sprite:Sprite = new Sprite();
+                var textFlow:TextFlow = new TextFlow();
+                textFlow.flowComposer.addController(new ContainerController(sprite));
+                textFlow.interactionManager = new EditManager();
+                assertTrue("needsSoftKeyboard should be true after adding EditManager", sprite["needsSoftKeyboard"] == true);
+                // test 2 - add another controller
+                var sprite1:Sprite = new Sprite();
+                textFlow.flowComposer.addController(new ContainerController(sprite1));
+                assertTrue("needsSoftKeyboard should be true for a second container", sprite1["needsSoftKeyboard"] == true);
+
+                // test 3 - add interaction manager, then controller
+                var sprite2:Sprite = new Sprite();
+                var textFlow2:TextFlow = new TextFlow();
+                textFlow2.interactionManager = new EditManager();
+                textFlow2.flowComposer.addController(new ContainerController(sprite2));
+                assertTrue("needsSoftKeyboard should be true after adding controller", sprite2["needsSoftKeyboard"] == true);
+            }
+        }
+
+
+        private function beginAPITest():void
+        {
+            beginTime = getTimer();
+            SelManager.selectRange(-1, -1);
+        }
+
+        private function endAPITest():void
+        {
+            SelManager.selectRange(0, 0);
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+        private function initTextFlowAAA():TextFlow
+        {
+            var textFlow:TextFlow = new TextFlow();
+            var p:ParagraphElement = new ParagraphElement();
+            var span:SpanElement = new SpanElement();
+            span.text = "aaa";
+            p.replaceChildren(0, 0, span);
+            textFlow.replaceChildren(0, 0, p);
+            return textFlow;
+        }
+
+        private function createParaIterationModel():TextFlow
+        {
+            // Creates 3 divs, each have 4 paras
+            const paraTotal:int = 4;
+            var paraCount:int;
+            const divTotal:int = 3;
+            var divCount:int;
+
+            var flow:TextFlow = new TextFlow();
+            for (var j:int = 0; j < divTotal; j++)
+            {
+                var div:DivElement = new DivElement();
+                for (var i:int = 0; i < paraTotal; i++)
+                {
+                    var para:ParagraphElement = new ParagraphElement();
+                    var span:SpanElement = new SpanElement();
+                    span.text = paraCount.toString();
+                    para.addChild(span);
+                    div.addChild(para);
+                    paraCount++;
+                }
+                flow.addChild(div);
+            }
+            return flow;
+        }
+
+        private function myFontLookup(context:mySwfContext, tlf:ITextLayoutFormat):Function
+        {
+            return myFontLookup;
+        }
+
+
+        private static function checkListLines(textFlow:TextFlow, numLines:int, prefix:String):void
+        {
+            for (var idx:int = 0; idx < numLines; idx++)
+            {
+                var tfl:TextFlowLine = textFlow.flowComposer.getLineAt(idx);
+                assertTrue(prefix + ": Missing TextFlowLine: " + idx, tfl != null);
+                var textLine:TextLine = tfl.getTextLine();
+                assertTrue(prefix + ": Missing TextLine: " + idx, textLine != null);
+                var numberLine:TextLine = textLine.getChildAt(0) as TextLine;
+                assertTrue(prefix + ": Missing NumberLine: " + idx, numberLine != null);
+                /* var numberString:String = numberLine.userData as String;
+                 var expectedString:String = (idx+1).toString() + ".";	// for numeric lists
+                 assertTrue(prefix+": NumberLine missing userData: "+idx,numberString != null);
+                 assertTrue(prefix+": Incorrect NumberLine userData: "+idx,numberLine.userData as String == expectedString);
+                 assertTrue(prefix+": Incorrect NumberLine rawTextLength: "+idx,numberString.length+1 == numberLine.rawTextLength); */
+            }
+        }
+
+
+        private function validateBitmap(actual:Bitmap, expected:Bitmap):Boolean
+        {
+            actual.bitmapData.draw(expected, null, null, "difference");
+            var bounds:Rectangle = new Rectangle(0, 0, actual.width, actual.height);
+            var diffPixels:ByteArray = actual.bitmapData.getPixels(bounds);
+            diffPixels.position = 0;
+            while (diffPixels.bytesAvailable > 0)
+            {
+                if (diffPixels.readByte() > 0)
+                    return false;
+            }
+
+            return true;
+        }
+
+        private function myFontMapper(fd:FontDescription):void
+        {
+            if (fd.fontName == "Arial Black")
+            {
+                fd.fontName = "Arial";
+                fd.fontWeight = FontWeight.BOLD;
+            }
+        }
+    }
 }
 
 import flash.text.engine.FontLookup;
+
 import flashx.textLayout.compose.ISWFContext;
-import flashx.textLayout.elements.FlowElement;
 import flashx.textLayout.elements.TextFlow;
-import flashx.textLayout.formats.TextLayoutFormat;
 
 class mySwfContext implements ISWFContext
-{	
-	public var myFontlookup:String = FontLookup.EMBEDDED_CFF;
-	
-	public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*
-	{
-		var tf:TextFlow = thisArg as TextFlow;
-		tf.fontLookup = FontLookup.EMBEDDED_CFF;
-		if (returns)
-			return fn.apply(thisArg, argsArray);
-		fn.apply(thisArg, argsArray);
-	}
-	
+{
+    public var myFontlookup:String = FontLookup.EMBEDDED_CFF;
+
+    public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean = true):*
+    {
+        var tf:TextFlow = thisArg as TextFlow;
+        tf.fontLookup = FontLookup.EMBEDDED_CFF;
+        if (returns)
+            return fn.apply(thisArg, argsArray);
+        fn.apply(thisArg, argsArray);
+    }
+
 }


[03/44] Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/ElementOperationTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ElementOperationTest.as b/automation_tests/src/UnitTest/Tests/ElementOperationTest.as
new file mode 100644
index 0000000..47a836d
--- /dev/null
+++ b/automation_tests/src/UnitTest/Tests/ElementOperationTest.as
@@ -0,0 +1,1192 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 UnitTest.Tests
+{
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flash.text.engine.FontWeight;
+
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.elements.DivElement;
+    import flashx.textLayout.elements.FlowGroupElement;
+    import flashx.textLayout.elements.LinkElement;
+    import flashx.textLayout.elements.ListElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.SpanElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.formats.TextAlign;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.operations.ApplyElementIDOperation;
+    import flashx.textLayout.operations.ApplyElementStyleNameOperation;
+    import flashx.textLayout.operations.ApplyElementTypeNameOperation;
+    import flashx.textLayout.operations.ApplyElementUserStyleOperation;
+    import flashx.textLayout.operations.ApplyFormatToElementOperation;
+
+    import org.flexunit.asserts.assertTrue;
+
+    public class ElementOperationTest extends VellumTestCase
+    {
+        private static const listItemMarkup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><list listStylePosition='inside'><li><p textAlign='left'><span fontWeight='bold'>item</span></p></li></list></TextFlow>";
+        private static const divTestMarkup:String = "<TextFlow whiteSpaceCollapse='preserve' xmlns='http://ns.adobe.com/textLayout/2008'><div><p><span>asd</span></p></div><p><span>asd</span></p></TextFlow>";
+
+        public function ElementOperationTest()
+        {
+            super("", "ElementOperationTests", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Editing";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        public function changeTextFlowIdTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var origId:String = tf.id;
+            var newId:String = "newTFId";
+
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), tf, newId));
+            assertTrue("changeTextFlowIdTest doOperation error", tf.id == newId);
+            SelManager.undo();
+            assertTrue("changeTextFlowIdTest undo error", tf.id == origId);
+            SelManager.redo();
+            assertTrue("changeTextFlowIdTest redo error", tf.id == newId);
+        }
+
+        [Test]
+        public function changeFirstParagraphIdTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var origId:String = p.id;
+            var newId:String = "newParaId";
+
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), p, newId));
+            assertTrue("changeFirstParagraphIdTest doOperation error", p.id == newId);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphIdTest undo error", p.id == origId);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphIdTest redo error", p.id == newId);
+        }
+
+        [Test]
+        public function changePartialParagraphIdTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origId:String = p.id;
+            var origTextLength:int = p.textLength;
+            var newId:String = "newParaId";
+
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), p, newId, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphIdTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphIdTest doOperation error id", p.id == newId);
+            assertTrue("changePartialParagraphIdTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphIdTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphIdTest undo error", p.id == origId && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphIdTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphIdTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphIdTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphIdTest redo error", p.id == newId);
+            assertTrue("changePartialParagraphIdTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphIdTest redo error totalLength", tf.textLength == totalLength + 2);
+        }
+
+        [Test]
+        public function changePartialSpanIdTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanIdTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+
+            var origId:String = span.id;
+            var origSpanLength:int = span.textLength;
+            var newId:String = "newSpanId";
+
+            // splits the span
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), span, newId, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanIdTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanIdTest doOperation error id", span.id == newId);
+            assertTrue("changePartialSpanIdTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanIdTest undo error", span.id == origId && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanIdTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanIdTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanIdTest redo error", span.id == newId);
+            assertTrue("changePartialSpanIdTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function changeTextFlowStyleNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var origStyleName:String = tf.styleName;
+            var newStyleName:String = "newTFStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), tf, newStyleName));
+            assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
+
+            SelManager.undo();
+            assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
+
+            // test using the replacement class
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), tf, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName})));
+            assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
+
+        }
+
+        [Test]
+        public function changeFirstParagraphStyleNameTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var origStyleName:String = p.styleName;
+            var newStyleName:String = "newParaStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), p, newStyleName));
+            assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
+
+            SelManager.undo();
+            assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
+
+            // test using the replacement class
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName})));
+            assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
+
+        }
+
+        [Test]
+        public function changeTextFlowTypeNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var origTypeName:String = tf.typeName;
+            var newTypeName:String = "newTFTypeName";
+
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), tf, newTypeName));
+            assertTrue("changeTextFlowTypeNameTest doOperation error", tf.typeName == newTypeName);
+            SelManager.undo();
+            assertTrue("changeTextFlowTypeNameTest undo error", tf.typeName == origTypeName);
+            SelManager.redo();
+            assertTrue("changeTextFlowTypeNameTest redo error", tf.typeName == newTypeName);
+        }
+
+        [Test]
+        public function changeFirstParagraphTypeNameTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var origTypeName:String = p.typeName;
+            var newTypeName:String = "newParaTypeName";
+
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), p, newTypeName));
+            assertTrue("changeFirstParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphTypeNameTest undo error", p.typeName == origTypeName);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphTypeNameTest redo error", p.typeName == newTypeName);
+        }
+
+        [Test]
+        public function changePartialParagraphStyleNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origStyleName:String = p.styleName;
+            var origTextLength:int = p.textLength;
+            var newStyleName:String = "newParaStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), p, newStyleName, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+            // cleanup
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            // test using the replacement class
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName}), 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+        }
+
+        [Test]
+        public function changePartialSpanStyleNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+
+            var origStyleName:String = span.styleName;
+            var origSpanLength:int = span.textLength;
+            var newStyleName:String = "newSpanStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            // splits the span
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), span, newStyleName, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
+
+            // cleanup
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            // test using the replacement function
+
+            // splits the span
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), span, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName}), 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function changePartialParagraphTypeNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origTypeName:String = p.typeName;
+            var origTextLength:int = p.textLength;
+            var newTypeName:String = "newParaTypeName";
+
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), p, newTypeName, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphTypeNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
+            assertTrue("changePartialParagraphTypeNameTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphTypeNameTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphTypeNameTest undo error", p.typeName == origTypeName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphTypeNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphTypeNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphTypeNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphTypeNameTest redo error", p.typeName == newTypeName);
+            assertTrue("changePartialParagraphTypeNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphTypeNameTest redo error totalLength", tf.textLength == totalLength + 2);
+        }
+
+        [Test]
+        public function changePartialSpanTypeNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+
+            var origTypeName:String = span.typeName;
+            var origSpanLength:int = span.textLength;
+            var newTypeName:String = "newSpanTypeName";
+
+            // splits the span
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), span, newTypeName, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanTypeNameTest doOperation error id", span.typeName == newTypeName);
+            assertTrue("changePartialSpanTypeNameTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest undo error", span.typeName == origTypeName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanTypeNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanTypeNameTest redo error", span.typeName == newTypeName);
+            assertTrue("changePartialSpanTypeNameTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function changeTextFlowUserStyleTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = tf.getStyle(styleName);
+            var newStyleValue:String = "newTFStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), tf, styleName, newStyleValue));
+            assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
+
+            // cleanup
+            SelManager.undo();
+            assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
+
+            // test using the replacement class
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), tf, format));
+            assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
+        }
+
+        [Test]
+        public function changeFirstParagraphUserStyleTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = p.getStyle(styleName);
+            var newStyleValue:String = "newParaStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), p, styleName, newStyleValue));
+            assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);
+
+            // cleanup
+            SelManager.undo();
+            assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
+
+            // test using the replacement class
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, format));
+            assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);
+        }
+
+        [Test]
+        public function changePartialParagraphUserStyleTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origTextLength:int = p.textLength;
+
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = p.getStyle(styleName);
+            var newStyleValue:String = "newParaStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), p, styleName, newStyleValue, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+            // cleanup
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            // test using the replacement class
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, format, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+        }
+
+        [Test]
+        public function changePartialSpanUserStyleTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+            var origSpanLength:int = span.textLength;
+
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = span.getStyle(styleName);
+            var newStyleValue:String = "newSpanStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            // splits the span
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), span, styleName, newStyleValue, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);
+
+            // cleanup
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            // splits the span
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), span, format, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function deleteAcrossDivBoundaryTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var selectFlow:TextFlow = TextConverter.importToFlow(divTestMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
+
+            var div:DivElement = selectFlow.getChildAt(0) as DivElement;
+            var para:ParagraphElement = selectFlow.getChildAt(1) as ParagraphElement;
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, div.deepCopy());
+            tf.replaceChildren(1, tf.numChildren, para.deepCopy());
+            tf.flowComposer.updateAllControllers();
+
+            var lenBefore:int = tf.textLength;
+
+            SelManager.selectRange(3, 4);
+            EditManager(SelManager).deleteText();
+
+            assertTrue("length didn't change after delete across div boundary!", tf.textLength != lenBefore);
+
+        }
+
+        [Test]
+        /**
+         * //Test for bug#2948473, we will not copy the containerBreakAfter, containerBreakBefore
+         * columnBreakAfter, columnBreakBefore attribute to the new paragraph
+         */
+        public function BreaksSplitTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            // a simple styled paragraph - always copy
+            var p:ParagraphElement = new ParagraphElement();
+            p.textAlign = TextAlign.LEFT;
+            p.columnBreakAfter = 'always';
+            p.columnBreakBefore = 'always';
+            p.containerBreakAfter = 'always';
+            p.containerBreakBefore = 'always';
+            var s:SpanElement = new SpanElement();
+            s.fontWeight = FontWeight.BOLD;
+            s.text = "Hello";
+            p.addChild(s);
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("BreaksSplitTest 1: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("BreaksSplitTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("BreaksSplitTest 1: p2 is incorrect after split", p2 && !TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1 &&
+                    p2.columnBreakAfter == undefined &&
+                    p2.columnBreakBefore == undefined &&
+                    p2.containerBreakAfter == undefined &&
+                    p2.containerBreakBefore == undefined);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("BreaksSplitTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("BreaksSplitTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("BreaksSplitTest 2: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("BreaksSplitTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("BreaksSplitTest 2: p2 is incorrect after split", p2 && !TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1 &&
+                    p2.columnBreakAfter == undefined &&
+                    p2.columnBreakBefore == undefined &&
+                    p2.containerBreakAfter == undefined &&
+                    p2.containerBreakBefore == undefined);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("BreaksSplitTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("BreaksSplitTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("BreaksSplitTest 3: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("BreaksSplitTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("BreaksSplitTest 3: p2 is incorrect after split", p2 && !TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1 &&
+                    p2.columnBreakAfter == undefined &&
+                    p2.columnBreakBefore == undefined &&
+                    p2.containerBreakAfter == undefined &&
+                    p2.containerBreakBefore == undefined);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("BreaksSplitTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("BreaksSplitTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        public function splitStyledParagraphTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            // a simple styled paragraph - always copy
+            var p:ParagraphElement = new ParagraphElement();
+            p.textAlign = TextAlign.LEFT;
+            var s:SpanElement = new SpanElement();
+            s.fontWeight = FontWeight.BOLD;
+            s.text = "Hello";
+            p.addChild(s);
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 1: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 2: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 3: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        public function splitStyledAnchorTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            // a simple styled paragraph - always copy
+            var p:ParagraphElement = new ParagraphElement();
+            p.textAlign = TextAlign.LEFT;
+            var s:SpanElement = new SpanElement();
+            s.fontWeight = FontWeight.BOLD;
+            s.text = "Hello";
+            var a:LinkElement = new LinkElement();
+            a.fontSize = 18;
+            a.addChild(s);
+            p.addChild(a);
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 1: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 2: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 3: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+            s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        public function splitStyledListItemTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            var listFlow:TextFlow = TextConverter.importToFlow(listItemMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
+            var list:ListElement = listFlow.getChildAt(0) as ListElement;
+
+            var s:SpanElement = list.getFirstLeaf() as SpanElement;
+            var p:ParagraphElement = s.parent as ParagraphElement;
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+            var listCopy:ListElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            listCopy = list.deepCopy(0, list.textLength) as ListElement;
+            tf.replaceChildren(0, tf.numChildren, listCopy);
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
+
+            assertTrue("splitStyledListItemTest 1: incorrect number of children after split", listCopy.numChildren == 2);
+            p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+            p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+
+            assertTrue("splitStyledListItemTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledListItemTest 1: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledListItemTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledListItemTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            listCopy = list.deepCopy(0, list.textLength) as ListElement;
+            tf.replaceChildren(0, tf.numChildren, listCopy);
+            tf.flowComposer.updateAllControllers();
+
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
+
+            assertTrue("splitStyledListItemTest 2: incorrect number of children after split", listCopy.numChildren == 2);
+            p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+            p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+
+            assertTrue("splitStyledListItemTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledListItemTest 2: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledListItemTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledListItemTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            listCopy = list.deepCopy(0, list.textLength) as ListElement;
+            tf.replaceChildren(0, tf.numChildren, listCopy);
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
+
+            assertTrue("splitStyledListItemTest 3: incorrect number of children after split", listCopy.numChildren == 2);
+            p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+            p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+
+            assertTrue("splitStyledListItemTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledListItemTest 3: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledListItemTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledListItemTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        [Ignore]
+        public function spanElementReplaceTextInvalidPos():void
+        {
+            SelManager.selectAll();
+            SelManager.deleteText();
+
+            var paragraph:ParagraphElement = new ParagraphElement();
+            var span:SpanElement = new SpanElement;
+
+            span.text = "Does this text flow need to be composed?";
+            paragraph.addChild(span);
+            SelManager.textFlow.addChild(paragraph);
+            SelManager.textFlow.flowComposer.updateAllControllers();
+            span.replaceText(5, 9, "your");
+            if (SelManager.textFlow.flowComposer.getControllerAt(0).isDamaged())
+            {
+                span.text += " Yes it does.";
+            }
+
+            //try to replace text at start point <0, should return error
+            try
+            {
+                span.replaceText(-1, 2, "your");
+            } catch (e:Error)
+            {
+                assertTrue("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
+            }
+            //try to replace text at end point > text Length, should return error
+            try
+            {
+                var len:int = SelManager.textFlow.textLength;
+                span.replaceText(5, len + 1, "your");
+            } catch (e:Error)
+            {
+                assertTrue("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
+            }
+            //try to replace text when end point < start point, should return error
+            try
+            {
+                span.replaceText(5, 3, "your");
+            } catch (e:Error)
+            {
+                assertTrue("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
+            }
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+        [Test]
+        public function copyErrorMassageTest():void
+        {
+            SelManager.selectAll();
+            SelManager.deleteText();
+
+            var p:ParagraphElement = new ParagraphElement();
+            var span1:SpanElement = new SpanElement();
+            var span2:SpanElement = new SpanElement();
+            span1.text = "1水z𝄞#####%23456789"; //character 水z𝄞 to make badSurrogatePairCopy error
+
+            try
+            {
+                span2 = span1.shallowCopy(7, 6) as SpanElement;
+            } catch (e:Error)
+            {
+                assertTrue("Invalid error message for badShallowCopyRange", e.message = "Bad range in shallowCopy");
+            }
+            try
+            {
+                span2 = span1.shallowCopy(2, 4) as SpanElement;
+            } catch (e:Error)
+            {
+                assertTrue("Invalid error message for badSurrogatePairCopy", e.message = "Copying only half of a surrogate pair in SpanElement.shallowCopy");
+            }
+            p.fontSize = 20;
+            p.addChild(span1);
+            p.addChild(span2);
+
+            SelManager.textFlow.addChild(p);
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+        [Test]
+        public function applyFormatToElementOperationFormatTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var styleName:String = "userStyleName";
+            var newStyleValue:String = "newUserStyleValue";
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.fontSize = 10;
+            format.setStyle(styleName, newStyleValue);
+            var op:ApplyFormatToElementOperation = new ApplyFormatToElementOperation(SelManager.getSelectionState(), tf, format);
+            //test format setter
+            format.fontSize = 20;
+            op.format = format;
+            SelManager.doOperation(op);
+            //test format getter
+            assertTrue("format font size is not set correctly", op.format.fontSize == 20 &&
+                    tf.getStyle(styleName) == "newUserStyleValue");
+        }
+
+        [Test]
+        public function typeNameSetGetTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var newTypeName:String = "newTFTypeName1";
+
+            var op:ApplyElementTypeNameOperation = new ApplyElementTypeNameOperation(SelManager.getSelectionState(), tf, newTypeName);
+            op.typeName = "newTFTypeName2";
+            SelManager.doOperation(op);
+            assertTrue("ApplyElementTypeNameOperation doesn't set or get correct typeName", op.typeName == "newTFTypeName2");
+        }
+    }
+}


[35/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-26478 Responding to dev review by adding curly braces around if clauses. Also optimised imports and renamed comment parameters in StandardFlowComposer and ContainerController.

Posted by pi...@apache.org.
FLEX-26478
Responding to dev review by adding curly braces around if clauses.
Also optimised imports and renamed comment parameters in StandardFlowComposer and ContainerController.


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

Branch: refs/heads/tables
Commit: bebdb18790e32a25e2c4427758b2ac637c59bc51
Parents: d1c8361
Author: Mihai Chira <mi...@apache.org>
Authored: Thu Oct 23 12:27:32 2014 +0100
Committer: Mihai Chira <mi...@apache.org>
Committed: Thu Oct 23 12:27:32 2014 +0100

----------------------------------------------------------------------
 .../textLayout/compose/StandardFlowComposer.as  |  44 +++---
 .../textLayout/container/ContainerController.as | 138 ++++++++++---------
 2 files changed, 91 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/bebdb187/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
index 3393d32..e1cb140 100644
--- a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
+++ b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
@@ -17,25 +17,23 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 package flashx.textLayout.compose
-{	
-	import flash.display.Sprite;
-	import flash.system.Capabilities;
-	import flash.text.engine.TextLine;
-	
-	import flashx.textLayout.accessibility.TextAccImpl;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.container.ScrollPolicy;
-	import flashx.textLayout.debug.assert;
-	import flashx.textLayout.edit.ISelectionManager;
-	import flashx.textLayout.elements.BackgroundManager;
-	import flashx.textLayout.elements.ContainerFormattedElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.events.CompositionCompleteEvent;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.tlf_internal;
+{
+    import flash.display.Sprite;
+    import flash.system.Capabilities;
+
+    import flashx.textLayout.accessibility.TextAccImpl;
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.container.ScrollPolicy;
+    import flashx.textLayout.debug.assert;
+    import flashx.textLayout.edit.ISelectionManager;
+    import flashx.textLayout.elements.BackgroundManager;
+    import flashx.textLayout.elements.ContainerFormattedElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.events.CompositionCompleteEvent;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.tlf_internal;
 
-	use namespace tlf_internal;
+    use namespace tlf_internal;
 	
 	/** 
 	* The StandardFlowComposer class provides a standard composer and container manager. 
@@ -89,7 +87,7 @@ package flashx.textLayout.compose
 		public function StandardFlowComposer()
 		{
 			super();
-			_controllerList = new Array();
+			_controllerList = [];
 			_composing = false;
 		}
 
@@ -212,7 +210,7 @@ package flashx.textLayout.compose
 				// attach accessibility to the containers
 				// Why only the first container?  There are workflows that this will fail
 				// for example: a pagination workflow that has a composed chain of containers but only displays one at a time.
-				if (textFlow.configuration.enableAccessibility && flash.system.Capabilities.hasAccessibility)
+				if (textFlow.configuration.enableAccessibility && Capabilities.hasAccessibility)
 				{
 					var firstContainer:Sprite = getControllerAt(0).container;
 					if (firstContainer)
@@ -265,7 +263,7 @@ package flashx.textLayout.compose
 			}
 			else
 			{
-				controller.setRootElement(_rootElement)
+				controller.setRootElement(_rootElement);
 				var curContainer:Sprite = controller.container;
 				if (curContainer)
 					curContainer.focusRect = false;
@@ -538,7 +536,7 @@ package flashx.textLayout.compose
 		 * 
 		 * <p>If the contents of any container is changed, the method returns <code>true</code>.</p>
 		 * 
-		 * @param controllerIndex index of the last container to update (by default updates all containers)
+		 * @param index index of the last container to update (by default updates all containers)
 		 * @return <code>true</code>, if anything changed.
 		 *
 		 * @playerversion Flash 10
@@ -578,7 +576,7 @@ package flashx.textLayout.compose
 		 * containing the specified text flow position.</p>
 		 * 
 		 * @param absolutePosition Specifies the position in the text flow of the container to receive focus.
-		 * @param preferPrevious If true and the position is before the first character in a container, sets focus to the end of 
+		 * @param leanLeft If true and the position is before the first character in a container, sets focus to the end of
 		 *  the previous container.
 		 * 
 		 * @see flash.display.Stage#focus

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/bebdb187/textLayout/src/flashx/textLayout/container/ContainerController.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/container/ContainerController.as b/textLayout/src/flashx/textLayout/container/ContainerController.as
index de77fa7..f992734 100644
--- a/textLayout/src/flashx/textLayout/container/ContainerController.as
+++ b/textLayout/src/flashx/textLayout/container/ContainerController.as
@@ -18,71 +18,67 @@
 ////////////////////////////////////////////////////////////////////////////////
 package flashx.textLayout.container 
 {
-	import flash.display.BlendMode;
-	import flash.display.DisplayObject;
-	import flash.display.DisplayObjectContainer;
-	import flash.display.InteractiveObject;
-	import flash.display.Shape;
-	import flash.display.Sprite;
-	import flash.events.ContextMenuEvent;
-	import flash.events.Event;
-	import flash.events.FocusEvent;
+    import flash.display.BlendMode;
+    import flash.display.DisplayObject;
+    import flash.display.DisplayObjectContainer;
+    import flash.display.Shape;
+    import flash.display.Sprite;
+    import flash.events.ContextMenuEvent;
+    import flash.events.Event;
+    import flash.events.FocusEvent;
     import flash.events.IEventDispatcher;
-	import flash.events.IMEEvent;
-	import flash.events.KeyboardEvent;
-	import flash.events.MouseEvent;
-	import flash.events.TextEvent;
-	import flash.events.TimerEvent;
-	import flash.geom.Matrix;
-	import flash.geom.Point;
-	import flash.geom.Rectangle;
-	import flash.text.engine.TextBlock;
-	import flash.text.engine.TextLine;
-	import flash.text.engine.TextLineValidity;
-	import flash.ui.ContextMenu;
-	import flash.ui.ContextMenuClipboardItems;
-	import flash.utils.Dictionary;
-	import flash.utils.Timer;
-	
-	import flashx.textLayout.compose.FloatCompositionData;
-	import flashx.textLayout.compose.FlowComposerBase;
-	import flashx.textLayout.compose.FlowDamageType;
-	import flashx.textLayout.compose.IFlowComposer;
-	import flashx.textLayout.compose.TextFlowLine;
-	import flashx.textLayout.compose.TextLineRecycler;
-	import flashx.textLayout.debug.Debugging;
-	import flashx.textLayout.debug.assert;
-	import flashx.textLayout.edit.EditingMode;
-	import flashx.textLayout.edit.IInteractionEventHandler;
-	import flashx.textLayout.edit.ISelectionManager;
-	import flashx.textLayout.edit.SelectionFormat;
-	import flashx.textLayout.elements.BackgroundManager;
-	import flashx.textLayout.elements.Configuration;
-	import flashx.textLayout.elements.ContainerFormattedElement;
-	import flashx.textLayout.elements.FlowElement;
-	import flashx.textLayout.elements.FlowLeafElement;
-	import flashx.textLayout.elements.FlowValueHolder;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.LinkElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.events.FlowElementMouseEvent;
-	import flashx.textLayout.events.FlowElementMouseEventManager;
-	import flashx.textLayout.events.ModelChange;
-	import flashx.textLayout.events.ScrollEvent;
-	import flashx.textLayout.events.ScrollEventDirection;
-	import flashx.textLayout.events.TextLayoutEvent;
-	import flashx.textLayout.events.UpdateCompleteEvent;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Float;
-	import flashx.textLayout.formats.FormatValue;
-	import flashx.textLayout.formats.ITextLayoutFormat;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.property.Property;
-	import flashx.textLayout.tlf_internal;
-	import flashx.textLayout.utils.Twips;
-	
-	use namespace tlf_internal;
+    import flash.events.IMEEvent;
+    import flash.events.KeyboardEvent;
+    import flash.events.MouseEvent;
+    import flash.events.TextEvent;
+    import flash.events.TimerEvent;
+    import flash.geom.Matrix;
+    import flash.geom.Point;
+    import flash.geom.Rectangle;
+    import flash.text.engine.TextBlock;
+    import flash.text.engine.TextLine;
+    import flash.text.engine.TextLineValidity;
+    import flash.ui.ContextMenu;
+    import flash.ui.ContextMenuClipboardItems;
+    import flash.utils.Dictionary;
+    import flash.utils.Timer;
+
+    import flashx.textLayout.compose.FloatCompositionData;
+    import flashx.textLayout.compose.FlowDamageType;
+    import flashx.textLayout.compose.IFlowComposer;
+    import flashx.textLayout.compose.TextFlowLine;
+    import flashx.textLayout.compose.TextLineRecycler;
+    import flashx.textLayout.debug.Debugging;
+    import flashx.textLayout.debug.assert;
+    import flashx.textLayout.edit.EditingMode;
+    import flashx.textLayout.edit.IInteractionEventHandler;
+    import flashx.textLayout.edit.ISelectionManager;
+    import flashx.textLayout.edit.SelectionFormat;
+    import flashx.textLayout.elements.BackgroundManager;
+    import flashx.textLayout.elements.Configuration;
+    import flashx.textLayout.elements.ContainerFormattedElement;
+    import flashx.textLayout.elements.FlowElement;
+    import flashx.textLayout.elements.FlowLeafElement;
+    import flashx.textLayout.elements.FlowValueHolder;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.TCYElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.events.FlowElementMouseEventManager;
+    import flashx.textLayout.events.ModelChange;
+    import flashx.textLayout.events.ScrollEvent;
+    import flashx.textLayout.events.ScrollEventDirection;
+    import flashx.textLayout.events.TextLayoutEvent;
+    import flashx.textLayout.events.UpdateCompleteEvent;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Float;
+    import flashx.textLayout.formats.FormatValue;
+    import flashx.textLayout.formats.ITextLayoutFormat;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.tlf_internal;
+    import flashx.textLayout.utils.Twips;
+
+    use namespace tlf_internal;
 	
 	/** 
 	 * The ContainerController class defines the relationship between a TextFlow object and a container.
@@ -1425,7 +1421,7 @@ package flashx.textLayout.container
 				if (blockProgression == BlockProgression.RL)
 				{
 					var leafElement:FlowLeafElement = _rootElement.getTextFlow().findLeaf(start);
-					isTCY =  leafElement.getParentByType(flashx.textLayout.elements.TCYElement) != null;
+					isTCY =  leafElement.getParentByType(TCYElement) != null;
 				}
 				
 				var minAtomIndex:int = textLine.atomCount;
@@ -1786,10 +1782,14 @@ package flashx.textLayout.container
                 _scrollTimer.removeEventListener(TimerEvent.TIMER, scrollTimerHandler);
 
                 if(!containerRoot)
+                {
                     containerRoot = getContainerRoot();
+                }
 
                 if(containerRoot)
+                {
                     containerRoot.removeEventListener(MouseEvent.MOUSE_UP, scrollTimerHandler);
+                }
 
                 _scrollTimer = null;
             }
@@ -4745,8 +4745,9 @@ package flashx.textLayout.container
 		
 		CONFIG::debug
 		{
-			import flash.system.Capabilities;
-			// OLD style calculation - lets make sure its the same.  
+            import flash.system.Capabilities;
+
+            // OLD style calculation - lets make sure its the same.
 			static private var tempLineHolder:Sprite = new Sprite();
 			
 			/** @private */
@@ -4913,8 +4914,9 @@ package flashx.textLayout.container
 	}
 	
 }
-import flash.events.MouseEvent;
+
 import flash.display.InteractiveObject;
+import flash.events.MouseEvent;
 
 class PsuedoMouseEvent extends MouseEvent
 {


[24/44] git commit: [flex-tlf] [refs/heads/tables] - Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-tlf into develop

Posted by pi...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-tlf into develop

Conflicts:
	build.xml


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

Branch: refs/heads/tables
Commit: 251c27a4a44c1964a7b6619aaede6881aa8df266
Parents: 9c449d8 b61dda3
Author: piotrz <pi...@gmail.com>
Authored: Mon Oct 20 21:00:28 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Mon Oct 20 21:00:28 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |    2 +
 .../src/UnitTest/Tests/GeneralFunctionsTest.as  | 2673 +++++++++---------
 build.properties                                |   37 +
 .../textLayout/container/ContainerController.as |  129 +-
 .../src/flashx/textLayout/edit/TextClipboard.as |   15 +-
 .../flashx/textLayout/utils/NavigationUtil.as   |    3 +-
 6 files changed, 1462 insertions(+), 1397 deletions(-)
----------------------------------------------------------------------



[38/44] git commit: [flex-tlf] [refs/heads/tables] - Add property minimalTests to make MinimalTestsSuite runnable

Posted by pi...@apache.org.
Add property minimalTests to make MinimalTestsSuite runnable


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

Branch: refs/heads/tables
Commit: db7894f979d22438d19127c4fdcf2d7f24e2ff61
Parents: 7b546ef
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 26 21:49:29 2014 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 26 21:49:29 2014 +0100

----------------------------------------------------------------------
 automation_apps/src/UnitTest/TestDescriptorRunner.mxml | 10 ++++------
 automation_apps/src/VellumUnit.mxml                    |  7 ++-----
 build.properties                                       |  1 +
 build.xml                                              |  1 +
 4 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/db7894f9/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
----------------------------------------------------------------------
diff --git a/automation_apps/src/UnitTest/TestDescriptorRunner.mxml b/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
index 7d7253c..c9edada 100644
--- a/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
+++ b/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
@@ -35,14 +35,12 @@
             core.addListener(new CIListener());
             core.addListener(testRunner);
 
-            if (isMinimalTests)
-            {
+            CONFIG::minimaltests {
                 core.run(new MinimalTestsSuite());
+                return;
             }
-            else
-            {
-                core.run(new AllTestsSuite());
-            }
+
+            core.run(new AllTestsSuite());
         }
         ]]>
 	</fx:Script>

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/db7894f9/automation_apps/src/VellumUnit.mxml
----------------------------------------------------------------------
diff --git a/automation_apps/src/VellumUnit.mxml b/automation_apps/src/VellumUnit.mxml
index 7478275..9f41b3b 100644
--- a/automation_apps/src/VellumUnit.mxml
+++ b/automation_apps/src/VellumUnit.mxml
@@ -161,7 +161,7 @@
              Font.registerFont(arialFontRoundedMTBold);     */
         }
 
-        private function loadAndRunTests(isMinimialTests:Boolean = false):void
+        private function loadAndRunTests():void
         {
             var config:TestConfig = TestConfig.getInstance();
             config.baseURL = normalizedURL;
@@ -188,7 +188,7 @@
 
             testRunDate = MakeMySQLDate(new Date());
 
-            testRunner.startTest(isMinimialTests);
+            testRunner.startTest();
         }
 
         private var xmlRoot:XML = null;
@@ -353,9 +353,6 @@
         private function startRangeTests():void
         {
             useTestSelectDialog = true;	// we select the range in the XML for this dialog
-            /* if (testXMLStore == null)
-             FileRepository.readFile(normalizedURL, "../../test/testSuites.xml", onSuiteFileRead, onSuiteFileReadError, onSuiteFileSecurityError, true);
-             else    */
             loadAndRunTests();
         }
 

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/db7894f9/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index a698964..925d779 100644
--- a/build.properties
+++ b/build.properties
@@ -27,6 +27,7 @@ src.depend = true
 src.debug = on
 
 forkValue = true
+minimalTests = false
 
 # JVM options for <compc> and <mxmlc> tasks
 jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/db7894f9/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index e6c7eaf..6feb0e3 100644
--- a/build.xml
+++ b/build.xml
@@ -349,6 +349,7 @@
 
 			<define name="CONFIG::debug" 			value="${dbg}"/>
 			<define name="CONFIG::release" 			value="${rel}"/>
+            <define name="CONFIG::minimaltests" value="${minimalTests}"/>
 		</mxmlc>
 		<html-wrapper title="VellumUnit" file="VellumUnit.html" 
 		            application="VellumUnit" 


[19/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-34592: Can't use optionnal importer for TLF plainTextFormat and TextLayoutFormat

Posted by pi...@apache.org.
FLEX-34592: Can't use optionnal importer for TLF plainTextFormat and TextLayoutFormat


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

Branch: refs/heads/tables
Commit: 486ebe3a7393991ce5fe68e633949e0d478cbe35
Parents: cb9abbb
Author: Frederic THOMAS <we...@gmail.com>
Authored: Sat Oct 18 13:41:03 2014 +0200
Committer: Frederic THOMAS <we...@gmail.com>
Committed: Sat Oct 18 13:41:03 2014 +0200

----------------------------------------------------------------------
 .../src/flashx/textLayout/edit/TextClipboard.as      | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/486ebe3a/textLayout/src/flashx/textLayout/edit/TextClipboard.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/edit/TextClipboard.as b/textLayout/src/flashx/textLayout/edit/TextClipboard.as
index a9f4f19..405de63 100644
--- a/textLayout/src/flashx/textLayout/edit/TextClipboard.as
+++ b/textLayout/src/flashx/textLayout/edit/TextClipboard.as
@@ -175,14 +175,15 @@ package flashx.textLayout.edit
 			{
 				importer.useClipboardAnnotations = true;
 				var textFlow:TextFlow = importer.importToFlow(textOnClipboard);
-				if (textFlow)
+				if (textFlow) {
 					textScrap = new TextScrap(textFlow);
-				
-				/** Hint to the scrap about whether text is plain or formatted. If not set, scrap will inspect text for attributes. */
-				if (format == TextConverter.PLAIN_TEXT_FORMAT && textScrap)
-					textScrap.setPlainText(true);
-				else if (format == TextConverter.TEXT_LAYOUT_FORMAT && textScrap)
-					textScrap.setPlainText(false);
+					
+					/** Hint to the scrap about whether text is plain or formatted. If not set, scrap will inspect text for attributes. */
+					if (format == TextConverter.PLAIN_TEXT_FORMAT)
+						textScrap.setPlainText(true);
+					else if (format == TextConverter.TEXT_LAYOUT_FORMAT)
+						textScrap.setPlainText(false);
+				}
 				
 				// Backwards compatibility: check for older scrap format
 				if (!textScrap && format == TextConverter.TEXT_LAYOUT_FORMAT)


[41/44] git commit: [flex-tlf] [refs/heads/tables] - Back to the original implementation Ignore arrowUp and arrowDown tests in GeneralFunctionsTest

Posted by pi...@apache.org.
Back to the original implementation Ignore arrowUp and arrowDown tests in GeneralFunctionsTest


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

Branch: refs/heads/tables
Commit: 5349b7aac430274804d7703bee773537a6eae9e9
Parents: 658cf60
Author: piotrz <pi...@gmail.com>
Authored: Mon Oct 27 07:38:59 2014 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Mon Oct 27 07:38:59 2014 +0100

----------------------------------------------------------------------
 automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/5349b7aa/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as b/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
index fd022cb..c5da11a 100644
--- a/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
+++ b/automation_tests/src/UnitTest/Tests/GeneralFunctionsTest.as
@@ -486,6 +486,7 @@ package UnitTest.Tests
         }
 
         [Test]
+        [Ignore]
         /**
          * Sets the insertion point at 0, then generates the "40" keyboard event
          * and verifies that the cursor is on the second line.
@@ -508,6 +509,7 @@ package UnitTest.Tests
         }
 
         [Test]
+        [Ignore]
         /**
          * Sets the insertion point at the last char, then generates the "38" keyboard event
          * and verifies that the cursor is on the second to last line.


[37/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-34611: Application crash when textFlow property set to null with preserveSelection

Posted by pi...@apache.org.
FLEX-34611: Application crash when textFlow property set to null with preserveSelection


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

Branch: refs/heads/tables
Commit: 7b546ef77b7b439c62e21771a591a19b6b1baf83
Parents: fad7b29
Author: Frederic THOMAS <we...@gmail.com>
Authored: Fri Oct 24 16:44:43 2014 +0200
Committer: Frederic THOMAS <we...@gmail.com>
Committed: Fri Oct 24 16:44:43 2014 +0200

----------------------------------------------------------------------
 textLayout/src/flashx/textLayout/container/TextContainerManager.as | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7b546ef7/textLayout/src/flashx/textLayout/container/TextContainerManager.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/container/TextContainerManager.as b/textLayout/src/flashx/textLayout/container/TextContainerManager.as
index d67524a..04d8366 100644
--- a/textLayout/src/flashx/textLayout/container/TextContainerManager.as
+++ b/textLayout/src/flashx/textLayout/container/TextContainerManager.as
@@ -578,7 +578,7 @@ package flashx.textLayout.container
 					hadPreviousSelection = true;
 					
 					//preserve the selection state [bug #2931406 from Flex SDK]
-					if (_preserveSelectionOnSetText)
+					if (_preserveSelectionOnSetText && text)
                     {
                         oldAnchorPosition = Math.min(_textFlow.interactionManager.anchorPosition, text.length);
                         oldActivePosition = Math.min(_textFlow.interactionManager.activePosition, text.length);


[29/44] git commit: [flex-tlf] [refs/heads/tables] - another attempt to fix flex-tlf

Posted by pi...@apache.org.
another attempt to fix flex-tlf


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

Branch: refs/heads/tables
Commit: b9cecc6311543aeb3843daca884372390be47cc1
Parents: 2007b42
Author: Alex Harui <ah...@apache.org>
Authored: Mon Oct 20 12:00:03 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 21 10:53:08 2014 -0700

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/b9cecc63/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 9fc0620..4a30a49 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[34/44] git commit: [flex-tlf] [refs/heads/tables] - Remove unused import in ContainerAttributeTest

Posted by pi...@apache.org.
Remove unused import in ContainerAttributeTest


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

Branch: refs/heads/tables
Commit: 95fecf4786fbc23949e4e00bbf2738818fbd6968
Parents: d1c8361
Author: piotrz <pi...@gmail.com>
Authored: Thu Oct 23 07:55:30 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Thu Oct 23 07:55:30 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/95fecf47/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as b/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
index 5375549..aee66a3 100644
--- a/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
+++ b/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
@@ -18,7 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-    import UnitTest.ExtendedClasses.TestSuiteExtended;
     import UnitTest.ExtendedClasses.VellumTestCase;
     import UnitTest.Fixtures.TestConfig;
 


[43/44] git commit: [flex-tlf] [refs/heads/tables] - Add TabTest with ingnored noTabStop test

Posted by pi...@apache.org.
Add TabTest with ingnored noTabStop test


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

Branch: refs/heads/tables
Commit: 1d79e2499e99904036c54a14e792f186a1b31951
Parents: ac6b047
Author: piotrz <pi...@gmail.com>
Authored: Thu Oct 30 07:52:45 2014 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Thu Oct 30 07:52:45 2014 +0100

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as          |    2 +
 automation_tests/src/UnitTest/Tests/TabTest.as | 1087 ++++++++++---------
 2 files changed, 558 insertions(+), 531 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1d79e249/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index 641c924..74b3c55 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -39,6 +39,7 @@ package
     import UnitTest.Tests.GeneralFunctionsTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
+    import UnitTest.Tests.TabTest;
     import UnitTest.Tests.TextFlowEditTest;
     import UnitTest.Tests.UndoRedoTest;
     import UnitTest.Tests.WritingModeTest;
@@ -70,6 +71,7 @@ package
         public var writingModeTest:WritingModeTest;
         public var undoRedoTest:UndoRedoTest;
         public var textFlowEditTest:TextFlowEditTest;
+        public var tabTest:TabTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/1d79e249/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 2195826..e6ea3d8 100644
--- a/automation_tests/src/UnitTest/Tests/TabTest.as
+++ b/automation_tests/src/UnitTest/Tests/TabTest.as
@@ -18,543 +18,568 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
 
-	import flash.text.engine.TabAlignment;
-	import flash.text.engine.TextLine;
-	import flash.geom.Rectangle;
+    import flash.geom.Rectangle;
+    import flash.text.engine.TabAlignment;
+    import flash.text.engine.TextLine;
 
-	import flashx.textLayout.formats.ITextLayoutFormat;
-	import flashx.textLayout.formats.TabStopFormat;
-	import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.formats.ITextLayoutFormat;
+    import flashx.textLayout.formats.TabStopFormat;
+    import flashx.textLayout.formats.TextLayoutFormat;
 
     import org.flexunit.asserts.assertTrue;
 
-
     public class TabTest extends VellumTestCase
-	{
-		public function TabTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
-		{
-			super(methodName, testID, testConfig, testCaseXML);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Tabs";
-		}
-
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = TabTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-
- 		/****************************************************
- 		  Main codes strat here.
- 		  Validate parsing of string-based tab stop formats
- 		 ****************************************************/
-
-   		/* ************************************************************** */
-		/* Enter tab without specifying tab stop */
-		/* ************************************************************** */
-
-   		public function noTabStop():void
-   		{
-   		//change the text and recompose
-   		SelManager.selectAll();
-   		SelManager.deleteText();
-   		SelManager.insertText("\tN");
-   		TestFrame.flowComposer.updateAllControllers();
-
-   		// get the first line
-   		var initialLine:TextLine;
-   		initialLine = 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;
-
-   		//Check the the correct value is in the tab
-   		assertTrue("tab should be " + tabValue + " but is " + valueAfterTab, valueAfterTab == tabValue);
-   		}
-
-   		 // TabStops string parsing for "Start"
-   		public function StartTabStopString():void
-   		{
-   			var p1:TextLayoutFormat = new TextLayoutFormat();
-			p1.tabStops = "s300 S200 100";
-   			SelManager.applyParagraphFormat(p1);
-
-   			var p2:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-   			assertTrue("Start tabStops could not be found", p2.tabStops != undefined);
-
-   			//Validating the alignment type string for start
-   			assertTrue("Not parsing tabStop string correctly for s300 (type)", p2.tabStops[2].alignment == TabAlignment.START);
-   			assertTrue("Not parsing tabStop string correctly for S200 (type)", p2.tabStops[1].alignment == TabAlignment.START);
-   			assertTrue("Not parsing tabStop string correctly for 100 (type)", p2.tabStops[0].alignment == TabAlignment.START);
-
-   			//Validating the alignment position for each tabStop
-   			assertTrue("Not parsing tabStop string correctly for s300 (position)", p2.tabStops[2].position == 300);
-   			assertTrue("Not parsing tabStop string correctly for S200 (position)", p2.tabStops[1].position == 200);
-   			assertTrue("Not parsing tabStop string correctly for 100 (position)", p2.tabStops[0].position == 100);
-   		}
-
-
-   		// TabStops string parsing for "Center"
-   		public function CenterTabStopString():void
-   		{
-			var p3:TextLayoutFormat = new TextLayoutFormat();
-			p3.tabStops = "c500 C400";
-			SelManager.applyParagraphFormat(p3);
-
-			var p4:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Center tabStops could not be found", p4.tabStops != undefined);
-
-			//Validating the alignment type string for center
-			assertTrue("Not parsing tabStop string correctly for c500 (type)", p4.tabStops[1].alignment == TabAlignment.CENTER);
-			assertTrue("Not parsing tabStop string correctly for C400 (type)", p4.tabStops[0].alignment == TabAlignment.CENTER);
-
-			//Validating the alignment position for each tabStop
-			assertTrue("Not parsing tabStop string correctly for c500 (position)", p4.tabStops[1].position == 500);
-   			assertTrue("Not parsing tabStop string correctly for C400 (position)", p4.tabStops[0].position == 400);
-   		}
-
-   		// TabStops string parsing for "End"
-   		public function EndTabStopString():void
-   		{
-			var p5:TextLayoutFormat = new TextLayoutFormat();
-			p5.tabStops = "e700 E600";
-			SelManager.applyParagraphFormat(p5);
-
-			var p6:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("End tabStops could not be found", p6.tabStops != undefined);
-
-			//Validating the alignment type string for end
-			assertTrue("Not parsing tabStop string correctly for e700 (type)", p6.tabStops[1].alignment == TabAlignment.END);
-			assertTrue("Not parsing tabStop string correctly for E600 (type)", p6.tabStops[0].alignment == TabAlignment.END);
-
-			//Validating the alignment position for each tabStop
-			assertTrue("Not parsing tabStop string correctly for e700 (position)", p6.tabStops[1].position == 700);
-   			assertTrue("Not parsing tabStop string correctly for E600 (position)", p6.tabStops[0].position == 600);
-   		}
-
-   		// TabStops string parsing for "Decimal"
-   		public function DecimalTabStopString():void
-   		{
-			var p7:TextLayoutFormat = new TextLayoutFormat();
-			p7.tabStops = "d900 D800";
-			SelManager.applyParagraphFormat(p7);
-
-			var p8:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Decimal tabStops could not be found", p8.tabStops != undefined);
-
-			//Validating the alignment type string for dicimal
-			assertTrue("Not parsing tabStop string correctly for d900 (type)", p8.tabStops[1].alignment == TabAlignment.DECIMAL);
-			assertTrue("Not parsing tabStop string correctly for D800 (type)", p8.tabStops[0].alignment == TabAlignment.DECIMAL);
-
-			//Validating the alignment position for each tabStop
-			assertTrue("Not parsing tabStop string correctly for d900 (position)", p8.tabStops[1].position == 900);
-   			assertTrue("Not parsing tabStop string correctly for D800 (position)", p8.tabStops[0].position == 800);
-   		}
-
-   		//Same position tabStops
-   		public function SamePositionTabStops():void
-   		{
-   			var p9:TextLayoutFormat = new TextLayoutFormat();
-   			p9.tabStops = "250 c250";
-   			SelManager.applyParagraphFormat(p9);
-
-   			var p10:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Same position tabStops could not be found", p10.tabStops != undefined);
-
-			//Validating alignment type string for the same position tabStops
-			assertTrue("Not parsing tabStop string correctly for 250 (type)", p10.tabStops[0].alignment == TabAlignment.START);
-			assertTrue("Not parsing tabStop string correctly for c250 (type)", p10.tabStops[1].alignment == TabAlignment.CENTER);
-
-			assertTrue("Not parsing tabStop string correctly for 250 (position)", p10.tabStops[0].position == 250);
-			assertTrue("Not parsing tabStop string correctly for c250 (position)", p10.tabStops[1].position == 250);
-   		}
-
-
-   		public function UniqueNumberTabStops():void
-   		{
-   			//Decimal number
-   			var p11:TextLayoutFormat = new TextLayoutFormat();
-   			p11.tabStops = "100.345678";
-   			SelManager.applyParagraphFormat(p11);
-
-   			var p12:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Long decimal number tabStops could not be found", p12.tabStops != undefined);
-
-			assertTrue("Not parsing tabStop string correctly for 100.345678 (type)", p12.tabStops[0].alignment == TabAlignment.START);
-   			assertTrue("Not parsing tabStop string correctly for 100.345678 (position)", p12.tabStops[0].position == 100.345678);
-
-			//Number in scientific notation
-			var p13:TextLayoutFormat = new TextLayoutFormat();
-   			p13.tabStops = "150.567e-2";
-   			SelManager.applyParagraphFormat(p13);
-
-   			var p14:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("scientific notation tabStops could not be found", p14.tabStops != undefined);
-
-			assertTrue("Not parsing tabStop string correctly for 150.567e-2 (type)", p14.tabStops[0].alignment == TabAlignment.START);
-   			assertTrue("Not parsing tabStop string correctly for 150.567e-2 (position)", p14.tabStops[0].position == 150.567e-2);
-
-
-   			//Very long tabStop string
-   			var p15:TextLayoutFormat = new TextLayoutFormat();
-   			p15.tabStops = "c34.789763333333";
-   			SelManager.applyParagraphFormat(p15);
-
-   			var p16:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Long string tabStops could not be found", p16.tabStops != undefined);
-
-   			assertTrue("Not parsing tabStop string correctly for c34.789763333333 (type)", p16.tabStops[0].alignment == TabAlignment.CENTER);
-   			assertTrue("Not parsing tabStop string correctly for c34.789763333333 (position)", p16.tabStops[0].position == 34.789763333333);
-   	    }
-
-
-   		public function AlignmentToken():void
-   		{
-   			var p17:TextLayoutFormat = new TextLayoutFormat();
-   			p17.tabStops = "d10|.  D20|\\\\  d30  D40|*  d50|\\ ";
-   			SelManager.applyParagraphFormat(p17);
-
-   			var p18:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Alignment token tabStops could not be found", p18.tabStops != undefined);
-
-			//Validating alignment tokens
-			assertTrue("Not parsing tabStop string correctly for d10|. (alignment token)", p18.tabStops[0].decimalAlignmentToken == ".");
-			assertTrue("Not parsing tabStop string correctly for D20|\\\\  (alignment token)", p18.tabStops[1].decimalAlignmentToken == "\\");
-			assertTrue("Not parsing tabStop string correctly for d30 (alignment token)", p18.tabStops[2].decimalAlignmentToken == ".");
-			assertTrue("Not parsing tabStop string correctly for D40|* (alignment token)", p18.tabStops[3].decimalAlignmentToken == "*");
-			assertTrue("Not parsing tabStop string correctly for d50|\\ (algnment token)", p18.tabStops[4].decimalAlignmentToken == " ");
-   		}
-
-   		/* ************************************************************** */
-		/* copy() method */
-		/* ************************************************************** */
-
-		public function copyMethod():void
-		{
-			//Create DECIMAL tabStop (receiving)
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop1.decimalAlignmentToken = undefined;
-			tabStop1.position = 200;
-
-			//create another tabStop (incoming)
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.START;
-			tabStop2.decimalAlignmentToken = ".";
-			tabStop2.position = undefined;
-
-			//Copy tabStop properies to tabStop1
-			tabStop1.copy(tabStop2);
-
-			//All properties should be copied from tabStop2 including "undefined" position value.
-			assertTrue("Tab stop alignment should be copied to " + flash.text.engine.TabAlignment.START,
-			tabStop1.alignment == flash.text.engine.TabAlignment.START);
-			assertTrue("Tab stop align token should be copied to " + tabStop2.decimalAlignmentToken,
-			tabStop1.decimalAlignmentToken == ".");
-			assertTrue("tabstop position should be copied to ", + tabStop2.position, tabStop1.position == undefined);
-			}
-
-		/* ************************************************************** */
-		/* copy() method with null values initializes object
-			with undefined value for all properties*/
-		/* ************************************************************** */
-
-		public function copyNullObject():void
-		{
-			//Create DECIMAL tabStop (receiving)
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop1.decimalAlignmentToken = undefined;
-			tabStop1.position = 200;
-
-			//Copy null object to tabStop2 (explicit difference from apply methond)
-			tabStop1.copy(null);
-
-			//All properties should be copied from tabStop2 including "undefined" position value.
-			assertTrue("Tab stop alignment should not remain as " + flash.text.engine.TabAlignment.DECIMAL + " but, actually is "
-				 + tabStop1.alignment, tabStop1.alignment == undefined);
-			assertTrue("Tab stop align token should remain as undefined but, actually is " + tabStop1.decimalAlignmentToken,
-				tabStop1.decimalAlignmentToken == undefined);
-			assertTrue("tabstop position should not remain as 200 but, actually is", + tabStop1.position, tabStop1.position == undefined);
-			}
-
-		/* ************************************************************** */
-		/* concat() method */
-		/* ************************************************************** */
-
-		public function concatMethod():void
-		{
-			//Create tabstop with some properties set
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.decimalAlignmentToken = ".";
-			tabStop1.position = undefined;
-
-			//Create another tabstop with all properties set
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop2.decimalAlignmentToken = ",";
-			tabStop2.position = 300;
-
-			//Concatinate from incoming (no properties set) to receiving (all properties set)
-			tabStop1.concat(tabStop2);
-
-			//Alignment non-inheritable and becomes computed default value <START>
-			assertTrue("Tab stop alignment should become START, but is actually " + tabStop1.alignment,
-				tabStop1.alignment == flash.text.engine.TabAlignment.START);
-			//decimal Alignment Token is set in both so it won't be concatieated
-			assertTrue("Tab stop decimal alignnment token should not be " + tabStop2.decimalAlignmentToken + " and it should be " +
-				tabStop1.decimalAlignmentToken, tabStop1.decimalAlignmentToken == ".");
-			//position is non-heritable and becomes computed default value <0>
-			assertTrue("Tab stop position should become 0, but is actually " + tabStop1.position, tabStop1.position == 0);
-		}
-
-
-		/* ************************************************************** */
-		/* concatInheritOnly() method */
-		/* ************************************************************** */
-
-		public function concatInheritOnlyMethod():void
-		{
-			//create tabstop without setting propery value.
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.decimalAlignmentToken = undefined;
-			tabStop1.position = 300;
-
-			//create tabstop with all property value set
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop2.decimalAlignmentToken = ".";
-			tabStop2.position = 200;
-
-			//Concatinate inherit property only.  (alignment, decimalAlignToken and position are non-inheritable property)
-			tabStop1.concatInheritOnly(tabStop2);
-
-			//alignmen should be remained as default in tabStop1
-			assertTrue("Tab stop alignment should not be concatenated to " + tabStop2.alignment + " but is actually " +
-				flash.text.engine.TabAlignment.DECIMAL, tabStop1.alignment == undefined);
-			//decimalAlignToken should be remained as undefined as default in tabStop1
-			assertTrue("Tab stop alignment token should not be concatenated to " + tabStop2.decimalAlignmentToken + " but is actually " +
-				tabStop2.decimalAlignmentToken, tabStop1.decimalAlignmentToken == undefined);
-			//position is set as "300" in tabStop1 and it shold not be concatenated by tabStop2
-			assertTrue("Tab stop position should not be concatenated to " + tabStop2.position + " but is actually " +
-				tabStop2.position, tabStop1.position == 300);
-		}
-
-		/* ************************************************************** */
-		/* apply()
-		/* ************************************************************** */
-
-		public function applyMethod():void
-		{
-			//Create tabStop1 (receiving)
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop1.decimalAlignmentToken = undefined;
-			tabStop1.position = 200;
-
-			//create tabStop2 (incoming)
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.START;
-			tabStop2.decimalAlignmentToken = ".";
-			tabStop2.position = undefined;
-
-			//Apply tabStop properies to tabStop1
-			tabStop1.apply(tabStop2);
-
-			//All properties should be applied from tabStop2 excluding undefined value.
-			assertTrue("tabstop1 alignment should be " + tabStop2.alignment + " but, actually is " + tabStop1.alignment,
-				tabStop1.alignment == flash.text.engine.TabAlignment.START);
-			assertTrue("decimalaligntopen should be " + tabStop2.decimalAlignmentToken + " but, actually is " + tabStop1.decimalAlignmentToken,
-				tabStop1.decimalAlignmentToken == ".");
-			//"undefined" value should not be applied
-			assertTrue("tabstop1 position should be 200 " + "but, actually is " + tabStop2.position,
-			tabStop1.position == 200);
-		}
-
-		/* ************************************************************** */
-		/* isEqual() method  (two objects are identical)*/
-		/* ************************************************************** */
-
-		public function twoSameObjects():void
-		{
-			//create tabStop1 object
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.START;
-			tabStop1.decimalAlignmentToken = ".";
-			tabStop1.position = 200;
-
-			//create identical object, tabStop2
-			var tabStop2:TabStopFormat = new TabStopFormat(tabStop1);
-
-			//compare two object
-			TabStopFormat.isEqual(tabStop1,tabStop2);
-
-			var result:Boolean = TabStopFormat.isEqual(tabStop1,tabStop2);
-
-			//two objects should be identical based on the result
-			assertTrue("two objects are same and the result should be " + result, result == true);
-		}
-
-		/* ************************************************************** */
-		/* isEqual() method (two objects are not identical)*/
-		/* ************************************************************** */
-
-		public function twoDifferentObjects():void
-		{
-			//create tabStop1 object including undefined value
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop1.decimalAlignmentToken = ".";
-			tabStop1.position = undefined;
-
-			//create identical object, tabStop2
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.END;
-			tabStop2.decimalAlignmentToken = undefined;
-			tabStop2.position = 300;
-
-			//compare two object
-			TabStopFormat.isEqual(tabStop1,tabStop2);
-
-			var result:Boolean = TabStopFormat.isEqual(tabStop1,tabStop2);
-
-			//two objects are not identical based on the result
-			assertTrue("two objects are not identical and the result should be " + result, result == false);
-		}
-
-		/* ************************************************************** */
-		/* removeClashing() method */
-		/* ************************************************************** */
-		// tabStop1 and tabStop2 has differnt property values
-		public function removeClashing():void
-		{
-			//Create DECIMAL tabStop1 (receiving)
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop1.decimalAlignmentToken = ",";
-			tabStop1.position = 200;
-
-			//create another tabStop (incoming) with different property values
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.START;
-			tabStop2.decimalAlignmentToken = ".";
-			tabStop2.position = 100;
-
-			//run removeClashing method
-			tabStop1.removeClashing(tabStop2);
-
-			//Sets properties in tabStop1 to undefined if they do not match those in the tabStop2 (incoming).
-			assertTrue("Tab stop alignment should be undefined, but actually is " + tabStop1.alignment,
-			tabStop1.alignment == undefined);
-			assertTrue("Tab stop align token should be undefined, but actually is " + tabStop1.decimalAlignmentToken,
-			tabStop1.decimalAlignmentToken == undefined);
-			assertTrue("tabstop position should be undefined, but actually is ", + tabStop1.position, tabStop1.position == undefined);
-		}
-
-		/* ************************************************************** */
-		/* removeMatching() method */
-		/* ************************************************************** */
-
-		public function removeMatching():void
-		{
-			//Create DECIMAL tabStop1 (receiving)
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			tabStop1.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop1.decimalAlignmentToken = ",";
-			tabStop1.position = 200;
-
-			//create another tabStop object (incoming) wtih same property values
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			tabStop2.alignment = flash.text.engine.TabAlignment.DECIMAL;
-			tabStop2.decimalAlignmentToken = ",";
-			tabStop2.position = 200;
-
-			//run removeMatching method
-			tabStop1.removeMatching(tabStop2);
-
-			//Sets properties in tabStop1 to undefined if they do not match those in the tabStop2 (incoming).
-			assertTrue("Tab stop alignment should be undefined, but actually is " + tabStop1.alignment,
-				tabStop1.alignment == undefined);
-			assertTrue("Tab stop align token should be undefined, but actually is " + tabStop1.decimalAlignmentToken,
-				tabStop1.decimalAlignmentToken == undefined);
-			assertTrue("tab stop position should be undefined, but actually is ", + tabStop1.position,
-				tabStop1.position == undefined);
-			}
-
-   	//wating for a bug fix : Bug # 2275363
-   	/***
-   		public function InvalidTabStopString():void
-   		{
-   			var p19:TextLayoutFormat = new TextLayoutFormat();
-   			p19.tabStops = "k300";
-   			SelManager.applyParagraphFormat(p19);
-
-   			var p20:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
-			assertTrue("Parsing invalid tabStop string!", p20.tabStops == undefined);
-
-   		}
-   	***/
-		//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
-		{
-			SelManager.selectAll();
-			SelManager.deleteText();
-			SelManager.insertText("\tAAAAAAA\tBBBBBB");
-			
-			var tlf:TextLayoutFormat = new TextLayoutFormat();
-			
-			//the long string value is the correct test data.  Since this is a Player bug, we can't check in the correct test data until Player fixes the bug. 
-			//Need to remove the comment to check in the correct test data once Player fixes the bug.
-			tlf.tabStops = "e700 e269";
-			//tlf.tabStops = "e700 e269.1499999999998";
-			SelManager.applyParagraphFormat(tlf);
-			TestFrame.flowComposer.updateAllControllers();
-			
-			var tl:TextLine = SelManager.textFlow.flowComposer.getLineAt(0).getTextLine();
-			//second end TAB start at position 8
-			var bounds:Rectangle = tl.getAtomBounds(8);
-			var W:Number = bounds.width;
-			
-			assertTrue("end TAB was not displayed when end Tab with long string value.", W != 0);
-		}
-		
-		public function TabStopFormatTest():void
-		{
-			SelManager.selectAll();
-			SelManager.deleteText();
-			SelManager.insertText("1\txxx\txxx\txxx\n2\tyyyyyy\tyyyyyy\tyyyyyy\n3\tzz\tzz\tzz");
-			
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			var tabStop1:TabStopFormat = new TabStopFormat();
-			var tabStop2:TabStopFormat = new TabStopFormat();
-			var tabStop3:TabStopFormat = new TabStopFormat();
-			
-			tabStop1.alignment = flash.text.engine.TabAlignment.START;
-			var posSet:int = 300;
-			tabStop1.setStyle("position", posSet);
-			var posAfterGet:int = tabStop1.getStyle("position");
-			assertTrue("position after getStyle doesn't match the position set", posSet == posAfterGet);
-			
-			tabStop2.alignment = flash.text.engine.TabAlignment.CENTER;
-			tabStop2.position = 150;
-			tabStop3.alignment = flash.text.engine.TabAlignment.END;
-			tabStop3.position = 250;
-			format.tabStops = new Array(tabStop1,tabStop2,tabStop3);
-			SelManager.textFlow.hostFormat = format;
-			SelManager.textFlow.flowComposer.updateAllControllers(); 
-		}
-
-	}
+    {
+        public function TabTest()
+        {
+            super("", "TabTest", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Tabs";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        /****************************************************
+         Main codes strat here.
+         Validate parsing of string-based tab stop formats
+         ****************************************************/
+
+        [Test]
+        [Ignore]
+        /**
+         * Enter tab without specifying tab stop
+         */
+        public function noTabStop():void
+        {
+            //change the text and recompose
+            SelManager.selectAll();
+            SelManager.deleteText();
+            SelManager.insertText("\tN");
+            TestFrame.flowComposer.updateAllControllers();
+
+            // get the first line
+            var initialLine:TextLine;
+            initialLine = 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;
+
+            //Check the the correct value is in the tab
+            assertTrue("tab should be " + tabValue + " but is " + valueAfterTab, valueAfterTab == tabValue);
+        }
+
+        [Test]
+        /**
+         * TabStops string parsing for "Start"
+         */
+        public function startTabStopString():void
+        {
+            var p1:TextLayoutFormat = new TextLayoutFormat();
+            p1.tabStops = "s300 S200 100";
+            SelManager.applyParagraphFormat(p1);
+
+            var p2:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Start tabStops could not be found", p2.tabStops != undefined);
+
+            //Validating the alignment type string for start
+            assertTrue("Not parsing tabStop string correctly for s300 (type)", p2.tabStops[2].alignment == TabAlignment.START);
+            assertTrue("Not parsing tabStop string correctly for S200 (type)", p2.tabStops[1].alignment == TabAlignment.START);
+            assertTrue("Not parsing tabStop string correctly for 100 (type)", p2.tabStops[0].alignment == TabAlignment.START);
+
+            //Validating the alignment position for each tabStop
+            assertTrue("Not parsing tabStop string correctly for s300 (position)", p2.tabStops[2].position == 300);
+            assertTrue("Not parsing tabStop string correctly for S200 (position)", p2.tabStops[1].position == 200);
+            assertTrue("Not parsing tabStop string correctly for 100 (position)", p2.tabStops[0].position == 100);
+        }
+
+
+        [Test]
+        /**
+         * TabStops string parsing for "Center"
+         */
+        public function centerTabStopString():void
+        {
+            var p3:TextLayoutFormat = new TextLayoutFormat();
+            p3.tabStops = "c500 C400";
+            SelManager.applyParagraphFormat(p3);
+
+            var p4:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Center tabStops could not be found", p4.tabStops != undefined);
+
+            //Validating the alignment type string for center
+            assertTrue("Not parsing tabStop string correctly for c500 (type)", p4.tabStops[1].alignment == TabAlignment.CENTER);
+            assertTrue("Not parsing tabStop string correctly for C400 (type)", p4.tabStops[0].alignment == TabAlignment.CENTER);
+
+            //Validating the alignment position for each tabStop
+            assertTrue("Not parsing tabStop string correctly for c500 (position)", p4.tabStops[1].position == 500);
+            assertTrue("Not parsing tabStop string correctly for C400 (position)", p4.tabStops[0].position == 400);
+        }
+
+        [Test]
+        /**
+         * TabStops string parsing for "End"
+         */
+        public function endTabStopString():void
+        {
+            var p5:TextLayoutFormat = new TextLayoutFormat();
+            p5.tabStops = "e700 E600";
+            SelManager.applyParagraphFormat(p5);
+
+            var p6:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("End tabStops could not be found", p6.tabStops != undefined);
+
+            //Validating the alignment type string for end
+            assertTrue("Not parsing tabStop string correctly for e700 (type)", p6.tabStops[1].alignment == TabAlignment.END);
+            assertTrue("Not parsing tabStop string correctly for E600 (type)", p6.tabStops[0].alignment == TabAlignment.END);
+
+            //Validating the alignment position for each tabStop
+            assertTrue("Not parsing tabStop string correctly for e700 (position)", p6.tabStops[1].position == 700);
+            assertTrue("Not parsing tabStop string correctly for E600 (position)", p6.tabStops[0].position == 600);
+        }
+
+        [Test]
+        /**
+         * TabStops string parsing for "Decimal"
+         */
+        public function decimalTabStopString():void
+        {
+            var p7:TextLayoutFormat = new TextLayoutFormat();
+            p7.tabStops = "d900 D800";
+            SelManager.applyParagraphFormat(p7);
+
+            var p8:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Decimal tabStops could not be found", p8.tabStops != undefined);
+
+            //Validating the alignment type string for dicimal
+            assertTrue("Not parsing tabStop string correctly for d900 (type)", p8.tabStops[1].alignment == TabAlignment.DECIMAL);
+            assertTrue("Not parsing tabStop string correctly for D800 (type)", p8.tabStops[0].alignment == TabAlignment.DECIMAL);
+
+            //Validating the alignment position for each tabStop
+            assertTrue("Not parsing tabStop string correctly for d900 (position)", p8.tabStops[1].position == 900);
+            assertTrue("Not parsing tabStop string correctly for D800 (position)", p8.tabStops[0].position == 800);
+        }
+
+        [Test]
+        /**
+         * Same position tabStops
+         */
+        public function samePositionTabStops():void
+        {
+            var p9:TextLayoutFormat = new TextLayoutFormat();
+            p9.tabStops = "250 c250";
+            SelManager.applyParagraphFormat(p9);
+
+            var p10:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Same position tabStops could not be found", p10.tabStops != undefined);
+
+            //Validating alignment type string for the same position tabStops
+            assertTrue("Not parsing tabStop string correctly for 250 (type)", p10.tabStops[0].alignment == TabAlignment.START);
+            assertTrue("Not parsing tabStop string correctly for c250 (type)", p10.tabStops[1].alignment == TabAlignment.CENTER);
+
+            assertTrue("Not parsing tabStop string correctly for 250 (position)", p10.tabStops[0].position == 250);
+            assertTrue("Not parsing tabStop string correctly for c250 (position)", p10.tabStops[1].position == 250);
+        }
+
+        [Test]
+        public function uniqueNumberTabStops():void
+        {
+            //Decimal number
+            var p11:TextLayoutFormat = new TextLayoutFormat();
+            p11.tabStops = "100.345678";
+            SelManager.applyParagraphFormat(p11);
+
+            var p12:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Long decimal number tabStops could not be found", p12.tabStops != undefined);
+
+            assertTrue("Not parsing tabStop string correctly for 100.345678 (type)", p12.tabStops[0].alignment == TabAlignment.START);
+            assertTrue("Not parsing tabStop string correctly for 100.345678 (position)", p12.tabStops[0].position == 100.345678);
+
+            //Number in scientific notation
+            var p13:TextLayoutFormat = new TextLayoutFormat();
+            p13.tabStops = "150.567e-2";
+            SelManager.applyParagraphFormat(p13);
+
+            var p14:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("scientific notation tabStops could not be found", p14.tabStops != undefined);
+
+            assertTrue("Not parsing tabStop string correctly for 150.567e-2 (type)", p14.tabStops[0].alignment == TabAlignment.START);
+            assertTrue("Not parsing tabStop string correctly for 150.567e-2 (position)", p14.tabStops[0].position == 150.567e-2);
+
+
+            //Very long tabStop string
+            var p15:TextLayoutFormat = new TextLayoutFormat();
+            p15.tabStops = "c34.789763333333";
+            SelManager.applyParagraphFormat(p15);
+
+            var p16:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Long string tabStops could not be found", p16.tabStops != undefined);
+
+            assertTrue("Not parsing tabStop string correctly for c34.789763333333 (type)", p16.tabStops[0].alignment == TabAlignment.CENTER);
+            assertTrue("Not parsing tabStop string correctly for c34.789763333333 (position)", p16.tabStops[0].position == 34.789763333333);
+        }
+
+        [Test]
+        public function alignmentToken():void
+        {
+            var p17:TextLayoutFormat = new TextLayoutFormat();
+            p17.tabStops = "d10|.  D20|\\\\  d30  D40|*  d50|\\ ";
+            SelManager.applyParagraphFormat(p17);
+
+            var p18:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+            assertTrue("Alignment token tabStops could not be found", p18.tabStops != undefined);
+
+            //Validating alignment tokens
+            assertTrue("Not parsing tabStop string correctly for d10|. (alignment token)", p18.tabStops[0].decimalAlignmentToken == ".");
+            assertTrue("Not parsing tabStop string correctly for D20|\\\\  (alignment token)", p18.tabStops[1].decimalAlignmentToken == "\\");
+            assertTrue("Not parsing tabStop string correctly for d30 (alignment token)", p18.tabStops[2].decimalAlignmentToken == ".");
+            assertTrue("Not parsing tabStop string correctly for D40|* (alignment token)", p18.tabStops[3].decimalAlignmentToken == "*");
+            assertTrue("Not parsing tabStop string correctly for d50|\\ (algnment token)", p18.tabStops[4].decimalAlignmentToken == " ");
+        }
+
+        [Test]
+        /**
+         * copy() method
+         */
+        public function copyMethod():void
+        {
+            //Create DECIMAL tabStop (receiving)
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.DECIMAL;
+            tabStop1.decimalAlignmentToken = undefined;
+            tabStop1.position = 200;
+
+            //create another tabStop (incoming)
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.START;
+            tabStop2.decimalAlignmentToken = ".";
+            tabStop2.position = undefined;
+
+            //Copy tabStop properies to tabStop1
+            tabStop1.copy(tabStop2);
+
+            //All properties should be copied from tabStop2 including "undefined" position value.
+            assertTrue("Tab stop alignment should be copied to " + TabAlignment.START,
+                    tabStop1.alignment == TabAlignment.START);
+            assertTrue("Tab stop align token should be copied to " + tabStop2.decimalAlignmentToken,
+                    tabStop1.decimalAlignmentToken == ".");
+            assertTrue("tabstop position should be copied to ", +tabStop2.position, tabStop1.position == undefined);
+        }
+
+        [Test]
+        /**
+         * copy() method with null values initializes object
+         * with undefined value for all properties
+         */
+        public function copyNullObject():void
+        {
+            //Create DECIMAL tabStop (receiving)
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.DECIMAL;
+            tabStop1.decimalAlignmentToken = undefined;
+            tabStop1.position = 200;
+
+            //Copy null object to tabStop2 (explicit difference from apply methond)
+            tabStop1.copy(null);
+
+            //All properties should be copied from tabStop2 including "undefined" position value.
+            assertTrue("Tab stop alignment should not remain as " + TabAlignment.DECIMAL + " but, actually is "
+                    + tabStop1.alignment, tabStop1.alignment == undefined);
+            assertTrue("Tab stop align token should remain as undefined but, actually is " + tabStop1.decimalAlignmentToken,
+                    tabStop1.decimalAlignmentToken == undefined);
+            assertTrue("tabstop position should not remain as 200 but, actually is", +tabStop1.position, tabStop1.position == undefined);
+        }
+
+        [Test]
+        /**
+         * concat() method
+         */
+        public function concatMethod():void
+        {
+            //Create tabstop with some properties set
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.decimalAlignmentToken = ".";
+            tabStop1.position = undefined;
+
+            //Create another tabstop with all properties set
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.DECIMAL;
+            tabStop2.decimalAlignmentToken = ",";
+            tabStop2.position = 300;
+
+            //Concatinate from incoming (no properties set) to receiving (all properties set)
+            tabStop1.concat(tabStop2);
+
+            //Alignment non-inheritable and becomes computed default value <START>
+            assertTrue("Tab stop alignment should become START, but is actually " + tabStop1.alignment,
+                    tabStop1.alignment == TabAlignment.START);
+            //decimal Alignment Token is set in both so it won't be concatieated
+            assertTrue("Tab stop decimal alignnment token should not be " + tabStop2.decimalAlignmentToken + " and it should be " +
+                    tabStop1.decimalAlignmentToken, tabStop1.decimalAlignmentToken == ".");
+            //position is non-heritable and becomes computed default value <0>
+            assertTrue("Tab stop position should become 0, but is actually " + tabStop1.position, tabStop1.position == 0);
+        }
+
+        [Test]
+        /**
+         * concatInheritOnly() method
+         */
+        public function concatInheritOnlyMethod():void
+        {
+            //create tabstop without setting propery value.
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.decimalAlignmentToken = undefined;
+            tabStop1.position = 300;
+
+            //create tabstop with all property value set
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.DECIMAL;
+            tabStop2.decimalAlignmentToken = ".";
+            tabStop2.position = 200;
+
+            //Concatinate inherit property only.  (alignment, decimalAlignToken and position are non-inheritable property)
+            tabStop1.concatInheritOnly(tabStop2);
+
+            //alignmen should be remained as default in tabStop1
+            assertTrue("Tab stop alignment should not be concatenated to " + tabStop2.alignment + " but is actually " +
+                    TabAlignment.DECIMAL, tabStop1.alignment == undefined);
+            //decimalAlignToken should be remained as undefined as default in tabStop1
+            assertTrue("Tab stop alignment token should not be concatenated to " + tabStop2.decimalAlignmentToken + " but is actually " +
+                    tabStop2.decimalAlignmentToken, tabStop1.decimalAlignmentToken == undefined);
+            //position is set as "300" in tabStop1 and it shold not be concatenated by tabStop2
+            assertTrue("Tab stop position should not be concatenated to " + tabStop2.position + " but is actually " +
+                    tabStop2.position, tabStop1.position == 300);
+        }
+
+        [Test]
+        /**
+         * apply()
+         */
+        public function applyMethod():void
+        {
+            //Create tabStop1 (receiving)
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.DECIMAL;
+            tabStop1.decimalAlignmentToken = undefined;
+            tabStop1.position = 200;
+
+            //create tabStop2 (incoming)
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.START;
+            tabStop2.decimalAlignmentToken = ".";
+            tabStop2.position = undefined;
+
+            //Apply tabStop properies to tabStop1
+            tabStop1.apply(tabStop2);
+
+            //All properties should be applied from tabStop2 excluding undefined value.
+            assertTrue("tabstop1 alignment should be " + tabStop2.alignment + " but, actually is " + tabStop1.alignment,
+                    tabStop1.alignment == TabAlignment.START);
+            assertTrue("decimalaligntopen should be " + tabStop2.decimalAlignmentToken + " but, actually is " + tabStop1.decimalAlignmentToken,
+                    tabStop1.decimalAlignmentToken == ".");
+            //"undefined" value should not be applied
+            assertTrue("tabstop1 position should be 200 " + "but, actually is " + tabStop2.position,
+                    tabStop1.position == 200);
+        }
+
+        [Test]
+        /**
+         * isEqual() method  (two objects are identical)
+         */
+        public function twoSameObjects():void
+        {
+            //create tabStop1 object
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.START;
+            tabStop1.decimalAlignmentToken = ".";
+            tabStop1.position = 200;
+
+            //create identical object, tabStop2
+            var tabStop2:TabStopFormat = new TabStopFormat(tabStop1);
+
+            //compare two object
+            TabStopFormat.isEqual(tabStop1, tabStop2);
+
+            var result:Boolean = TabStopFormat.isEqual(tabStop1, tabStop2);
+
+            //two objects should be identical based on the result
+            assertTrue("two objects are same and the result should be " + result, result == true);
+        }
+
+        [Test]
+        /**
+         * isEqual() method (two objects are not identical)
+         */
+        public function twoDifferentObjects():void
+        {
+            //create tabStop1 object including undefined value
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.DECIMAL;
+            tabStop1.decimalAlignmentToken = ".";
+            tabStop1.position = undefined;
+
+            //create identical object, tabStop2
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.END;
+            tabStop2.decimalAlignmentToken = undefined;
+            tabStop2.position = 300;
+
+            //compare two object
+            TabStopFormat.isEqual(tabStop1, tabStop2);
+
+            var result:Boolean = TabStopFormat.isEqual(tabStop1, tabStop2);
+
+            //two objects are not identical based on the result
+            assertTrue("two objects are not identical and the result should be " + result, result == false);
+        }
+
+        [Test]
+        /**
+         * removeClashing() method
+         * tabStop1 and tabStop2 has differnt property values
+         */
+        public function removeClashing():void
+        {
+            //Create DECIMAL tabStop1 (receiving)
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.DECIMAL;
+            tabStop1.decimalAlignmentToken = ",";
+            tabStop1.position = 200;
+
+            //create another tabStop (incoming) with different property values
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.START;
+            tabStop2.decimalAlignmentToken = ".";
+            tabStop2.position = 100;
+
+            //run removeClashing method
+            tabStop1.removeClashing(tabStop2);
+
+            //Sets properties in tabStop1 to undefined if they do not match those in the tabStop2 (incoming).
+            assertTrue("Tab stop alignment should be undefined, but actually is " + tabStop1.alignment,
+                    tabStop1.alignment == undefined);
+            assertTrue("Tab stop align token should be undefined, but actually is " + tabStop1.decimalAlignmentToken,
+                    tabStop1.decimalAlignmentToken == undefined);
+            assertTrue("tabstop position should be undefined, but actually is ", +tabStop1.position, tabStop1.position == undefined);
+        }
+
+        [Test]
+        /**
+         * removeMatching() method
+         */
+        public function removeMatching():void
+        {
+            //Create DECIMAL tabStop1 (receiving)
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            tabStop1.alignment = TabAlignment.DECIMAL;
+            tabStop1.decimalAlignmentToken = ",";
+            tabStop1.position = 200;
+
+            //create another tabStop object (incoming) wtih same property values
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            tabStop2.alignment = TabAlignment.DECIMAL;
+            tabStop2.decimalAlignmentToken = ",";
+            tabStop2.position = 200;
+
+            //run removeMatching method
+            tabStop1.removeMatching(tabStop2);
+
+            //Sets properties in tabStop1 to undefined if they do not match those in the tabStop2 (incoming).
+            assertTrue("Tab stop alignment should be undefined, but actually is " + tabStop1.alignment,
+                    tabStop1.alignment == undefined);
+            assertTrue("Tab stop align token should be undefined, but actually is " + tabStop1.decimalAlignmentToken,
+                    tabStop1.decimalAlignmentToken == undefined);
+            assertTrue("tab stop position should be undefined, but actually is ", +tabStop1.position,
+                    tabStop1.position == undefined);
+        }
+
+        //wating for a bug fix : Bug # 2275363
+        /***
+         public function InvalidTabStopString():void
+         {
+             var p19:TextLayoutFormat = new TextLayoutFormat();
+             p19.tabStops = "k300";
+             SelManager.applyParagraphFormat(p19);
+
+             var p20:ITextLayoutFormat = SelManager.getCommonParagraphFormat();
+          assertTrue("Parsing invalid tabStop string!", p20.tabStops == undefined);
+
+         }
+         ***/
+
+        [Test]
+        /**
+         * 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
+        {
+            SelManager.selectAll();
+            SelManager.deleteText();
+            SelManager.insertText("\tAAAAAAA\tBBBBBB");
+
+            var tlf:TextLayoutFormat = new TextLayoutFormat();
+
+            //the long string value is the correct test data.  Since this is a Player bug, we can't check in the correct test data until Player fixes the bug.
+            //Need to remove the comment to check in the correct test data once Player fixes the bug.
+            tlf.tabStops = "e700 e269";
+            //tlf.tabStops = "e700 e269.1499999999998";
+            SelManager.applyParagraphFormat(tlf);
+            TestFrame.flowComposer.updateAllControllers();
+
+            var tl:TextLine = SelManager.textFlow.flowComposer.getLineAt(0).getTextLine();
+            //second end TAB start at position 8
+            var bounds:Rectangle = tl.getAtomBounds(8);
+            var W:Number = bounds.width;
+
+            assertTrue("end TAB was not displayed when end Tab with long string value.", W != 0);
+        }
+
+        [Test]
+        public function TabStopFormatTest():void
+        {
+            SelManager.selectAll();
+            SelManager.deleteText();
+            SelManager.insertText("1\txxx\txxx\txxx\n2\tyyyyyy\tyyyyyy\tyyyyyy\n3\tzz\tzz\tzz");
+
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            var tabStop1:TabStopFormat = new TabStopFormat();
+            var tabStop2:TabStopFormat = new TabStopFormat();
+            var tabStop3:TabStopFormat = new TabStopFormat();
+
+            tabStop1.alignment = TabAlignment.START;
+            var posSet:int = 300;
+            tabStop1.setStyle("position", posSet);
+            var posAfterGet:int = tabStop1.getStyle("position");
+            assertTrue("position after getStyle doesn't match the position set", posSet == posAfterGet);
+
+            tabStop2.alignment = TabAlignment.CENTER;
+            tabStop2.position = 150;
+            tabStop3.alignment = TabAlignment.END;
+            tabStop3.position = 250;
+            format.tabStops = new Array(tabStop1, tabStop2, tabStop3);
+            SelManager.textFlow.hostFormat = format;
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+    }
 }
 
 


[40/44] git commit: [flex-tlf] [refs/heads/tables] - Add echo to build.xml for print minimalTests value

Posted by pi...@apache.org.
Add echo to build.xml for print minimalTests value


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

Branch: refs/heads/tables
Commit: 658cf60363214352696a7c9da05e3d09b7aef48f
Parents: 92989fb
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 26 22:03:11 2014 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 26 22:03:11 2014 +0100

----------------------------------------------------------------------
 build.properties | 2 +-
 build.xml        | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/658cf603/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 23f4561..925d779 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 forkValue = true
-minimalTests = true
+minimalTests = false
 
 # JVM options for <compc> and <mxmlc> tasks
 jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/658cf603/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 6feb0e3..a7c5bb5 100644
--- a/build.xml
+++ b/build.xml
@@ -26,7 +26,7 @@
     <!-- Default Flex SDK is the trunk.  Override on cmd line with -D=FLEX_HOME=path. -->
 	<property name="FLEX_HOME" value="${basedir}/../flex-sdk"/>
 	<echo>FLEX_HOME is ${FLEX_HOME}</echo>
-	
+    <echo>Minimal test is set ${minimalTests}</echo>
 
 	<property name="flex.sdk.frameworks" value="${FLEX_HOME}/frameworks"/>
 	<property name="flex.locale" value="en_US"/>
@@ -363,7 +363,6 @@
 			</fileset>
 		</copy>
 	</target>
-
     <target name="flexunnit_tests">
         <flexunit swf="${output.dir}/apps/automation_apps/bin/VellumUnit.swf" player="flash" toDir="${output.dir}/apps/automation_apps/bin" haltonfailure="true" verbose="true" />
     </target>


[18/44] git commit: [flex-tlf] [refs/heads/tables] - Merge remote-tracking branch 'remotes/origin/develop' into FlexUnit4TestsTLF

Posted by pi...@apache.org.
Merge remote-tracking branch 'remotes/origin/develop' into FlexUnit4TestsTLF


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

Branch: refs/heads/tables
Commit: cb9abbbdb78ef848fb443b5fe25db6467642dccb
Parents: 02fcc72 1a9f875
Author: piotrz <pi...@gmail.com>
Authored: Wed Oct 15 21:19:25 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Wed Oct 15 21:19:25 2014 +0200

----------------------------------------------------------------------
 .../textLayout/container/ContainerController.as | 129 +++++++++----------
 .../flashx/textLayout/utils/NavigationUtil.as   |   3 +-
 2 files changed, 60 insertions(+), 72 deletions(-)
----------------------------------------------------------------------



[23/44] git commit: [flex-tlf] [refs/heads/tables] - Remove additional mxmlc buld of Flow.swf from testApps target in build.xml

Posted by pi...@apache.org.
Remove additional mxmlc buld of Flow.swf from testApps target in build.xml


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

Branch: refs/heads/tables
Commit: 9c449d82d54a2d00859bba73cc9cf4d739171af0
Parents: 620baf2
Author: piotrz <pi...@gmail.com>
Authored: Mon Oct 20 20:58:38 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Mon Oct 20 20:58:38 2014 +0200

----------------------------------------------------------------------
 build.xml | 24 ------------------------
 1 file changed, 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/9c449d82/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 761f299..e6c7eaf 100644
--- a/build.xml
+++ b/build.xml
@@ -194,30 +194,6 @@
      </target>
 
 	<target name="testApps" description="Builds TLF test application">
-		<mxmlc fork="${forkValue}" 	file="${testApps.dir}/src/flowCss.css" 
-				keep-generated-actionscript="false"
-				output="${output.dir}/apps/automation_apps/bin/Flow.swf">
-			<jvmarg line="${jvm.args}"/>
-			<library-path/>
-			<library-path dir="${output.dir}" includes="textLayout.swc" append="true"/>
-			<library-path dir="${output.dir}/apps/testApps/bin" includes="textLayout_ui.swc" append="true"/>
-			<library-path dir="${output.dir}/apps/testApps/bin" includes="textLayout_editBar.swc" append="true"/>
-			
-			<!-- <library-path dir="${flex.sdk.frameworks}/libs/" includes="flex.swc" append="true"/> --><!-- for Flex SDK 4.0 -->
-			<library-path dir="${flex.sdk.frameworks}/libs/mx/" includes="mx.swc" append="true"/><!-- for Flex SDK 4.5 -->
-			
-			<library-path dir="${flex.sdk.frameworks}/libs/" includes="flex4.swc" append="true"/>
-			<library-path dir="${flex.sdk.frameworks}/libs/" includes="framework.swc" append="true"/>
-			<library-path dir="${flex.sdk.frameworks}/libs/" includes="rpc.swc" append="true"/>
-			<library-path dir="${flex.sdk.frameworks}/libs/" includes="spark.swc" append="true"/>
-			<library-path dir="${flex.sdk.frameworks}/libs/" includes="sparkskins.swc" append="true"/>
-			<library-path dir="${flex.sdk.frameworks}/locale/${flex.locale}/" includes="framework_rb.swc" append="true"/> 
-			<library-path dir="${flex.sdk.frameworks}/locale/${flex.locale}/" includes="spark_rb.swc" append="true"/> 
-			<library-path dir="${flex.sdk.frameworks}/locale/${flex.locale}/" includes="rpc_rb.swc" append="true"/>
-			<library-path dir="${flex.sdk.frameworks}/locale/${flex.locale}/" includes="flex4_rb.swc" append="true"/> 
-			<static-link-runtime-shared-libraries/>
-		</mxmlc>
-
 		<mxmlc fork="${forkValue}" 	file="${testApps.dir}/src/Flow.mxml" 
 				keep-generated-actionscript="false"
 				output="${output.dir}/apps/automation_apps/bin/Flow.swf">


[39/44] git commit: [flex-tlf] [refs/heads/tables] - Set minimalTests property to true just for check ContainerTypeTest

Posted by pi...@apache.org.
Set minimalTests property to true just for check ContainerTypeTest


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

Branch: refs/heads/tables
Commit: 92989fb0c22d44625ba973e7b7e6e458793655e9
Parents: db7894f
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 26 21:50:31 2014 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 26 21:50:31 2014 +0100

----------------------------------------------------------------------
 automation_tests/src/MinimalTestsSuite.as | 4 ++--
 build.properties                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/92989fb0/automation_tests/src/MinimalTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/MinimalTestsSuite.as b/automation_tests/src/MinimalTestsSuite.as
index 93ef569..7f4b558 100644
--- a/automation_tests/src/MinimalTestsSuite.as
+++ b/automation_tests/src/MinimalTestsSuite.as
@@ -19,13 +19,13 @@
 package
 {
 
-    import UnitTest.Tests.FactoryImportTest;
+    import UnitTest.Tests.ContainerTypeTest;
 
     [Suite]
     [RunWith("org.flexunit.runners.Suite")]
     public dynamic class MinimalTestsSuite
     {
-        public var factoryImportTest:FactoryImportTest;
+        public var containerTypeTest:ContainerTypeTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/92989fb0/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 925d779..23f4561 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 forkValue = true
-minimalTests = false
+minimalTests = true
 
 # JVM options for <compc> and <mxmlc> tasks
 jvm.args = ${local.d32} -Xms64m -Xmx1024m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -ea -Dapple.awt.UIElement=true


[36/44] git commit: [flex-tlf] [refs/heads/tables] - Merge branch 'FLEX-26478' into develop

Posted by pi...@apache.org.
Merge branch 'FLEX-26478' into develop


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

Branch: refs/heads/tables
Commit: fad7b298e0268ec5704090052ab2751456704854
Parents: 95fecf4 bebdb18
Author: Mihai Chira <mi...@apache.org>
Authored: Thu Oct 23 12:27:54 2014 +0100
Committer: Mihai Chira <mi...@apache.org>
Committed: Thu Oct 23 12:27:54 2014 +0100

----------------------------------------------------------------------
 .../textLayout/compose/StandardFlowComposer.as  |  44 +++---
 .../textLayout/container/ContainerController.as | 138 ++++++++++---------
 2 files changed, 91 insertions(+), 91 deletions(-)
----------------------------------------------------------------------



[44/44] git commit: [flex-tlf] [refs/heads/tables] - Merge remote-tracking branch 'remotes/origin/develop' into tables

Posted by pi...@apache.org.
Merge remote-tracking branch 'remotes/origin/develop' into tables

* remotes/origin/develop: (31 commits)
  Add TabTest with ingnored noTabStop test
  Add WritingModeTest, UndoRedoTest, TextFlowEditTest Remove unused variable from TestDescriptorRunner
  Back to the original implementation Ignore arrowUp and arrowDown tests in GeneralFunctionsTest
  Add echo to build.xml for print minimalTests value
  Set minimalTests property to true just for check ContainerTypeTest
  Add property minimalTests to make MinimalTestsSuite runnable
  FLEX-34611: Application crash when textFlow property set to null with preserveSelection
  FLEX-26478 Responding to dev review by adding curly braces around if clauses. Also optimised imports and renamed comment parameters in StandardFlowComposer and ContainerController.
  Remove unused import in ContainerAttributeTest
  FLEX-26478 CAUSE: When replacing ContainerControllers (triggered when the text changes in a TextField / TextArea), StandardFlowComposer tried to dispose of the discarded ones first. It did this by calling clearSelectionShapes() and setRootElement(null) on the ContainerControllers. However, if that controller was already listening for mouse scroll events (when the user selects text and moves the mouse outside the text field in such a way that causes the text to scroll), this listener wasn't removed. Which meant that the next time scrollTimerHandler() was called (on the inactive ContainerController), textFlow was null due to the call to setRootElement(null).
  Revert "revert these to see if they made a difference"
  revert these to see if they made a difference
  Attempt to fix build - set forkValue to true
  another attempt to fix flex-tlf
  Try to fix build with really high values -Xmx1024m -XX:MaxPermSize=1024m
  Try to fix build increase -Xmx512m
  Try to fix build - higher values for MaxPermSize=768
  Back to the original values for jvm.args
  Remove additional mxmlc buld of Flow.swf from testApps target in build.xml
  try even more PermGen
  ...

Conflicts:
	textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
	textLayout/src/flashx/textLayout/container/ContainerController.as


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

Branch: refs/heads/tables
Commit: f6348cdba36e64b3b4af39212915916a263d1009
Parents: 84e8b25 1d79e24
Author: piotrz <pi...@apache.org>
Authored: Mon Nov 3 21:49:55 2014 +0100
Committer: piotrz <pi...@apache.org>
Committed: Mon Nov 3 21:49:55 2014 +0100

----------------------------------------------------------------------
 .../src/UnitTest/TestDescriptorRunner.mxml      |   13 +-
 automation_apps/src/VellumUnit.mxml             |    7 +-
 automation_core/src/AutomationCoreClasses.as    |    2 +
 .../UnitTest/ExtendedClasses/VellumTestCase.as  |    1 -
 automation_tests/src/AllTestsSuite.as           |   23 +-
 automation_tests/src/MinimalTestsSuite.as       |    4 +-
 .../UnitTest/Tests/BoundsAndAlignmentTest.as    |  278 +-
 automation_tests/src/UnitTest/Tests/BoxTest.as  |   51 +-
 .../UnitTest/Tests/ContainerAttributeTest.as    |    1 -
 .../src/UnitTest/Tests/ContainerTypeTest.as     |    8 -
 .../src/UnitTest/Tests/CrossContainerTest.as    |  430 ++-
 .../src/UnitTest/Tests/ElementOperationTest.as  | 1192 ++++++++
 .../src/UnitTest/Tests/ElementOperationTests.as | 1228 --------
 .../src/UnitTest/Tests/EventOverrideTest.as     |  905 +++---
 .../src/UnitTest/Tests/FactoryImportTest.as     |  250 +-
 .../src/UnitTest/Tests/FloatTest.as             |   84 -
 .../src/UnitTest/Tests/FlowModelTest.as         | 1920 ++++++-------
 .../src/UnitTest/Tests/GeneralFunctionsTest.as  | 2675 +++++++++---------
 automation_tests/src/UnitTest/Tests/TabTest.as  | 1087 +++----
 .../src/UnitTest/Tests/TextFlowEditTest.as      |  305 +-
 .../src/UnitTest/Tests/UndoRedoTest.as          |  153 +-
 .../src/UnitTest/Tests/WritingModeTest.as       |  795 +++---
 build.properties                                |   40 +
 build.xml                                       |   30 +-
 .../textLayout/compose/StandardFlowComposer.as  |   47 +-
 .../textLayout/container/ContainerController.as |  262 +-
 .../container/TextContainerManager.as           |    2 +-
 .../src/flashx/textLayout/edit/TextClipboard.as |   15 +-
 .../flashx/textLayout/utils/NavigationUtil.as   |    3 +-
 29 files changed, 5660 insertions(+), 6151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/f6348cdb/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/f6348cdb/textLayout/src/flashx/textLayout/container/ContainerController.as
----------------------------------------------------------------------
diff --cc textLayout/src/flashx/textLayout/container/ContainerController.as
index 08f4a68,f992734..a000035
--- a/textLayout/src/flashx/textLayout/container/ContainerController.as
+++ b/textLayout/src/flashx/textLayout/container/ContainerController.as
@@@ -18,78 -18,68 +18,115 @@@
  ////////////////////////////////////////////////////////////////////////////////
  package flashx.textLayout.container 
  {
- 	import flash.display.BlendMode;
- 	import flash.display.DisplayObject;
- 	import flash.display.DisplayObjectContainer;
- 	import flash.display.InteractiveObject;
- 	import flash.display.Shape;
- 	import flash.display.Sprite;
- 	import flash.events.ContextMenuEvent;
- 	import flash.events.Event;
- 	import flash.events.FocusEvent;
- 	import flash.events.IMEEvent;
- 	import flash.events.KeyboardEvent;
- 	import flash.events.MouseEvent;
- 	import flash.events.TextEvent;
- 	import flash.events.TimerEvent;
- 	import flash.geom.Matrix;
- 	import flash.geom.Point;
- 	import flash.geom.Rectangle;
- 	import flash.text.engine.TextBlock;
- 	import flash.text.engine.TextLine;
- 	import flash.text.engine.TextLineValidity;
- 	import flash.ui.ContextMenu;
- 	import flash.ui.ContextMenuClipboardItems;
- 	import flash.utils.Dictionary;
- 	import flash.utils.Timer;
+     import flash.display.BlendMode;
+     import flash.display.DisplayObject;
+     import flash.display.DisplayObjectContainer;
+     import flash.display.Shape;
+     import flash.display.Sprite;
+     import flash.events.ContextMenuEvent;
+     import flash.events.Event;
+     import flash.events.FocusEvent;
+     import flash.events.IEventDispatcher;
+     import flash.events.IMEEvent;
+     import flash.events.KeyboardEvent;
+     import flash.events.MouseEvent;
+     import flash.events.TextEvent;
+     import flash.events.TimerEvent;
+     import flash.geom.Matrix;
+     import flash.geom.Point;
+     import flash.geom.Rectangle;
+     import flash.text.engine.TextBlock;
+     import flash.text.engine.TextLine;
+     import flash.text.engine.TextLineValidity;
+     import flash.ui.ContextMenu;
+     import flash.ui.ContextMenuClipboardItems;
+     import flash.utils.Dictionary;
+     import flash.utils.Timer;
+ 
+     import flashx.textLayout.compose.FloatCompositionData;
+     import flashx.textLayout.compose.FlowDamageType;
+     import flashx.textLayout.compose.IFlowComposer;
+     import flashx.textLayout.compose.TextFlowLine;
+     import flashx.textLayout.compose.TextLineRecycler;
+     import flashx.textLayout.debug.Debugging;
+     import flashx.textLayout.debug.assert;
+     import flashx.textLayout.edit.EditingMode;
+     import flashx.textLayout.edit.IInteractionEventHandler;
+     import flashx.textLayout.edit.ISelectionManager;
+     import flashx.textLayout.edit.SelectionFormat;
+     import flashx.textLayout.elements.BackgroundManager;
+     import flashx.textLayout.elements.Configuration;
+     import flashx.textLayout.elements.ContainerFormattedElement;
+     import flashx.textLayout.elements.FlowElement;
+     import flashx.textLayout.elements.FlowLeafElement;
+     import flashx.textLayout.elements.FlowValueHolder;
+     import flashx.textLayout.elements.InlineGraphicElement;
+     import flashx.textLayout.elements.ParagraphElement;
+     import flashx.textLayout.elements.TCYElement;
+     import flashx.textLayout.elements.TextFlow;
+     import flashx.textLayout.events.FlowElementMouseEventManager;
+     import flashx.textLayout.events.ModelChange;
+     import flashx.textLayout.events.ScrollEvent;
+     import flashx.textLayout.events.ScrollEventDirection;
+     import flashx.textLayout.events.TextLayoutEvent;
+     import flashx.textLayout.events.UpdateCompleteEvent;
+     import flashx.textLayout.formats.BlockProgression;
+     import flashx.textLayout.formats.Float;
+     import flashx.textLayout.formats.FormatValue;
+     import flashx.textLayout.formats.ITextLayoutFormat;
+     import flashx.textLayout.formats.TextLayoutFormat;
+     import flashx.textLayout.tlf_internal;
+     import flashx.textLayout.utils.Twips;
+ 
+     use namespace tlf_internal;
  	
 +	import flashx.textLayout.compose.FloatCompositionData;
 +	import flashx.textLayout.compose.FlowComposerBase;
 +	import flashx.textLayout.compose.FlowDamageType;
 +	import flashx.textLayout.compose.IFlowComposer;
 +	import flashx.textLayout.compose.TextFlowLine;
 +	import flashx.textLayout.compose.TextFlowTableBlock;
 +	import flashx.textLayout.compose.TextLineRecycler;
 +	import flashx.textLayout.debug.Debugging;
 +	import flashx.textLayout.debug.assert;
 +	import flashx.textLayout.edit.EditingMode;
 +	import flashx.textLayout.edit.IInteractionEventHandler;
 +	import flashx.textLayout.edit.ISelectionManager;
 +	import flashx.textLayout.edit.SelectionFormat;
 +	import flashx.textLayout.elements.BackgroundManager;
 +	import flashx.textLayout.elements.CellCoordinates;
 +	import flashx.textLayout.elements.CellRange;
 +	import flashx.textLayout.elements.Configuration;
 +	import flashx.textLayout.elements.ContainerFormattedElement;
 +	import flashx.textLayout.elements.FlowElement;
 +	import flashx.textLayout.elements.FlowLeafElement;
 +	import flashx.textLayout.elements.FlowValueHolder;
 +	import flashx.textLayout.elements.InlineGraphicElement;
 +	import flashx.textLayout.elements.LinkElement;
 +	import flashx.textLayout.elements.ParagraphElement;
 +	import flashx.textLayout.elements.TableBlockContainer;
 +	import flashx.textLayout.elements.TableCellElement;
 +	import flashx.textLayout.elements.TableElement;
 +	import flashx.textLayout.elements.TableRowElement;
 +	import flashx.textLayout.elements.TextFlow;
 +	import flashx.textLayout.events.FlowElementMouseEvent;
 +	import flashx.textLayout.events.FlowElementMouseEventManager;
 +	import flashx.textLayout.events.ModelChange;
 +	import flashx.textLayout.events.ScrollEvent;
 +	import flashx.textLayout.events.ScrollEventDirection;
 +	import flashx.textLayout.events.TextLayoutEvent;
 +	import flashx.textLayout.events.UpdateCompleteEvent;
 +	import flashx.textLayout.formats.BlockProgression;
 +	import flashx.textLayout.formats.Float;
 +	import flashx.textLayout.formats.FormatValue;
 +	import flashx.textLayout.formats.ITextLayoutFormat;
 +	import flashx.textLayout.formats.TextLayoutFormat;
 +	import flashx.textLayout.property.Property;
 +	import flashx.textLayout.tlf_internal;
 +	import flashx.textLayout.utils.Twips;
 +	
 +	use namespace tlf_internal;
 +	
  	/** 
  	 * The ContainerController class defines the relationship between a TextFlow object and a container.
  	 * A TextFlow may have one or more rectangular areas that can hold text; the text is said to be flowing


[09/44] git commit: [flex-tlf] [refs/heads/tables] - Merge branch 'FlexUnit4TestsTLF' into develop

Posted by pi...@apache.org.
Merge branch 'FlexUnit4TestsTLF' into develop


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

Branch: refs/heads/tables
Commit: 3a4075c0060b0402c904a7346cd5fea219d2d914
Parents: 0b57945 895152c
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:51:51 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:51:51 2014 +0200

----------------------------------------------------------------------
 automation_core/src/AutomationCoreClasses.as                   | 2 ++
 automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[27/44] git commit: [flex-tlf] [refs/heads/tables] - Try to fix build increase -Xmx512m

Posted by pi...@apache.org.
Try to fix build increase -Xmx512m


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

Branch: refs/heads/tables
Commit: 4abd0a6f449c513b2a3bef4c97e2878bf167e6b0
Parents: af7ec2f
Author: Piotr Zarzycki <pi...@grapeup.com>
Authored: Tue Oct 21 09:50:34 2014 +0200
Committer: Piotr Zarzycki <pi...@grapeup.com>
Committed: Tue Oct 21 09:50:34 2014 +0200

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/4abd0a6f/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index a644f8f..65b4e52 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx384m -XX:MaxPermSize=768m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx512m -XX:MaxPermSize=768m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[10/44] git commit: [flex-tlf] [refs/heads/tables] - Halt TLF build on tests failure

Posted by pi...@apache.org.
Halt TLF build on tests failure


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

Branch: refs/heads/tables
Commit: 0ca7dea0f11535463cbaea24bbefd3bd49c17774
Parents: 895152c
Author: piotrz <pi...@gmail.com>
Authored: Mon Oct 13 07:44:04 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Mon Oct 13 07:44:04 2014 +0200

----------------------------------------------------------------------
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/0ca7dea0/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index c246965..761f299 100644
--- a/build.xml
+++ b/build.xml
@@ -388,6 +388,6 @@
 	</target>
 
     <target name="flexunnit_tests">
-        <flexunit swf="${output.dir}/apps/automation_apps/bin/VellumUnit.swf" player="flash" toDir="${output.dir}/apps/automation_apps/bin" haltonfailure="false" verbose="true" />
+        <flexunit swf="${output.dir}/apps/automation_apps/bin/VellumUnit.swf" player="flash" toDir="${output.dir}/apps/automation_apps/bin" haltonfailure="true" verbose="true" />
     </target>
 </project>


[06/44] git commit: [flex-tlf] [refs/heads/tables] - Add FactoryImportTest.as and FlowModelTest.as

Posted by pi...@apache.org.
Add FactoryImportTest.as and FlowModelTest.as


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

Branch: refs/heads/tables
Commit: 7961f3323e965e10bbff8947affddab8936c5f95
Parents: c105912
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:12:35 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:12:35 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |    4 +
 automation_tests/src/MinimalTestsSuite.as       |    4 +-
 .../src/UnitTest/Tests/FactoryImportTest.as     |  250 +--
 .../src/UnitTest/Tests/FloatTest.as             |   84 -
 .../src/UnitTest/Tests/FlowModelTest.as         | 1920 +++++++++---------
 5 files changed, 1101 insertions(+), 1161 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index a13ac01..f6f8045 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -33,7 +33,9 @@ package
     import UnitTest.Tests.CrossContainerTest;
     import UnitTest.Tests.ElementOperationTest;
     import UnitTest.Tests.EventOverrideTest;
+    import UnitTest.Tests.FactoryImportTest;
     import UnitTest.Tests.FloatTest;
+    import UnitTest.Tests.FlowModelTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
 
@@ -41,6 +43,7 @@ package
     [RunWith("org.flexunit.runners.Suite")]
     public dynamic class AllTestsSuite
     {
+        public var factoryImportTest:FactoryImportTest;
         public var accessibilityMethodsTest:AccessibilityMethodsTest;
         public var allChartAttributeTest:AllCharAttributeTest;
         public var allContAttirbuteTest:AllContAttributeTest;
@@ -58,6 +61,7 @@ package
         public var crossContainerTest:CrossContainerTest;
         public var elementOperationTest:ElementOperationTest;
         public var eventOverrideTest:EventOverrideTest;
+        public var flowModelTest:FlowModelTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/MinimalTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/MinimalTestsSuite.as b/automation_tests/src/MinimalTestsSuite.as
index 3122012..93ef569 100644
--- a/automation_tests/src/MinimalTestsSuite.as
+++ b/automation_tests/src/MinimalTestsSuite.as
@@ -19,13 +19,13 @@
 package
 {
 
-    import UnitTest.Tests.AccessibilityMethodsTest;
+    import UnitTest.Tests.FactoryImportTest;
 
     [Suite]
     [RunWith("org.flexunit.runners.Suite")]
     public dynamic class MinimalTestsSuite
     {
-        public var accessibilityMethodsTest:AccessibilityMethodsTest;
+        public var factoryImportTest:FactoryImportTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/FactoryImportTest.as b/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
index 17e2220..b8bb3dc 100644
--- a/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
+++ b/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
@@ -18,132 +18,134 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.FileRepository;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.display.*;
-	import flash.geom.Rectangle;
-	import flash.text.engine.TextLine;
-	
-	import flashx.textLayout.conversion.ITextImporter;
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.elements.FlowLeafElement;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.factory.TextFlowTextLineFactory;
-	
-	import mx.containers.Canvas;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.FileRepository;
+    import UnitTest.Fixtures.TestConfig;
 
-    import org.flexunit.asserts.fail;
+    import flash.display.*;
+    import flash.geom.Rectangle;
+    import flash.text.engine.TextLine;
+
+    import flashx.textLayout.conversion.ITextImporter;
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.elements.FlowLeafElement;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.factory.TextFlowTextLineFactory;
 
+    import mx.containers.Canvas;
+
+    import org.flexunit.asserts.fail;
 
     public class FactoryImportTest extends VellumTestCase
-	{
-		private var ItemsToRemove:Array;
-		private var TestCanvas:Canvas = null;
-		private var fileForFactory:String;
-		private var flowFromXML:TextFlow;
-
-		public function FactoryImportTest(fileToImport:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
-		{
-			super ("doThis", testID, testConfig, testCaseXML);
-			containerType = "custom";
-			fileForFactory = fileToImport;
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Import/Export";
-		}
-
-		public function doThis():void
-		{
-			var xmlRoot:XML = FileRepository.getFileAsXML(baseURL,"../../test/testFiles/markup/tlf/" + fileForFactory);
-			if (!xmlRoot)
-			{
-				fail("File not loaded -- timeout?");
-				return;
-			}
-			var parser:ITextImporter = testDataImportParser;
-			flowFromXML = parser.importToFlow(xmlRoot);
-			processInlines(flowFromXML);
-			buildVellumFactory();
-			//TestCanvas.rawChildren.addChild(_rslt);
-		}
-
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = FactoryImportTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-		override public function setUpTest() : void
-		{
-			cleanUpTestApp();
-			ItemsToRemove = [];
-			TestDisplayObject = testApp.getDisplayObject();
-			if (TestDisplayObject)
-			{
-				TestCanvas = Canvas(TestDisplayObject);
-			}
-			else
-			{
-				fail ("Did not get a blank canvas to work with");
-			}
-		}
-
-		private static function getExtension(fileName:String):String
-		{
-			var dotPos:int = fileName.lastIndexOf(".");
-			if (dotPos >= 0)
-				return fileName.substring(dotPos + 1);
-			return fileName;
-		}
-
-		protected function get testDataImportParser():ITextImporter
-		{
-			var extension:String = getExtension(fileForFactory);
-			if (extension == "xml")
-				extension = TextConverter.TEXT_LAYOUT_FORMAT;
-			else if (extension == "txt")
-				extension = TextConverter.PLAIN_TEXT_FORMAT;
-			return TextConverter.getImporter(extension);
-		}
-		
-		private function processInlines(textFlow:TextFlow):void
-		{
-			for (var leaf:FlowLeafElement = textFlow.getFirstLeaf(); leaf; leaf = leaf.getNextLeaf())
-			{
-				if (leaf is InlineGraphicElement /* && InlineGraphicElement(leaf).source == null */)
-				{
-					var ilg:InlineGraphicElement = InlineGraphicElement(leaf);
-
-					// Create a filler inline, simple filled rect
-					var displayObject:Sprite = new Sprite();
-					var g:Graphics = displayObject.graphics;
-					g.beginFill(0xFF0000);
-					g.drawRect(0, 0, Number(ilg.width), Number(ilg.height));
-					g.endFill();
-					ilg.source = displayObject;
-				}
-			}
-		}
-
-		public function callback(dispObj:DisplayObject):void
-		{
-			TestCanvas.rawChildren.addChild(dispObj);
-
-			if(dispObj is TextLine)
-			{
-				ItemsToRemove.push (dispObj as TextLine);
-			}
-		}
-		/** use the vellum factory via the callback */
-		public function buildVellumFactory():void //DisplayObject
-		{
-			var factory:TextFlowTextLineFactory = new TextFlowTextLineFactory();
-			factory.compositionBounds = new Rectangle(0, 0, TestCanvas.width, TestCanvas.height);
-			factory.createTextLines(callback,flowFromXML);
-		}
-	}
+    {
+        private var ItemsToRemove:Array;
+        private var TestCanvas:Canvas = null;
+        private var fileForFactory:String;
+        private var flowFromXML:TextFlow;
+
+        public function FactoryImportTest()
+        {
+            super("", "EventOverrideTest", TestConfig.getInstance());
+
+            containerType = "custom";
+            fileForFactory = "simple.xml";
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Import/Export";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            cleanUpTestApp();
+            ItemsToRemove = [];
+            TestDisplayObject = testApp.getDisplayObject();
+            if (TestDisplayObject)
+            {
+                TestCanvas = Canvas(TestDisplayObject);
+            }
+            else
+            {
+                fail("Did not get a blank canvas to work with");
+            }
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        public function importTest():void
+        {
+            var xmlRoot:XML = FileRepository.getFileAsXML(baseURL, "../../test/testFiles/markup/tlf/" + fileForFactory);
+            if (!xmlRoot)
+            {
+                fail("File not loaded -- timeout?");
+                return;
+            }
+            var parser:ITextImporter = testDataImportParser;
+            flowFromXML = parser.importToFlow(xmlRoot);
+            processInlines(flowFromXML);
+            buildVellumFactory();
+        }
+
+        private static function getExtension(fileName:String):String
+        {
+            var dotPos:int = fileName.lastIndexOf(".");
+            if (dotPos >= 0)
+                return fileName.substring(dotPos + 1);
+            return fileName;
+        }
+
+        protected function get testDataImportParser():ITextImporter
+        {
+            var extension:String = getExtension(fileForFactory);
+            if (extension == "xml")
+                extension = TextConverter.TEXT_LAYOUT_FORMAT;
+            else if (extension == "txt")
+                extension = TextConverter.PLAIN_TEXT_FORMAT;
+            return TextConverter.getImporter(extension);
+        }
+
+        private function processInlines(textFlow:TextFlow):void
+        {
+            for (var leaf:FlowLeafElement = textFlow.getFirstLeaf(); leaf; leaf = leaf.getNextLeaf())
+            {
+                if (leaf is InlineGraphicElement /* && InlineGraphicElement(leaf).source == null */)
+                {
+                    var ilg:InlineGraphicElement = InlineGraphicElement(leaf);
+
+                    // Create a filler inline, simple filled rect
+                    var displayObject:Sprite = new Sprite();
+                    var g:Graphics = displayObject.graphics;
+                    g.beginFill(0xFF0000);
+                    g.drawRect(0, 0, Number(ilg.width), Number(ilg.height));
+                    g.endFill();
+                    ilg.source = displayObject;
+                }
+            }
+        }
+
+        private function callback(dispObj:DisplayObject):void
+        {
+            TestCanvas.rawChildren.addChild(dispObj);
+
+            if (dispObj is TextLine)
+            {
+                ItemsToRemove.push(dispObj as TextLine);
+            }
+        }
+
+        /** use the vellum factory via the callback */
+        private function buildVellumFactory():void //DisplayObject
+        {
+            var factory:TextFlowTextLineFactory = new TextFlowTextLineFactory();
+            factory.compositionBounds = new Rectangle(0, 0, TestCanvas.width, TestCanvas.height);
+            factory.createTextLines(callback, flowFromXML);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/UnitTest/Tests/FloatTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/FloatTest.as b/automation_tests/src/UnitTest/Tests/FloatTest.as
index da7a19a..2f105a6 100644
--- a/automation_tests/src/UnitTest/Tests/FloatTest.as
+++ b/automation_tests/src/UnitTest/Tests/FloatTest.as
@@ -104,90 +104,6 @@ package UnitTest.Tests
             _floatColor = 0xFF0000;
         }
 
-        /*
-         public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-         {
-         addTestCase(ts, testConfig, "atFlowStart");
-         addTestCase(ts, testConfig, "atFlowStartSpaceBefore");
-         addTestCase(ts, testConfig, "atParagraphStart");
-         addTestCase(ts, testConfig, "atParagraphStartSpaceBefore");
-         addTestCase(ts, testConfig, "atParagraphEnd");
-         addTestCase(ts, testConfig, "atLineStart");
-         addTestCase(ts, testConfig, "atLineMiddle");
-         addTestCase(ts, testConfig, "atLineEnd");
-         addTestCase(ts, testConfig, "stackedFloats");
-         addTestCase(ts, testConfig, "onTwoSidesSameLine");
-         addTestCase(ts, testConfig, "onTwoSidesSuccessiveLines");
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"fillsColumn", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"noEmergencyBreakByFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"fillsColumnRecursion", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"widerThanColumn", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"widerThanColumnScroll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"contentHeightCheck", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"noFloatsWithMeasureOrExplicit", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"floatOnly", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"noVJ", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignMiddleFloatAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignMiddleTextAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignBottomFloatAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignBottomTextAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignBottomFloat2636122", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"textAlignRightAtStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"textAlignRightInMiddle", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"leftIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"rightIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"leftBigIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"rightBigIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"clearOneAll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"clearTwoAll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"paddingAndMargins", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"negativePaddingAndMargins", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"rightIndentWithTab", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"leftIndentWithTab", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"hoistFailure", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"clearNoPrecedingFloatAll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"stackedLeftFloats", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"stackedRightFloats", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"smallFloatBigText", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"lineHeightIgnoredOnFloatingImages", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"convertFloatToInline", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"cursorByAnchor", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"insertTextBeforeFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"atControllerEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"resizeControllerWithFloats", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"textIndentAfterFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"composeAcrossControllers", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"deleteAtStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"measureWidth", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"inlineWideAndFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"narrowColumnFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"infiniteLoop2769562", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest, "verticalAlignInline", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest, "pasteManyFloatsWithLoading", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"contentBoundsWithFactoryComposition", testConfig, null) );
-         // We only need one version of these tests
-         if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-         {
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"inlineAndFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"htmlImportTest", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"overFlowAtStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"caretOnEmptyInlineGraphic", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"restartComposeFromStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"convertInlineToFloat", testConfig, null) );
-
-         }
-         }
-
-         private static function addTestCase(ts:TestSuiteExtended, testConfig:TestConfig, methodName:String):void
-         {
-         //ts.addTestDescriptor (new TestDescriptor (MeasurementGridTest,methodName, testConfig, creationType, measureType, lineBreak) );
-         var testXML:XML = <TestCase>
-         <TestData name="methodName">{methodName}</TestData>
-         <TestData name="id">{methodName}</TestData>
-         </TestCase>;
-
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"callTestMethod", testConfig, testXML) );
-         }    */
         [BeforeClass]
         public static function setUpClass():void
         {


[12/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-34592: Can't use optionnal importer for TLF plainTextFormat and TextLayoutFormat

Posted by pi...@apache.org.
FLEX-34592: Can't use optionnal importer for TLF plainTextFormat and TextLayoutFormat


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

Branch: refs/heads/tables
Commit: 553c899e5c55fc41a13d38c263238fc1d9c395e9
Parents: 620baf2
Author: Frederic THOMAS <we...@gmail.com>
Authored: Tue Oct 14 00:11:54 2014 +0200
Committer: Frederic THOMAS <we...@gmail.com>
Committed: Tue Oct 14 00:11:54 2014 +0200

----------------------------------------------------------------------
 textLayout/src/flashx/textLayout/edit/TextClipboard.as | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/553c899e/textLayout/src/flashx/textLayout/edit/TextClipboard.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/edit/TextClipboard.as b/textLayout/src/flashx/textLayout/edit/TextClipboard.as
index b92cdbb..a9f4f19 100644
--- a/textLayout/src/flashx/textLayout/edit/TextClipboard.as
+++ b/textLayout/src/flashx/textLayout/edit/TextClipboard.as
@@ -179,9 +179,9 @@ package flashx.textLayout.edit
 					textScrap = new TextScrap(textFlow);
 				
 				/** Hint to the scrap about whether text is plain or formatted. If not set, scrap will inspect text for attributes. */
-				if (format == TextConverter.PLAIN_TEXT_FORMAT)
+				if (format == TextConverter.PLAIN_TEXT_FORMAT && textScrap)
 					textScrap.setPlainText(true);
-				else if (format == TextConverter.TEXT_LAYOUT_FORMAT)
+				else if (format == TextConverter.TEXT_LAYOUT_FORMAT && textScrap)
 					textScrap.setPlainText(false);
 				
 				// Backwards compatibility: check for older scrap format


[22/44] git commit: [flex-tlf] [refs/heads/tables] - try even more PermGen

Posted by pi...@apache.org.
try even more PermGen


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

Branch: refs/heads/tables
Commit: b61dda36c327849cad44009f30d901bf7061987c
Parents: 8983e24
Author: Alex Harui <ah...@apache.org>
Authored: Sun Oct 19 23:00:27 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Oct 19 23:00:27 2014 -0700

----------------------------------------------------------------------
 build.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/b61dda36/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index c544d1f..9652e52 100644
--- a/build.properties
+++ b/build.properties
@@ -27,7 +27,7 @@ src.depend = true
 src.debug = on
 
 # JVM options for <compc> and <mxmlc> tasks
-jvm.args = ${local.d32} -Xms64m -Xmx512m -XX:MaxPermSize=128m -ea -Dapple.awt.UIElement=true
+jvm.args = ${local.d32} -Xms64m -Xmx512m -XX:MaxPermSize=512m -ea -Dapple.awt.UIElement=true
     # -d32/-d64 for 32-bit/64-bit code model (or don't specify for the default)
 	# -Xms64m: start out with a 64 MB heap
 	# -Xmx512m: allow the heap to grow to 512 MB


[42/44] git commit: [flex-tlf] [refs/heads/tables] - Add WritingModeTest, UndoRedoTest, TextFlowEditTest Remove unused variable from TestDescriptorRunner

Posted by pi...@apache.org.
Add WritingModeTest, UndoRedoTest, TextFlowEditTest
Remove unused variable from TestDescriptorRunner


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

Branch: refs/heads/tables
Commit: ac6b0473d73ddf11af373c523d868a42daa7e714
Parents: 5349b7a
Author: piotrz <pi...@gmail.com>
Authored: Wed Oct 29 08:19:47 2014 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Wed Oct 29 08:19:47 2014 +0100

----------------------------------------------------------------------
 .../src/UnitTest/TestDescriptorRunner.mxml      |   3 +-
 automation_tests/src/AllTestsSuite.as           |   6 +
 .../src/UnitTest/Tests/TextFlowEditTest.as      | 305 +++----
 .../src/UnitTest/Tests/UndoRedoTest.as          | 153 ++--
 .../src/UnitTest/Tests/WritingModeTest.as       | 795 ++++++++++---------
 5 files changed, 660 insertions(+), 602 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/ac6b0473/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
----------------------------------------------------------------------
diff --git a/automation_apps/src/UnitTest/TestDescriptorRunner.mxml b/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
index c9edada..d1eb0c4 100644
--- a/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
+++ b/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
@@ -26,9 +26,8 @@
 
         private var core:FlexUnitCore;
 
-        public function startTest(isMinimalTests:Boolean = false):void
+        public function startTest():void
         {
-
             core = new FlexUnitCore();
             core.addUncaughtErrorListener( systemManager.loaderInfo );
             core.addListener(new RunListener());

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/ac6b0473/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index e7f603d..641c924 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -39,6 +39,9 @@ package
     import UnitTest.Tests.GeneralFunctionsTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
+    import UnitTest.Tests.TextFlowEditTest;
+    import UnitTest.Tests.UndoRedoTest;
+    import UnitTest.Tests.WritingModeTest;
 
     [Suite]
     [RunWith("org.flexunit.runners.Suite")]
@@ -64,6 +67,9 @@ package
         public var eventOverrideTest:EventOverrideTest;
         public var flowModelTest:FlowModelTest;
         public var generalFunctionsTest:GeneralFunctionsTest;
+        public var writingModeTest:WritingModeTest;
+        public var undoRedoTest:UndoRedoTest;
+        public var textFlowEditTest:TextFlowEditTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/ac6b0473/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as b/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
index 53f508c..f56746d 100644
--- a/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
+++ b/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
@@ -18,155 +18,170 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
 
-	import flash.events.*;
+    import flashx.textLayout.edit.*;
+    import flashx.textLayout.elements.FlowElement;
+    import flashx.textLayout.elements.FlowGroupElement;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.ParagraphElement;
 
-	import flashx.textLayout.*;
-	import flashx.textLayout.edit.*;
-	import flashx.textLayout.elements.FlowElement;
-	import flashx.textLayout.elements.FlowGroupElement;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.ParagraphElement;
-
-	import mx.utils.LoaderUtil;
+    import mx.utils.LoaderUtil;
 
     import org.flexunit.asserts.assertTrue;
 
     public class TextFlowEditTest extends VellumTestCase
-	{
-		public function TextFlowEditTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super(methodName, testID, testConfig);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Editing";
-		}
-
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-			ts.addTestDescriptor (new TestDescriptor (TextFlowEditTest, "simulateClipboardTest", testConfig ) ); //HBS
-			ts.addTestDescriptor (new TestDescriptor (TextFlowEditTest, "addChildTest", testConfig ) );
-			ts.addTestDescriptor (new TestDescriptor (TextFlowEditTest, "removeChildTest", testConfig ) );
-   		}
-
-  		// Returns the string from begIdx through and including endIdx
-   		private function getText( begIdx:int, endIdx:int ): String
-   		{
-   			var outString:String = "";
-
-   			for ( var x:int = begIdx; x < endIdx; x++ )
-   			{
-   				outString += SelManager.textFlow.getCharAtPosition(x);
-   			}
-
-   			return outString;
-   		}
-
-  		// Tests FlowGroupElement's addChild and addChildAt on TextFlow
-  		public function addChildTest():void
-  		{
-  			var origLength:int = SelManager.textFlow.textLength;
-  			var firstPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
-
-  			// Test addChild
-  			SelManager.textFlow.removeChildAt(0);
-  			var flowLength:int = SelManager.textFlow.textLength;
-  			var tempPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
-  			SelManager.textFlow.addChild(tempPara);
-  			flowLength *= 2;
-  			assertTrue( "addChild failed on textFlow",
-  						flowLength == SelManager.textFlow.textLength );
-
-			// Try to add an already added element this should simply replace it
- 			SelManager.textFlow.addChild(tempPara);
-  			assertTrue( "readdChild failed on textFlow",
-  						flowLength == SelManager.textFlow.textLength && tempPara.parent == SelManager.textFlow && tempPara == SelManager.textFlow.getChildAt(SelManager.textFlow.numChildren-1));
-
-			// Test addChildAt
-  			SelManager.textFlow.addChildAt(1,firstPara);
-  			SelManager.textFlow.removeChildAt(2);
-  			assertTrue( "addChildAt failed on textFlow",
-  						origLength == SelManager.textFlow.textLength );
-  			assertTrue ( "addChildAt failed to place child at correct position",
-  						 getText(0,7) == "The man" );
-  		}
-
-  		// Tests FlowGroupElement's removeChild and removeChildAt on TextFlow
-  		public function removeChildTest():void
-  		{
-  			SelManager.textFlow.removeChildAt(0);
-  			assertTrue( "Removing first child paragraph failed",
-  						SelManager.textFlow.getChildAt(1) == null );
-
-  			SelManager.selectRange(25,25);
-  			SelManager.insertInlineGraphic(LoaderUtil.createAbsoluteURL(baseURL,"../../test/testFiles/assets/gremlin.jpg"), 20, 20 );
-
-  			var paraElem:FlowGroupElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-  			var imgElem:FlowElement = paraElem.getChildAt(paraElem.findChildIndexAtPosition(25));
-  			assertTrue("Expected InlineImageElement not found", imgElem is InlineGraphicElement );
-  			paraElem.removeChild(imgElem);
-
-  			assertTrue("FlowGroupElement method removeChild failed to remove InlineGraphic",
-  						!(paraElem.getChildAt(
-							paraElem.findChildIndexAtPosition(25))
-								is InlineGraphicElement) )
-
-  			// Try to remove an element that isn't here
-  			var gotError:Boolean = false;
-  			try
-  			{
-  				SelManager.textFlow.removeChild(imgElem);
-  			}
-  			catch ( e:ArgumentError )
-  			{
-  				gotError = true;
-  			}
-
-  			assertTrue( "Removing invalid child element failed to throw error",
-  						gotError );
-  		}
-
-		/**
-		 * Selects the characters between the 10th and 50th characters and does a cut.  It then
-		 * does an undo, redo, and another undo of the cut operation.
-		 * Verifies that there is the correct amount of characters on the clipboard after the cut operation.
-		 * Verifies that the correct amount of characters are left in the document after the cut operation.
-		 * Verifies that the correct amount of characters are left in the doucment after undoing the cut operation.
-		 * Verifies that the correct amount of characters are left in the document after redoing the cut operation.
-		 * Verifies that the correct amount of characters are left in the document after re-undoing the cut operation.
-		 */
-		public function simulateClipboardTest():void  //HBS
-		{
-			var startIndx:int = 10;
-			var endIndx:int = 50;
-
-			SelManager.selectRange(startIndx,endIndx);
-			var initLength:uint = SelManager.textFlow.textLength;
-			var peudoClipboard:TextScrap = SelManager.cutTextScrap();
-			var endLength:uint = SelManager.textFlow.textLength;
-			assertTrue("Text length is incorrect after a cut operation", endLength == initLength - (endIndx - startIndx) );
-
-			SelManager.undo();
-			var afterUndoLength:uint = SelManager.textFlow.textLength;
-			assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
-
-			//everything is ok so far if we get down here.  Now, redo the undo operation and
-			//make suer the flow goes back to the endLength
-
-			SelManager.redo();
-			var afterRedoLength:uint = SelManager.textFlow.textLength;
-			assertTrue("Text length is incorrect after redoing a cut operation", afterRedoLength == endLength);
-
-			//everything is ok so far if we get down here.  Now, do an undo again to get
-			//the doc back to it's original state so that we can go on with tests.
-
-			SelManager.undo();
-			afterUndoLength = SelManager.textFlow.textLength;
-			assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
-		}
-	}
+    {
+        public function TextFlowEditTest()
+        {
+            super("", "TextFlowEditTest", TestConfig.getInstance())
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Editing";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        /**
+         * Tests FlowGroupElement's addChild and addChildAt on TextFlow
+         */
+        public function addChildTest():void
+        {
+            var origLength:int = SelManager.textFlow.textLength;
+            var firstPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
+
+            // Test addChild
+            SelManager.textFlow.removeChildAt(0);
+            var flowLength:int = SelManager.textFlow.textLength;
+            var tempPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
+            SelManager.textFlow.addChild(tempPara);
+            flowLength *= 2;
+            assertTrue("addChild failed on textFlow",
+                    flowLength == SelManager.textFlow.textLength);
+
+            // Try to add an already added element this should simply replace it
+            SelManager.textFlow.addChild(tempPara);
+            assertTrue("readdChild failed on textFlow",
+                    flowLength == SelManager.textFlow.textLength && tempPara.parent == SelManager.textFlow && tempPara == SelManager.textFlow.getChildAt(SelManager.textFlow.numChildren - 1));
+
+            // Test addChildAt
+            SelManager.textFlow.addChildAt(1, firstPara);
+            SelManager.textFlow.removeChildAt(2);
+            assertTrue("addChildAt failed on textFlow",
+                    origLength == SelManager.textFlow.textLength);
+            assertTrue("addChildAt failed to place child at correct position",
+                    getText(0, 7) == "The man");
+        }
+
+        [Test]
+        /**
+         * Tests FlowGroupElement's removeChild and removeChildAt on TextFlow
+         */
+        public function removeChildTest():void
+        {
+            SelManager.textFlow.removeChildAt(0);
+            assertTrue("Removing first child paragraph failed",
+                    SelManager.textFlow.getChildAt(1) == null);
+
+            SelManager.selectRange(25, 25);
+            SelManager.insertInlineGraphic(LoaderUtil.createAbsoluteURL(baseURL, "../../test/testFiles/assets/gremlin.jpg"), 20, 20);
+
+            var paraElem:FlowGroupElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var imgElem:FlowElement = paraElem.getChildAt(paraElem.findChildIndexAtPosition(25));
+            assertTrue("Expected InlineImageElement not found", imgElem is InlineGraphicElement);
+            paraElem.removeChild(imgElem);
+
+            assertTrue("FlowGroupElement method removeChild failed to remove InlineGraphic",
+                    !(paraElem.getChildAt(
+                            paraElem.findChildIndexAtPosition(25))
+                            is InlineGraphicElement))
+
+            // Try to remove an element that isn't here
+            var gotError:Boolean = false;
+            try
+            {
+                SelManager.textFlow.removeChild(imgElem);
+            }
+            catch (e:ArgumentError)
+            {
+                gotError = true;
+            }
+
+            assertTrue("Removing invalid child element failed to throw error",
+                    gotError);
+        }
+
+        [Test]
+        /**
+         * Selects the characters between the 10th and 50th characters and does a cut.  It then
+         * does an undo, redo, and another undo of the cut operation.
+         * Verifies that there is the correct amount of characters on the clipboard after the cut operation.
+         * Verifies that the correct amount of characters are left in the document after the cut operation.
+         * Verifies that the correct amount of characters are left in the doucment after undoing the cut operation.
+         * Verifies that the correct amount of characters are left in the document after redoing the cut operation.
+         * Verifies that the correct amount of characters are left in the document after re-undoing the cut operation.
+         */
+        public function simulateClipboardTest():void  //HBS
+        {
+            var startIndx:int = 10;
+            var endIndx:int = 50;
+
+            SelManager.selectRange(startIndx, endIndx);
+            var initLength:uint = SelManager.textFlow.textLength;
+            var peudoClipboard:TextScrap = SelManager.cutTextScrap();
+            var endLength:uint = SelManager.textFlow.textLength;
+            assertTrue("Text length is incorrect after a cut operation", endLength == initLength - (endIndx - startIndx));
+
+            SelManager.undo();
+            var afterUndoLength:uint = SelManager.textFlow.textLength;
+            assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
+
+            //everything is ok so far if we get down here.  Now, redo the undo operation and
+            //make suer the flow goes back to the endLength
+
+            SelManager.redo();
+            var afterRedoLength:uint = SelManager.textFlow.textLength;
+            assertTrue("Text length is incorrect after redoing a cut operation", afterRedoLength == endLength);
+
+            //everything is ok so far if we get down here.  Now, do an undo again to get
+            //the doc back to it's original state so that we can go on with tests.
+
+            SelManager.undo();
+            afterUndoLength = SelManager.textFlow.textLength;
+            assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
+        }
+
+
+        /**
+         * Returns the string from begIdx through and including endIdx
+         *
+         * @param begIdx
+         * @param endIdx
+         * @return
+         */
+        private function getText(begIdx:int, endIdx:int):String
+        {
+            var outString:String = "";
+
+            for (var x:int = begIdx; x < endIdx; x++)
+            {
+                outString += SelManager.textFlow.getCharAtPosition(x);
+            }
+
+            return outString;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/ac6b0473/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/UndoRedoTest.as b/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
index b0bfcee..54ac062 100644
--- a/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
+++ b/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
@@ -18,88 +18,87 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestEditManager;
-	import UnitTest.Fixtures.TestConfig;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
+    import UnitTest.ExtendedClasses.TestSuiteExtended;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+    import UnitTest.Fixtures.TestEditManager;
 
-	import flash.display.Sprite;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.conversion.ConversionType;
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.edit.IEditManager;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.undo.IUndoManager;
-	import flashx.undo.UndoManager;
-	import flashx.textLayout.operations.ApplyLinkOperation;
-	
-	import flashx.textLayout.tlf_internal;
+    import flash.display.Sprite;
+
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.operations.ApplyLinkOperation;
+    import flashx.textLayout.tlf_internal;
+    import flashx.undo.IUndoManager;
+    import flashx.undo.UndoManager;
 
     import org.flexunit.asserts.assertTrue;
 
     use namespace tlf_internal;
-	/** Test the state of selection after each operation is done, undone, and redone.
-	 */
- 	public class UndoRedoTest extends VellumTestCase
-	{
-		public function UndoRedoTest(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 = UndoRedoTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-		
-		private var container:Sprite;
-		//private const ANY_URL:String = "http://livedocs.adobe.com/";
-		
-		protected function get initialImport():XML {
-			return <TextFlow color="#000000" fontFamily="Tahoma" fontSize="14" fontStyle="normal" fontWeight="normal" lineHeight="130%" textDecoration="none" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
-								  <p>
-									<span>aaa</span>
-								  </p>
-								  <p styleName="h1">
-									<span>bbb</span>
-								  </p>
-								</TextFlow>
-		} 
-		
-		protected function get initialImportString():String {
-			return null
-		}
-		
-		protected var initialImportXMLString:String = initialImport.normalize().toXMLString();
-		protected var editManager:TestEditManager;
-		protected var undoManager:IUndoManager;
-		protected var textFlow:TextFlow ;
-		
-		private function setup():void
-		{
-			container = new Sprite();
-			var controllerOne:ContainerController = new ContainerController(container, 500, 500);
-			textFlow = TextConverter.importToFlow(initialImport, TextConverter.TEXT_LAYOUT_FORMAT);
-			undoManager = new UndoManager();
-			editManager = new TestEditManager(undoManager);
-			textFlow.interactionManager = editManager;
-			textFlow.flowComposer.addController(controllerOne);
-			textFlow.flowComposer.updateAllControllers();
-		}
-    	
-		public function undoRedoLinkTest():void
-		{
-			setup();
-			//position > 3 will be in 2nd paragraph, cause error #2549628, no fix for now so the range is set to 3 to let the test case pass
-			var posOfSelection:int = TestData.posOfSelection;
-			editManager.selectRange(1,posOfSelection);
-			editManager.doOperation(new  ApplyLinkOperation(editManager.getSelectionState(), "http://www.yahoo.com", "_self", true));
-			var resultString:String = editManager.errors;
-			assertTrue("Undo and Redo not successfully. " + resultString, resultString == "");
-		}
+    /** Test the state of selection after each operation is done, undone, and redone.
+     */
+    public class UndoRedoTest extends VellumTestCase
+    {
+        private var container:Sprite;
+        protected var editManager:TestEditManager;
+        protected var undoManager:IUndoManager;
+        protected var textFlow:TextFlow;
+
+        public function UndoRedoTest()
+        {
+            super("", "UndoRedoTest", TestConfig.getInstance());
+        }
+
+        protected function get initialImport():XML
+        {
+            return <TextFlow color="#000000" fontFamily="Tahoma" fontSize="14" fontStyle="normal" fontWeight="normal" lineHeight="130%" textDecoration="none" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
+                <p>
+                    <span>aaa</span>
+                </p>
+                <p styleName="h1">
+                    <span>bbb</span>
+                </p>
+            </TextFlow>
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+
+            container = new Sprite();
+            var controllerOne:ContainerController = new ContainerController(container, 500, 500);
+            textFlow = TextConverter.importToFlow(initialImport, TextConverter.TEXT_LAYOUT_FORMAT);
+            undoManager = new UndoManager();
+            editManager = new TestEditManager(undoManager);
+            textFlow.interactionManager = editManager;
+            textFlow.flowComposer.addController(controllerOne);
+            textFlow.flowComposer.updateAllControllers();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+
+            container = null;
+            undoManager = null;
+            editManager = null;
+            textFlow = null;
+        }
+
+        [Test]
+        public function undoRedoLinkTest():void
+        {
+            //position > 3 will be in 2nd paragraph, cause error #2549628, no fix for now so the range is set to 3 to let the test case pass
+            var posOfSelection:int = TestData.posOfSelection;
+            editManager.selectRange(1, posOfSelection);
+            editManager.doOperation(new ApplyLinkOperation(editManager.getSelectionState(), "http://flex.apache.org", "_self", true));
+            var resultString:String = editManager.errors;
+            assertTrue("Undo and Redo not successfully. " + resultString, resultString == "");
+        }
 
-		
-	}
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/ac6b0473/automation_tests/src/UnitTest/Tests/WritingModeTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/WritingModeTest.as b/automation_tests/src/UnitTest/Tests/WritingModeTest.as
index 7b35e35..43891c5 100644
--- a/automation_tests/src/UnitTest/Tests/WritingModeTest.as
+++ b/automation_tests/src/UnitTest/Tests/WritingModeTest.as
@@ -18,388 +18,427 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
 
-	import flash.display.DisplayObject;
-	import flash.text.engine.TextLine;
+    import flash.display.DisplayObject;
+    import flash.text.engine.TextLine;
 
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Direction;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Direction;
 
     import org.flexunit.asserts.assertTrue;
 
     public class WritingModeTest extends VellumTestCase
-	{
-		public function WritingModeTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
-		{
-			super(methodName, testID, testConfig, testCaseXML);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Text Container";
-			metaData.productSubArea = "Text Direction";
-		}
-
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = WritingModeTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-   		// test each writingMode with two columns setting them on the TextFlow
-   		// have to clear any container overrides - not sure how they got there.
-
-   		public function japaneseAttrib():void
-   		{
-   			SelManager.selectRange(0,0);
-   			SelManager.flushPendingOperations();
-
-   			SelManager.textFlow.blockProgression = BlockProgression.RL;
-   			SelManager.textFlow.columnCount = 2;
-   			SelManager.textFlow.direction = Direction.LTR;
-
-   			assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
-   			assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
-   		}
-
-   		public function arabicAttrib():void
-   		{
-   			SelManager.selectRange(0,0);
-   			SelManager.flushPendingOperations();
-
-   			SelManager.textFlow.blockProgression = BlockProgression.TB;
-   			SelManager.textFlow.columnCount = 2;
-   			SelManager.textFlow.direction = Direction.RTL;
-
-   			assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB );
-   			assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB );
-   		}
-
-   		public function romanAttrib():void
-   		{
-   			SelManager.selectRange(0,0);
-   			SelManager.flushPendingOperations();
-
-   			SelManager.textFlow.blockProgression = BlockProgression.TB;
-   			SelManager.textFlow.columnCount = 2;
-   			SelManager.textFlow.direction = Direction.LTR;
-
-			assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB );
-			assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB );
-   		}
-
-   		// No writing system uses this, but it's still a possible combination
-   		public function rtlAttrib():void
-   		{
-   			SelManager.selectRange(0,0);
-   			SelManager.flushPendingOperations();
-
-   			SelManager.textFlow.blockProgression = BlockProgression.RL;
-   			SelManager.textFlow.columnCount = 2;
-   			SelManager.textFlow.direction = Direction.RTL;
-
-   			assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
-   			assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
-   		}
-
-   		// Test BlockProgression.RL + Direction.LTR
-   		public function japanesePositioning():void
-   		{
-   			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.RL;
-   			SelManager.textFlow.direction = Direction.LTR;
-		 	SelManager.textFlow.paddingBottom = 0;
-		 	SelManager.textFlow.paddingLeft = 0;
-		 	SelManager.textFlow.paddingRight = 0;
-		 	SelManager.textFlow.paddingTop = 0;
-		 	SelManager.textFlow.columnCount = 2;
-		 	SelManager.textFlow.columnGap = 0;
-
-		 	// Create a new paragraph in the second column
-		 	SelManager.selectRange(1842,1842);
-		 	SelManager.splitParagraph();
-
-		 	SelManager.flushPendingOperations();
-
-		 	// Get the posititioning of the first and second columns
-		 	var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
-		 	var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
-		 	var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
-		 	var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
-
-		 	assertTrue(
-		 		"BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
-		 		x1 == x2
-		 	);
-		 	assertTrue(
-		 		"BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
-		 		y1 < y2
-		 	);
-   		}
-
-   		// Test BlockProgression.TB + Direction.LTR
-   		public function romanPositioning():void
-   		{
-   			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.TB;
-   			SelManager.textFlow.direction = Direction.LTR;
-		 	SelManager.textFlow.paddingBottom = 0;
-		 	SelManager.textFlow.paddingLeft = 0;
-		 	SelManager.textFlow.paddingRight = 0;
-		 	SelManager.textFlow.paddingTop = 0;
-		 	SelManager.textFlow.columnCount = 2;
-		 	SelManager.textFlow.columnGap = 0;
-
-		 	// Create a new paragraph in the second column
-		 	SelManager.selectRange(1862,1862);
-		 	SelManager.splitParagraph();
-
-		 	SelManager.flushPendingOperations();
-
-		 	// Get the posititioning of the first and second columns
-		 	var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
-		 	var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
-		 	var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
-		 	var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
-
-		 	assertTrue(
-		 		"BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
-		 		x1 < x2
-		 	);
-		 	assertTrue(
-		 		"BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
-		 		y1 == y2
-		 	);
-   		}
-
-   		// Test BlockProgression.RL + Direction.RTL
-   		public function rtlPositioning():void
-   		{
-   			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.RL;
-   			SelManager.textFlow.direction = Direction.RTL;
-		 	SelManager.textFlow.paddingBottom = 0;
-		 	SelManager.textFlow.paddingLeft = 0;
-		 	SelManager.textFlow.paddingRight = 0;
-		 	SelManager.textFlow.paddingTop = 0;
-		 	SelManager.textFlow.columnCount = 2;
-		 	SelManager.textFlow.columnGap = 0;
-
-		 	// Create a new paragraph in the second column
-		 	SelManager.selectRange(1842,1842);
-		 	SelManager.splitParagraph();
-
-		 	SelManager.flushPendingOperations();
-
-		 	// Get the posititioning of the first and second columns
-		 	var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
-		 	var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
-		 	var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
-		 	var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
-
-		 	assertTrue(
-		 		"BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
-		 		x1 == x2
-		 	);
-		 	assertTrue(
-		 		"BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
-		 		y1 < y2
-		 	);
-   		}
-
-   		// Test BlockProgression.TB + Direction.RTL
-  		public function arabicPositioning():void
-   		{
-   			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.TB;
-   			SelManager.textFlow.direction = Direction.RTL;
-		 	SelManager.textFlow.paddingBottom = 0;
-		 	SelManager.textFlow.paddingLeft = 0;
-		 	SelManager.textFlow.paddingRight = 0;
-		 	SelManager.textFlow.paddingTop = 0;
-		 	SelManager.textFlow.columnCount = 2;
-		 	SelManager.textFlow.columnGap = 0;
-
-		 	// Create a new paragraph in the second column
-		 	SelManager.selectRange(1862,1862);
-		 	SelManager.splitParagraph();
-
-		 	SelManager.flushPendingOperations();
-
-		 	// Get the posititioning of the first and second columns
-		 	var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
-		 	var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
-		 	var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
-		 	var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
-
-		 	assertTrue(
-		 		"BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
-		 		x1 > x2
-		 	);
-		 	assertTrue(
-		 		"BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
-		 		y1 == y2
-		 	);
-   		}
-
-   		// Test BlockProgression.RL + Direction.LTR
-   		public function japaneseJustification():void
-   		{
-			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.RL;
-   			SelManager.textFlow.direction = Direction.LTR;
-
-		 	// Create new paragraphs to with severe justification differences
-		 	SelManager.insertText("M");
-		 	SelManager.insertText("MMMMMM");
-		 	SelManager.insertText("MMMMMMMMMMMM");
-		 	SelManager.selectRange(1,1);
-		 	SelManager.splitParagraph();
-		 	SelManager.selectRange(8,8);
-		 	SelManager.splitParagraph();
-
-			var xPos:Array = new Array();
-			var yPos:Array = new Array();
-
-			for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
-			{
-				var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
-
-				xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
-				yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
-			}
-
-			// Check that we're on different lines
-			assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: L to R",
-						xPos[0] > xPos[1] && xPos[1] > xPos[2] );
-			// Justification is correct
-			assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: L to R",
-						yPos[0] == yPos[1] && yPos[1] == yPos[2] );
-   		}
-
-   		// Test BlockProgression.TB + Direction.LTR
-   		public function romanJustification():void
-   		{
-			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.TB;
-   			SelManager.textFlow.direction = Direction.LTR;
-
-		 	// Create new paragraphs to with severe justification differences
-		 	SelManager.insertText("M");
-		 	SelManager.insertText("MMMMMM");
-		 	SelManager.insertText("MMMMMMMMMMMM");
-		 	SelManager.selectRange(1,1);
-		 	SelManager.splitParagraph();
-		 	SelManager.selectRange(8,8);
-		 	SelManager.splitParagraph();
-
-			var xPos:Array = new Array();
-			var yPos:Array = new Array();
-
-			for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
-			{
-				var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
-
-				xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
-				yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
-			}
-
-			// Check that we're on different lines
-			assertTrue( "Justification incorrect with BlockProgression: T to B, Direction: L to R",
-						yPos[0] != yPos[1] && yPos[1] != yPos[2] );
-			// Justification is correct
-			assertTrue( "Justification incorrect with BlockProgression: T to B, Direction: L to R",
-						xPos[0] == xPos[1] && xPos[1] == xPos[2] );
-   		}
-
-   		// Test BlockProgression.RL + Direction.RTL
-   		public function rtlJustification():void
-   		{
-			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.RL;
-   			SelManager.textFlow.direction = Direction.RTL;
-
-		 	// Create new paragraphs to with severe justification differences
-		 	SelManager.insertText("M");
-		 	SelManager.insertText("MMMMMM");
-		 	SelManager.insertText("MMMMMMMMMMMM");
-		 	SelManager.selectRange(1,1);
-		 	SelManager.splitParagraph();
-		 	SelManager.selectRange(8,8);
-		 	SelManager.splitParagraph();
-
-			var xPos:Array = new Array();
-			var yPos:Array = new Array();
-
-			for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
-			{
-				var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
-
-				xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
-				yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
-			}
-
-			// Check that we're on different lines
-			assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: R to L",
-						xPos[0] != xPos[1] && xPos[1] != xPos[2] );
-			// Justification is correct
-			assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: R to L",
-						yPos[0] > yPos[1] && yPos[1] > yPos[2] );
-   		}
-
-   		// Test BlockProgression.TB + Direction.RTL
-  		public function arabicJustification():void
-   		{
-			// Force the intended text positioning
-   			SelManager.textFlow.blockProgression = BlockProgression.TB;
-   			SelManager.textFlow.direction = Direction.RTL;
-
-		 	// Create new paragraphs to with severe justification differences
-		 	SelManager.insertText("M");
-		 	SelManager.insertText("MMMMMM");
-		 	SelManager.insertText("MMMMMMMMMMMM");
-		 	SelManager.selectRange(1,1);
-		 	SelManager.splitParagraph();
-		 	SelManager.selectRange(8,8);
-		 	SelManager.splitParagraph();
-
-			var xPos:Array = new Array();
-			var yPos:Array = new Array();
-
-			for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
-			{
-				var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
-
-				xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
-				yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
-			}
-
-			// Check that we're on different lines
-			assertTrue( "Justification incorrect with BlockProgression: T to B & Direction: R to L",
-						yPos[0] != yPos[1] && yPos[1] != yPos[2] );
-			// Justification is correct
-			assertTrue( "Justification incorrect with BlockProgression: T to B & Direction: R to L",
-						xPos[0] > xPos[1] && xPos[1] > xPos[2] );
-   		}
-
-   		// Make sure the right to left fonts are displayed right to left
-   		public function arabicDirection():void
-   		{
-			for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
-			{
-				var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
-
-				for ( var i:int = 1; i < testLine.atomCount; i++)
-				{
-					assertTrue( "Display direction incorrect on right to left fonts",
-								testLine.getAtomBounds(i).x > testLine.getAtomBounds(i-1).x );
-
-					assertTrue( "Display direction incorrect on right to left fonts",
-								testLine.getAtomBounds(i).y == testLine.getAtomBounds(i-1).y );
-				}
-			}
-   		}
-	}
+    {
+        public function WritingModeTest()
+        {
+            super("", "WritingModeTest", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Text Container";
+            metaData.productSubArea = "Text Direction";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        /**
+         * test each writingMode with two columns setting them on the TextFlow
+         * have to clear any container overrides - not sure how they got there
+         */
+        public function japaneseAttrib():void
+        {
+            SelManager.selectRange(0, 0);
+            SelManager.flushPendingOperations();
+
+            SelManager.textFlow.blockProgression = BlockProgression.RL;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.direction = Direction.LTR;
+
+            assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
+            assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
+        }
+
+        [Test]
+        public function arabicAttrib():void
+        {
+            SelManager.selectRange(0, 0);
+            SelManager.flushPendingOperations();
+
+            SelManager.textFlow.blockProgression = BlockProgression.TB;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.direction = Direction.RTL;
+
+            assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB);
+            assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB);
+        }
+
+        [Test]
+        public function romanAttrib():void
+        {
+            SelManager.selectRange(0, 0);
+            SelManager.flushPendingOperations();
+
+            SelManager.textFlow.blockProgression = BlockProgression.TB;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.direction = Direction.LTR;
+
+            assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB);
+            assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB);
+        }
+
+        [Test]
+        /**
+         * No writing system uses this, but it's still a possible combination
+         */
+        public function rtlAttrib():void
+        {
+            SelManager.selectRange(0, 0);
+            SelManager.flushPendingOperations();
+
+            SelManager.textFlow.blockProgression = BlockProgression.RL;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.direction = Direction.RTL;
+
+            assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
+            assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
+        }
+
+        [Test]
+        /**
+         * Test BlockProgression.RL + Direction.LTR
+         */
+        public function japanesePositioning():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.RL;
+            SelManager.textFlow.direction = Direction.LTR;
+            SelManager.textFlow.paddingBottom = 0;
+            SelManager.textFlow.paddingLeft = 0;
+            SelManager.textFlow.paddingRight = 0;
+            SelManager.textFlow.paddingTop = 0;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.columnGap = 0;
+
+            // Create a new paragraph in the second column
+            SelManager.selectRange(1842, 1842);
+            SelManager.splitParagraph();
+
+            SelManager.flushPendingOperations();
+
+            // Get the posititioning of the first and second columns
+            var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+            var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+            var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
+            var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
+
+            assertTrue(
+                    "BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
+                    x1 == x2
+            );
+            assertTrue(
+                    "BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
+                    y1 < y2
+            );
+        }
+
+        [Test]
+        /**
+         * Test BlockProgression.TB + Direction.LTR
+         */
+        public function romanPositioning():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.TB;
+            SelManager.textFlow.direction = Direction.LTR;
+            SelManager.textFlow.paddingBottom = 0;
+            SelManager.textFlow.paddingLeft = 0;
+            SelManager.textFlow.paddingRight = 0;
+            SelManager.textFlow.paddingTop = 0;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.columnGap = 0;
+
+            // Create a new paragraph in the second column
+            SelManager.selectRange(1862, 1862);
+            SelManager.splitParagraph();
+
+            SelManager.flushPendingOperations();
+
+            // Get the posititioning of the first and second columns
+            var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+            var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+            var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
+            var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
+
+            assertTrue(
+                    "BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
+                    x1 < x2
+            );
+            assertTrue(
+                    "BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
+                    y1 == y2
+            );
+        }
+
+        [Test]
+        /**
+         * Test BlockProgression.RL + Direction.RTL
+         */
+        public function rtlPositioning():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.RL;
+            SelManager.textFlow.direction = Direction.RTL;
+            SelManager.textFlow.paddingBottom = 0;
+            SelManager.textFlow.paddingLeft = 0;
+            SelManager.textFlow.paddingRight = 0;
+            SelManager.textFlow.paddingTop = 0;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.columnGap = 0;
+
+            // Create a new paragraph in the second column
+            SelManager.selectRange(1842, 1842);
+            SelManager.splitParagraph();
+
+            SelManager.flushPendingOperations();
+
+            // Get the posititioning of the first and second columns
+            var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+            var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+            var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
+            var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
+
+            assertTrue(
+                    "BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
+                    x1 == x2
+            );
+            assertTrue(
+                    "BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
+                    y1 < y2
+            );
+        }
+
+        [Test]
+        /**
+         *
+         */
+        public function arabicPositioning():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.TB;
+            SelManager.textFlow.direction = Direction.RTL;
+            SelManager.textFlow.paddingBottom = 0;
+            SelManager.textFlow.paddingLeft = 0;
+            SelManager.textFlow.paddingRight = 0;
+            SelManager.textFlow.paddingTop = 0;
+            SelManager.textFlow.columnCount = 2;
+            SelManager.textFlow.columnGap = 0;
+
+            // Create a new paragraph in the second column
+            SelManager.selectRange(1862, 1862);
+            SelManager.splitParagraph();
+
+            SelManager.flushPendingOperations();
+
+            // Get the posititioning of the first and second columns
+            var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+            var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+            var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
+            var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
+
+            assertTrue(
+                    "BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
+                    x1 > x2
+            );
+            assertTrue(
+                    "BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
+                    y1 == y2
+            );
+        }
+
+        [Test]
+        /**
+         *  Test BlockProgression.RL + Direction.LTR
+         */
+        public function japaneseJustification():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.RL;
+            SelManager.textFlow.direction = Direction.LTR;
+
+            // Create new paragraphs to with severe justification differences
+            SelManager.insertText("M");
+            SelManager.insertText("MMMMMM");
+            SelManager.insertText("MMMMMMMMMMMM");
+            SelManager.selectRange(1, 1);
+            SelManager.splitParagraph();
+            SelManager.selectRange(8, 8);
+            SelManager.splitParagraph();
+
+            var xPos:Array = new Array();
+            var yPos:Array = new Array();
+
+            for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+            {
+                var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+
+                xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+                yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+            }
+
+            // Check that we're on different lines
+            assertTrue("Justification incorrect with BlockProgression: R to L, Direction: L to R",
+                    xPos[0] > xPos[1] && xPos[1] > xPos[2]);
+            // Justification is correct
+            assertTrue("Justification incorrect with BlockProgression: R to L, Direction: L to R",
+                    yPos[0] == yPos[1] && yPos[1] == yPos[2]);
+        }
+
+        [Test]
+        /**
+         * Test BlockProgression.TB + Direction.LTR
+         */
+        public function romanJustification():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.TB;
+            SelManager.textFlow.direction = Direction.LTR;
+
+            // Create new paragraphs to with severe justification differences
+            SelManager.insertText("M");
+            SelManager.insertText("MMMMMM");
+            SelManager.insertText("MMMMMMMMMMMM");
+            SelManager.selectRange(1, 1);
+            SelManager.splitParagraph();
+            SelManager.selectRange(8, 8);
+            SelManager.splitParagraph();
+
+            var xPos:Array = new Array();
+            var yPos:Array = new Array();
+
+            for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+            {
+                var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+
+                xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+                yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+            }
+
+            // Check that we're on different lines
+            assertTrue("Justification incorrect with BlockProgression: T to B, Direction: L to R",
+                    yPos[0] != yPos[1] && yPos[1] != yPos[2]);
+            // Justification is correct
+            assertTrue("Justification incorrect with BlockProgression: T to B, Direction: L to R",
+                    xPos[0] == xPos[1] && xPos[1] == xPos[2]);
+        }
+
+        [Test]
+        /**
+         * Test BlockProgression.RL + Direction.RTL
+         */
+        public function rtlJustification():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.RL;
+            SelManager.textFlow.direction = Direction.RTL;
+
+            // Create new paragraphs to with severe justification differences
+            SelManager.insertText("M");
+            SelManager.insertText("MMMMMM");
+            SelManager.insertText("MMMMMMMMMMMM");
+            SelManager.selectRange(1, 1);
+            SelManager.splitParagraph();
+            SelManager.selectRange(8, 8);
+            SelManager.splitParagraph();
+
+            var xPos:Array = new Array();
+            var yPos:Array = new Array();
+
+            for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+            {
+                var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+
+                xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+                yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+            }
+
+            // Check that we're on different lines
+            assertTrue("Justification incorrect with BlockProgression: R to L, Direction: R to L",
+                    xPos[0] != xPos[1] && xPos[1] != xPos[2]);
+            // Justification is correct
+            assertTrue("Justification incorrect with BlockProgression: R to L, Direction: R to L",
+                    yPos[0] > yPos[1] && yPos[1] > yPos[2]);
+        }
+
+        [Test]
+        /**
+         * Test BlockProgression.TB + Direction.RTL
+         */
+        public function arabicJustification():void
+        {
+            // Force the intended text positioning
+            SelManager.textFlow.blockProgression = BlockProgression.TB;
+            SelManager.textFlow.direction = Direction.RTL;
+
+            // Create new paragraphs to with severe justification differences
+            SelManager.insertText("M");
+            SelManager.insertText("MMMMMM");
+            SelManager.insertText("MMMMMMMMMMMM");
+            SelManager.selectRange(1, 1);
+            SelManager.splitParagraph();
+            SelManager.selectRange(8, 8);
+            SelManager.splitParagraph();
+
+            var xPos:Array = new Array();
+            var yPos:Array = new Array();
+
+            for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+            {
+                var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+
+                xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+                yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+            }
+
+            // Check that we're on different lines
+            assertTrue("Justification incorrect with BlockProgression: T to B & Direction: R to L",
+                    yPos[0] != yPos[1] && yPos[1] != yPos[2]);
+            // Justification is correct
+            assertTrue("Justification incorrect with BlockProgression: T to B & Direction: R to L",
+                    xPos[0] > xPos[1] && xPos[1] > xPos[2]);
+        }
+
+        [Test]
+        /**
+         * Make sure the right to left fonts are displayed right to left
+         */
+        public function arabicDirection():void
+        {
+            for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+            {
+                var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+
+                for (var i:int = 1; i < testLine.atomCount; i++)
+                {
+                    assertTrue("Display direction incorrect on right to left fonts",
+                            testLine.getAtomBounds(i).x > testLine.getAtomBounds(i - 1).x);
+
+                    assertTrue("Display direction incorrect on right to left fonts",
+                            testLine.getAtomBounds(i).y == testLine.getAtomBounds(i - 1).y);
+                }
+            }
+        }
+    }
 }


[04/44] git commit: [flex-tlf] [refs/heads/tables] - Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Posted by pi...@apache.org.
Add new tests to AllTestsSuite:
BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes
CrossContainerTest.as, ElementOperationTest.as - all works fine


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

Branch: refs/heads/tables
Commit: c105912118f6e3e064db62141f3760226fdabe49
Parents: 6cc1110
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 11:05:22 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 11:05:22 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |    9 +-
 .../UnitTest/Tests/BoundsAndAlignmentTest.as    |  278 +---
 automation_tests/src/UnitTest/Tests/BoxTest.as  |   51 +-
 .../src/UnitTest/Tests/ContainerTypeTest.as     |    8 -
 .../src/UnitTest/Tests/CrossContainerTest.as    |  430 +++---
 .../src/UnitTest/Tests/ElementOperationTest.as  | 1192 +++++++++++++++++
 .../src/UnitTest/Tests/ElementOperationTests.as | 1228 ------------------
 .../src/UnitTest/Tests/EventOverrideTest.as     |  905 +++++--------
 8 files changed, 1744 insertions(+), 2357 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index b24715b..a13ac01 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -25,10 +25,14 @@ package
     import UnitTest.Tests.AllEventTest;
     import UnitTest.Tests.AllParaAttributeTest;
     import UnitTest.Tests.AttributeTest;
+    import UnitTest.Tests.BoundsAndAlignmentTest;
     import UnitTest.Tests.BoxTest;
     import UnitTest.Tests.CompositionTest;
     import UnitTest.Tests.ContainerAttributeTest;
     import UnitTest.Tests.ContainerTypeTest;
+    import UnitTest.Tests.CrossContainerTest;
+    import UnitTest.Tests.ElementOperationTest;
+    import UnitTest.Tests.EventOverrideTest;
     import UnitTest.Tests.FloatTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
@@ -50,7 +54,10 @@ package
         public var operationTest:OperationTest;
         public var scrollingTest:ScrollingTest;
         public var containerAttributeTest:ContainerAttributeTest;
-
+        public var boundsAndAlignmentTest:BoundsAndAlignmentTest;
+        public var crossContainerTest:CrossContainerTest;
+        public var elementOperationTest:ElementOperationTest;
+        public var eventOverrideTest:EventOverrideTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as b/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
index 6daafda..026ba5f 100644
--- a/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
+++ b/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
@@ -30,7 +30,6 @@ package UnitTest.Tests
     import flash.events.EventDispatcher;
     import flash.events.IEventDispatcher;
     import flash.geom.Rectangle;
-    import flash.text.engine.TextLine;
 
     import flashx.textLayout.compose.StandardFlowComposer;
     import flashx.textLayout.container.ContainerController;
@@ -38,8 +37,6 @@ package UnitTest.Tests
     import flashx.textLayout.conversion.TextConverter;
     import flashx.textLayout.edit.EditManager;
     import flashx.textLayout.edit.IEditManager;
-    import flashx.textLayout.elements.FlowLeafElement;
-    import flashx.textLayout.elements.InlineGraphicElement;
     import flashx.textLayout.elements.InlineGraphicElementStatus;
     import flashx.textLayout.elements.TextFlow;
     import flashx.textLayout.events.StatusChangeEvent;
@@ -47,9 +44,7 @@ package UnitTest.Tests
     import flashx.textLayout.factory.TextFlowTextLineFactory;
     import flashx.textLayout.formats.BlockProgression;
     import flashx.textLayout.formats.Direction;
-    import flashx.textLayout.formats.TextAlign;
     import flashx.textLayout.formats.TextLayoutFormat;
-    import flashx.textLayout.formats.VerticalAlign;
 
     import mx.containers.Canvas;
 
@@ -61,7 +56,6 @@ package UnitTest.Tests
     {
         // Creation Types
         private static const USE_FLOW:String = "textFlow";
-        private static const USE_FACTORY_STRING:String = "factoryStr";
         private static const USE_FACTORY_FLOW:String = "factoryTF";
 
         private static var textAlignArray:Array = ["left", "center", "right", "start", "end" ];
@@ -110,11 +104,6 @@ package UnitTest.Tests
             ]
         ];
 
-        private const logicalWidth:Number = 400;
-        private const logicalHeight:Number = 400;
-
-        private var w:Number = 210;
-        private var h:Number = 40;
         private var width:Number;
         private var height:Number;
 
@@ -127,7 +116,6 @@ package UnitTest.Tests
         // bounds and format of last sprite for comparison function
         private var compareBounds:Rectangle;
 
-        private var fFactBounds:Rectangle;
         private var tFlowBounds:Rectangle;
 
         private var notReadyGraphicsCount:int;
@@ -171,14 +159,6 @@ package UnitTest.Tests
             var labelFormat:TextLayoutFormat = new TextLayoutFormat();
             labelFormat.fontSize = 12;
             labelFactory.spanFormat = labelFormat;
-
-          /*  testData = <TestCase>
-                <TestData name="measureType">{measureType}</TestData>
-                <TestData name="lineBreak">{lineBreak}</TestData>
-                <TestData name="id">{methodName}-{measureType}-{lineBreak}</TestData>
-                <TestData name="verticalAlign">{verticalAlign}</TestData>
-                <TestData name="textAlign">{textAlign}</TestData>
-            </TestCase>; */
         }
 
         [AfterClass]
@@ -211,8 +191,9 @@ package UnitTest.Tests
 
         /********************** Tests Start Here ***************************/
 
-        [Test(dataProvider="data")]
-        public function simpleMultiParagraph(measureType:Object):void
+        [Test]
+        [Ignore]
+        public function simpleMultiParagraph():void
         {
             // This is a subset of simple.xml
             // Exposed Watson bug 2559210
@@ -224,6 +205,21 @@ package UnitTest.Tests
             runSingleTest(markup, insertText);
         }
 
+        [Test]
+        [Ignore]
+        public function simpleMultiParagraphNoTextIndent():void
+        {
+            // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
+            var markup:String = '<flow:TextFlow xmlns:flow="http://ns.adobe.com/textLayout/2008" fontSize="14" paddingTop="4" paddingLeft="4" fontFamily="Times New Roman">' +
+                    '<flow:p paragraphSpaceAfter="15"><flow:span>There are many </flow:span><flow:span fontStyle="italic">such</flow:span><flow:span> lime-kilns in that tract of country, for the purpose of burning the white marble which composes a large part of the substance of the hills. Some of them, built years ago, and long deserted, with weeds growing in the vacant round of the interior, which is open to the sky, and grass and wild-flowers rooting themselves into the chinks of the stones, look already like relics of antiquity, and may yet be overspread with the lichens of centuries to come. Sentences removed.</flow:span></flow:p>' +
+                    '<flow:p paragraphSpaceAfter="15"><flow:span>The man who now watched the fire was of a different order, and troubled himself with no thoughts save the very few that were requisite to his business. At frequent intervals, he flung back the clashing weight of the iron door, and, turning his face from the insufferable glare, thrust in huge logs of oak, or stirred the immense brands with a long pole. Sentences removed.</flow:span></flow:p>' +
+                    '</flow:TextFlow>';
+
+            runSingleTest(markup);
+        }
+
+        [Test]
+        [Ignore]
         public function longSimpleMultiParagraph():void
         {
             // This is a longer version of simple.xml, so the text overflows the visible area and scrolls
@@ -241,17 +237,8 @@ package UnitTest.Tests
             runSingleTest(markup, insertText);
         }
 
-        public function simpleMultiParagraphNoTextIndent():void
-        {
-            // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
-            var markup:String = '<flow:TextFlow xmlns:flow="http://ns.adobe.com/textLayout/2008" fontSize="14" paddingTop="4" paddingLeft="4" fontFamily="Times New Roman">' +
-                    '<flow:p paragraphSpaceAfter="15"><flow:span>There are many </flow:span><flow:span fontStyle="italic">such</flow:span><flow:span> lime-kilns in that tract of country, for the purpose of burning the white marble which composes a large part of the substance of the hills. Some of them, built years ago, and long deserted, with weeds growing in the vacant round of the interior, which is open to the sky, and grass and wild-flowers rooting themselves into the chinks of the stones, look already like relics of antiquity, and may yet be overspread with the lichens of centuries to come. Sentences removed.</flow:span></flow:p>' +
-                    '<flow:p paragraphSpaceAfter="15"><flow:span>The man who now watched the fire was of a different order, and troubled himself with no thoughts save the very few that were requisite to his business. At frequent intervals, he flung back the clashing weight of the iron door, and, turning his face from the insufferable glare, thrust in huge logs of oak, or stirred the immense brands with a long pole. Sentences removed.</flow:span></flow:p>' +
-                    '</flow:TextFlow>';
-
-            runSingleTest(markup);
-        }
-
+        [Test]
+        [Ignore]
         public function simpleMultiParagraphNegTextIndent():void
         {
             // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
@@ -263,6 +250,8 @@ package UnitTest.Tests
             runSingleTest(markup);
         }
 
+        [Test]
+        [Ignore]
         public function simpleWithPaddingTopLeft():void
         {
             // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
@@ -274,6 +263,8 @@ package UnitTest.Tests
             runSingleTest(markup);
         }
 
+        [Test]
+        [Ignore]
         public function simpleWithPaddingBottomRight():void
         {
             // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
@@ -312,39 +303,6 @@ package UnitTest.Tests
 
         // end of IEventDispatcher functions
 
-        private function setUpMeasureType(measureObj:Object):void
-        {
-            width = logicalWidth;
-            height = logicalHeight;
-
-            switch (measureObj.measureType)
-            {
-                case MeasureConstants.MEASURE_BOTH:
-                    width = NaN;
-                    height = NaN;
-                    break;
-
-                case MeasureConstants.MEASURE_WIDTH:
-                    width = NaN;
-                    break;
-
-                case MeasureConstants.MEASURE_HEIGHT:
-                    height = NaN;
-                    break;
-            }
-
-            if (_blockProgression == BlockProgression.RL)		// swap coordinates if we're vertical
-            {
-                var tmp:Number = width;
-                width = height;
-                height = tmp;
-
-                tmp = w;
-                w = h;
-                h = tmp;
-            }
-        }
-
         private function insertText(textFlow:TextFlow):void
         {
             textFlow.interactionManager = editManager;
@@ -365,59 +323,6 @@ package UnitTest.Tests
             }
         }
 
-        private function clearCanvas():void
-        {
-            TestDisplayObject = testApp.getDisplayObject();
-            if (TestDisplayObject)
-            {
-                testCanvas = Canvas(TestDisplayObject);
-                while (testCanvas.rawChildren.numChildren > 0)
-                    testCanvas.rawChildren.removeChildAt(0);
-            }
-        }
-
-        // These tests run flow &  textFlowfactory creation types (they don't work on string factory)
-        private static var testsToRunOnFlowAndTFFactory:Array = [
-            "simpleMultiParagraph",
-            "simpleMultiParagraphNoTextIndent",
-            "simpleWithPaddingTopLeft",
-            "simpleWithPaddingBottomRight",
-            "simpleMultiParagraphNegTextIndent",
-            "longSimpleMultiParagraph",
-        ];
-
-        private function createDefaultTextLayoutFormat():TextLayoutFormat
-        {
-            var format:TextLayoutFormat = new TextLayoutFormat();
-            format.fontFamily = "Arial";
-            format.fontSize = 20;
-            format.direction = _direction;
-            format.blockProgression = _blockProgression;
-            return format;
-        }
-
-        private function createTextFlow(markup:String):TextFlow
-        {
-            if (markup.length <= 0 || markup.charAt(0) != "<")
-                return TextConverter.importToFlow(markup, TextConverter.PLAIN_TEXT_FORMAT);
-
-            var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
-            var flowNotReadyGraphicsCount:int = 0;
-
-            // check for inlines
-            for (var leaf:FlowLeafElement = textFlow.getFirstLeaf(); leaf != null; leaf = leaf.getNextLeaf())
-                if (leaf is InlineGraphicElement && InlineGraphicElement(leaf).status != InlineGraphicElementStatus.READY)
-                    flowNotReadyGraphicsCount++;
-            if (flowNotReadyGraphicsCount != 0)
-            {
-                textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE, statusChangeHandler, false, 0, true);
-                textFlow.flowComposer.addController(new ContainerController(new Sprite()));	// add dummy controller so we get status change events
-                textFlow.flowComposer.updateAllControllers();
-                notReadyGraphicsCount += flowNotReadyGraphicsCount;
-            }
-            return textFlow;
-        }
-
         // Track the completion of loading inlines, dispatch a completion event when its done
         private function statusChangeHandler(obj:Event):void
         {
@@ -449,47 +354,6 @@ package UnitTest.Tests
             }
         }
 
-        private function addTextFactoryFromFlowSprite(x:Number, y:Number, width:Number, height:Number, textFlow:TextFlow):Sprite
-        {
-            // trace("addTextFactoryFromFlowSprite",x,y,width,height,textAlign,verticalAlign,lineBreak);
-
-            var factorySprite:Sprite = new Sprite();
-            factorySprite.x = x;
-            factorySprite.y = y;
-
-            addToCanvas(factorySprite);
-
-            textFlowFactory.compositionBounds = new Rectangle(0, 0, width ? width : NaN, height ? height : NaN);
-
-            textFlowFactory.createTextLines(callback, textFlow);
-            clearCanvas();
-            addToCanvas(factorySprite);
-
-            function callback(tl:TextLine):void
-            {
-                factorySprite.addChild(tl);
-            }
-
-            // composition bounds in black
-            // contentBounds in red
-            // put it in another sprite on top
-            sprite = new Sprite();
-            sprite.x = x;
-            sprite.y = y;
-            addToCanvas(sprite);
-
-            compareBounds = textFlowFactory.getContentBounds();
-            var g:Graphics = sprite.graphics;
-            drawCircle(g, 0xff00, 0, 0, 3);
-            strokeRect(g, 1, 0x0, 0, 0, width, height);
-            strokeRect(g, 1, 0xFF0000, compareBounds.left, compareBounds.top, compareBounds.width, compareBounds.height);
-            // trace("addTextFactoryFromFlowSprite is running");
-            fFactBounds = textFlowFactory.getContentBounds();
-
-            // trace("bounds",sFactBounds);
-            return factorySprite;
-        }
-
         private function addTextFlowSprite(parentSprite:Sprite, x:Number, y:Number, width:Number, height:Number, textFlow:TextFlow):Sprite
         {
             sprite = new Sprite();
@@ -558,100 +422,6 @@ package UnitTest.Tests
             g.endFill();
         }
 
-
-        private function validateContentBounds(s:Sprite, contentBounds:Rectangle, marginOfError:Number):void
-        {
-            // Check that the content bounds includes all the places within the container that have text
-            s.graphics.clear();
-            var bbox:Rectangle = s.getBounds(s);
-
-            // The content bounds should always include the inked bounds, or be very close to it. In practice, how far it may be off by is proportional to the text size.
-            assertTrue("contentBounds left doesn't match sprite inked bounds", contentBounds.left <= bbox.left || Math.abs(contentBounds.left - bbox.left) < marginOfError);
-            assertTrue("contentBounds top doesn't match sprite inked bounds", contentBounds.top <= bbox.top || Math.abs(contentBounds.top - bbox.top) < marginOfError);
-            assertTrue("contentBounds right doesn't match sprite inked bounds", contentBounds.right >= bbox.right || Math.abs(contentBounds.right - bbox.right) < marginOfError);
-            assertTrue("contentBounds bottom doesn't match sprite inked bounds", contentBounds.bottom >= bbox.bottom || Math.abs(contentBounds.bottom - bbox.bottom) < marginOfError);
-        }
-
-        private function validateAlignment(verticalAlign:String, textAlign:String, textFlow:TextFlow, compositionBounds:Rectangle, contentBounds:Rectangle, expectContentsToFit:Boolean, marginOfError:Number):void
-        {
-            // Check that the text was put in the appropriate area of the container, given the vertical & horizontal alignment values
-            if (expectContentsToFit)
-            {
-                assertTrue("contents expected to fit, but overflow in height", contentBounds.height <= compositionBounds.height || contentBounds.height - compositionBounds.height < 1);
-                assertTrue("contents expected to fit, but overflow in width", contentBounds.width <= compositionBounds.width || contentBounds.width - compositionBounds.width < 1);
-            }
-
-            // Resolve direction dependent alignment
-            if (textAlign == TextAlign.START)
-                textAlign = textFlow.computedFormat.direction == Direction.LTR ? TextAlign.LEFT : TextAlign.RIGHT;
-            if (textAlign == TextAlign.END)
-                textAlign = textFlow.computedFormat.direction == Direction.RTL ? TextAlign.LEFT : TextAlign.RIGHT;
-
-            // Swap alignment values for validate call if text is rotated (vertical text)
-            if (_blockProgression == BlockProgression.RL)
-            {
-                var originalTextAlign:String = textAlign;
-                switch (verticalAlign)
-                {
-                    case VerticalAlign.TOP:
-                        textAlign = TextAlign.RIGHT;
-                        break;
-                    case VerticalAlign.MIDDLE:
-                        textAlign = TextAlign.CENTER;
-                        break;
-                    case VerticalAlign.BOTTOM:
-                        textAlign = TextAlign.LEFT;
-                        break;
-                    default:
-                        break;
-                }
-                switch (originalTextAlign)
-                {
-                    case TextAlign.LEFT:
-                        verticalAlign = VerticalAlign.TOP;
-                        break;
-                    case TextAlign.CENTER:
-                        verticalAlign = VerticalAlign.MIDDLE;
-                        break;
-                    case TextAlign.RIGHT:
-                        verticalAlign = VerticalAlign.BOTTOM;
-                        break;
-                    default:
-                        break;
-                }
-            }
-
-            switch (verticalAlign)
-            {
-                case VerticalAlign.TOP:
-                    assertTrue("Vertical alignment top - content not at top", Math.abs(contentBounds.top - compositionBounds.top) < marginOfError);
-                    break;
-                case VerticalAlign.MIDDLE:
-                    assertTrue("Vertical alignment middle - content not at middle", Math.abs(Math.abs(contentBounds.top - compositionBounds.top) - Math.abs(contentBounds.bottom - compositionBounds.bottom)) < marginOfError);
-                    break;
-                case VerticalAlign.BOTTOM:
-                    assertTrue("Vertical alignment bottom - content not at bottom", Math.abs(contentBounds.bottom - compositionBounds.bottom) < marginOfError);
-                    break;
-                default:
-                    break;
-            }
-            switch (textAlign)
-            {
-                case TextAlign.LEFT:
-                    assertTrue("Horizontal alignment left - content not at left", Math.abs(contentBounds.left - compositionBounds.left) < marginOfError);
-                    break;
-                case TextAlign.CENTER:
-                    assertTrue("Horizontal alignment center - content not at center", Math.abs(Math.abs(contentBounds.left - compositionBounds.left) - Math.abs(contentBounds.right - compositionBounds.right)) < marginOfError);
-                    break;
-                case TextAlign.RIGHT:
-                    assertTrue("Horizontal alignment right - content not at right", Math.abs(contentBounds.right - compositionBounds.right) < marginOfError);
-                    break;
-                default:
-                    break;
-            }
-        }
-
-
         /** Run a single markup description in vertical alignment (top, middle, bottom) * horizontal alignment (left, center, right) in
          * both the full compose using ContainerController and a TextFlow Factory case. Compare the results to make sure the text falls
          * in the correct area of the container, that the content bounds is no smaller than the inked bounds, and that the full compose

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/BoxTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/BoxTest.as b/automation_tests/src/UnitTest/Tests/BoxTest.as
index e0512c5..6340382 100644
--- a/automation_tests/src/UnitTest/Tests/BoxTest.as
+++ b/automation_tests/src/UnitTest/Tests/BoxTest.as
@@ -76,31 +76,6 @@ package UnitTest.Tests
             metaData.productArea = "Text Composition";
         }
 
-        /*  public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-         {
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "paddingAndMarginOnDiv", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "negativePaddingAndMarginOnDiv", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "verticalSpaceCollapse", testConfig, null));
-
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingStart", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingEnd", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingBeforeAndAfter", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingStartStrikeAndUnderline", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingEndStrikeAndUnderline", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingBeforeAndAfterStrikeAndUnderline", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "floatMarginsAndPaddingLeftAndRight", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "floatMarginsAndPaddingUpAndDown", testConfig, null));
-
-
-         // We only need one version of these tests, they supply their own markup
-         if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-         {
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "textFlowPadding", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "rlPaddingOnDiv", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "boundsWithPadding", testConfig, null));
-         }
-         }    */
-
         [Before]
         override public function setUpTest():void
         {
@@ -154,28 +129,7 @@ package UnitTest.Tests
                 format.paddingRight = totalRight;
                 format.paddingBottom = totalBottom;
             }
-            /*	if (verticalText)		FOR WHEN MARGINS ARE TURNED BACK ON
-             {
-             format.marginLeft = totalBottom / 2;
-             format.paddingLeft = totalBottom / 2;
-             format.marginTop = totalLeft / 2;
-             format.paddingTop = totalLeft / 2;
-             format.marginRight = totalTop / 2;
-             format.paddingRight = totalTop / 2;
-             format.marginBottom = totalRight / 2;
-             format.paddingBottom = totalRight / 2;
-             }
-             else
-             {
-             format.marginLeft = totalLeft / 2;
-             format.paddingLeft = totalLeft / 2;
-             format.marginTop = totalTop / 2;
-             format.paddingTop = totalTop / 2;
-             format.marginRight = totalRight / 2;
-             format.paddingRight = totalRight / 2;
-             format.marginBottom = totalBottom / 2;
-             format.paddingBottom = totalBottom / 2;
-             } */
+
             element.format = format;
         }
 
@@ -549,9 +503,6 @@ package UnitTest.Tests
             var columnRect:Rectangle = controller.columnState.getColumnAt(tfl.columnIndex);
 
             // Check that graphic leaves a margin on the left side, so its not right up against the container edge
-            //	var globalInlinePt:Point = ilg.graphic.localToGlobal(new Point(0, 0));
-            //	var inlinePt:Point = controller.container.globalToLocal(globalInlinePt);
-            //	var inlineBBox:Rectangle = new Rectangle(inlinePt.x, inlinePt.y, ilg.elementWidth, ilg.elementHeight);
             var inlineBBox:Rectangle = new Rectangle(floatHolder.x, floatHolder.y, ilg.elementWidth, ilg.elementHeight);
 
             if (float == Float.LEFT)

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as b/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
index 1381e41..5e401c9 100644
--- a/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
+++ b/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
@@ -18,8 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-
-    import UnitTest.ExtendedClasses.TestSuiteExtended;
     import UnitTest.ExtendedClasses.VellumTestCase;
     import UnitTest.Fixtures.TestConfig;
 
@@ -71,12 +69,6 @@ package UnitTest.Tests
             markup = getTestMarkup();
         }
 
-        public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
-        {
-            var testCaseClass:Class = ContainerTypeTest;
-            VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
-        }
-
         [Before]
         override public function setUpTest():void
         {

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/CrossContainerTest.as b/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
index bf9f20b..1d831ec 100644
--- a/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
+++ b/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
@@ -18,240 +18,216 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.display.Sprite;
-	import flash.text.engine.TextBlock;
-	import flash.text.engine.TextLine;
-	
-	import flashx.textLayout.compose.IFlowComposer;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.SpanElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Direction;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.tlf_internal;
-	
-	import mx.containers.Canvas;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flash.display.Sprite;
+    import flash.text.engine.TextBlock;
+    import flash.text.engine.TextLine;
+
+    import flashx.textLayout.compose.IFlowComposer;
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.SpanElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Direction;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.tlf_internal;
+
+    import mx.containers.Canvas;
 
     import org.flexunit.asserts.assertTrue;
 
     use namespace tlf_internal;
-	
-	public class CrossContainerTest extends VellumTestCase
-	{
+
+    public class CrossContainerTest extends VellumTestCase
+    {
         // Members
         private var _flowComposer:IFlowComposer;
-		private var _textFlow:TextFlow;
-		private var _testXML:XML;
-		private var _verticalText:Boolean;
-		private var _rtlText:Boolean;
-		private var _testCanvas:Canvas;
-		private var _textFlowSprite:Sprite;
-		private var _container1:Sprite;
-		private var _container2:Sprite;
-		private var _container3:Sprite;
-		
-		public function CrossContainerTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super (methodName, testID, testConfig);
-			_testXML = testXML;
-			TestData.fileName = null;
-			
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Text Composition";
-		}
-		
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-            addTestCase(ts, testConfig, "crossContainerTest");
-		}
-		
-		private static function addTestCase(ts:TestSuiteExtended, testConfig:TestConfig, methodName:String):void
-		{
-			var testXML:XML = <TestCase>
-								<TestData name="methodName">{methodName}</TestData>
-								<TestData name="id">{methodName}</TestData>
-							</TestCase>;
-
-			ts.addTestDescriptor (new TestDescriptor (CrossContainerTest,"callTestMethod", testConfig, testXML) );
-		}
-		
-		override public function setUpTest() : void
-		{
-			super.setUpTest();
-			setupTextFlow();
-			initializeFlow();
-		}
-		
-		private function setupTextFlow():void
-
-		{
-			var textFlow:TextFlow = new TextFlow();
-			var para1String:String = "In the first paragraph of a "
-			var para1String2:String = "cheap"
-			var para1String3:String ="Western novel, a cowboy meets a saloon girl.";
-			var para2String:String = "In the middle of the cheap novel a really bad guy, "+
-				"who is having a relationship with the saloon girl, sees the cowboy help "+
-				"her onto her horse as she smiles at him warmly."
-			var para3String:String = "In the last paragraph of the cheap novel, the cowboy kills "+
-				"the really bad guy in a shootout in the middle of main street and "+
-				"then rides into the sunset with the saloon girl on the back of his";
-			
-			var controllerOne:ContainerController;
-			var controllerTwo:ContainerController;
-			
-			_container1 = new Sprite();
-			_container2 = new Sprite();
-			
-			controllerOne = new ContainerController(_container1, 200, 210);
-			controllerTwo = new ContainerController(_container2, 200, 220);
-			
-			var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
-			var paragraph1:ParagraphElement = new ParagraphElement();
-			
-			var paragraph2:ParagraphElement = new ParagraphElement();
-			var paragraph3:ParagraphElement = new ParagraphElement();
-			
-			var p1Span1:SpanElement = new SpanElement();
-			var p1Span2:SpanElement = new SpanElement();
-			var p1Span3:SpanElement = new SpanElement();
-			var p2Span:SpanElement = new SpanElement();
-			var p3Span:SpanElement = new SpanElement();
-			
-			p1Span1.text = para1String;
-			p1Span2.text = para1String2;
-			p1Span3.text = para1String3;
-			
-			paragraph1.addChild(p1Span1);
-			paragraph1.addChild(p1Span2);
-			paragraph1.addChild(p1Span3);
-			
-			p2Span.text = para2String;
-			paragraph2.addChild(p2Span);
-			
-			p3Span.text = para3String;
-			
-			var img:InlineGraphicElement = new InlineGraphicElement();
-			img.source = "../../test/testFiles/assets/smiley.gif"
-			img.width = 100;
-			img.height = 100;
-			
-			paragraph3.addChild(p3Span);
-			paragraph3.addChild(img);
-			
-			textFlow.addChild(paragraph1);
-			textFlow.addChild(paragraph2);
-			textFlow.addChild(paragraph3);
-			
-			textLayoutFormat.fontSize = 14;
-			textLayoutFormat.textIndent = 15;
-			textLayoutFormat.paragraphSpaceAfter = 15;
-			textLayoutFormat.paddingTop = 4;
-			textLayoutFormat.paddingLeft = 4;
-			
-			textFlow.hostFormat = textLayoutFormat;
-			textFlow.interactionManager = new EditManager();
-			_container1.x = 0;
-			_container1.y = 100;
-			_container2.x = 255;
-			_container2.y = 100; 
-			textFlow.flowComposer.addController(controllerOne);
-			textFlow.flowComposer.addController(controllerTwo);
-			textFlow.flowComposer.updateAllControllers();
-			
-			_container3 = new Sprite();
-			var controllerThree:ContainerController = new ContainerController(_container3, 200, 220);
-			_container3.x = 510;
-			_container3.y = 100; 
-			var textLayoutFormat1:TextLayoutFormat = new TextLayoutFormat();
-			
-			textLayoutFormat1.fontSize = 18;
-			textLayoutFormat1.textIndent = 15;
-			textLayoutFormat1.paragraphSpaceAfter = 15;
-			textLayoutFormat1.paddingTop = 4;
-			textLayoutFormat1.paddingLeft = 4;
-			textFlow.hostFormat = textLayoutFormat1;
-			textFlow.flowComposer.addController(controllerThree);
-			
-			_textFlowSprite = new Sprite();
-			_textFlowSprite.addChild(_container1);
-			_textFlowSprite.addChild(_container2);
-			_textFlowSprite.addChild(_container3);
-		
-			_textFlow = textFlow;
-
-		}
-		
-		override public function tearDownTest(): void
-		{
-			super.tearDownTest();
-		}
-		
-		private function initializeFlow():void
-		{
-			_flowComposer = _textFlow.flowComposer;
-			_testCanvas = myEmptyChilds();
-			_testCanvas.rawChildren.addChild(_textFlowSprite);
-			
+        private var _textFlow:TextFlow;
+        private var _verticalText:Boolean;
+        private var _rtlText:Boolean;
+        private var _testCanvas:Canvas;
+        private var _textFlowSprite:Sprite;
+        private var _container1:Sprite;
+        private var _container2:Sprite;
+        private var _container3:Sprite;
+
+        public function CrossContainerTest()
+        {
+            super("", "CrossContainerTest", TestConfig.getInstance());
+            TestData.fileName = null;
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Text Composition";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+            setupTextFlow();
+            initializeFlow();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        public function crossContainerTest():void
+        {
+            var tb:TextBlock = (_textFlow.getChildAt(2) as ParagraphElement).getTextBlock();
+            assertTrue("The _textBlock of the second paragraph should not be null", tb);
+            var fLine:TextLine = tb.firstLine;
+            assertTrue("The first TextLine of the second paragraph should not be null", fLine);
+            assertTrue("The first TextLine of the second paragraph should be on the second container", fLine.parent == _container2);
+        }
+
+        private function setupTextFlow():void
+        {
+            var textFlow:TextFlow = new TextFlow();
+            var para1String:String = "In the first paragraph of a "
+            var para1String2:String = "cheap"
+            var para1String3:String = "Western novel, a cowboy meets a saloon girl.";
+            var para2String:String = "In the middle of the cheap novel a really bad guy, " +
+                    "who is having a relationship with the saloon girl, sees the cowboy help " +
+                    "her onto her horse as she smiles at him warmly."
+            var para3String:String = "In the last paragraph of the cheap novel, the cowboy kills " +
+                    "the really bad guy in a shootout in the middle of main street and " +
+                    "then rides into the sunset with the saloon girl on the back of his";
+
+            var controllerOne:ContainerController;
+            var controllerTwo:ContainerController;
+
+            _container1 = new Sprite();
+            _container2 = new Sprite();
+
+            controllerOne = new ContainerController(_container1, 200, 210);
+            controllerTwo = new ContainerController(_container2, 200, 220);
+
+            var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
+            var paragraph1:ParagraphElement = new ParagraphElement();
+
+            var paragraph2:ParagraphElement = new ParagraphElement();
+            var paragraph3:ParagraphElement = new ParagraphElement();
+
+            var p1Span1:SpanElement = new SpanElement();
+            var p1Span2:SpanElement = new SpanElement();
+            var p1Span3:SpanElement = new SpanElement();
+            var p2Span:SpanElement = new SpanElement();
+            var p3Span:SpanElement = new SpanElement();
+
+            p1Span1.text = para1String;
+            p1Span2.text = para1String2;
+            p1Span3.text = para1String3;
+
+            paragraph1.addChild(p1Span1);
+            paragraph1.addChild(p1Span2);
+            paragraph1.addChild(p1Span3);
+
+            p2Span.text = para2String;
+            paragraph2.addChild(p2Span);
+
+            p3Span.text = para3String;
+
+            var img:InlineGraphicElement = new InlineGraphicElement();
+            img.source = "../../test/testFiles/assets/smiley.gif"
+            img.width = 100;
+            img.height = 100;
+
+            paragraph3.addChild(p3Span);
+            paragraph3.addChild(img);
+
+            textFlow.addChild(paragraph1);
+            textFlow.addChild(paragraph2);
+            textFlow.addChild(paragraph3);
+
+            textLayoutFormat.fontSize = 14;
+            textLayoutFormat.textIndent = 15;
+            textLayoutFormat.paragraphSpaceAfter = 15;
+            textLayoutFormat.paddingTop = 4;
+            textLayoutFormat.paddingLeft = 4;
+
+            textFlow.hostFormat = textLayoutFormat;
+            textFlow.interactionManager = new EditManager();
+            _container1.x = 0;
+            _container1.y = 100;
+            _container2.x = 255;
+            _container2.y = 100;
+            textFlow.flowComposer.addController(controllerOne);
+            textFlow.flowComposer.addController(controllerTwo);
+            textFlow.flowComposer.updateAllControllers();
+
+            _container3 = new Sprite();
+            var controllerThree:ContainerController = new ContainerController(_container3, 200, 220);
+            _container3.x = 510;
+            _container3.y = 100;
+            var textLayoutFormat1:TextLayoutFormat = new TextLayoutFormat();
+
+            textLayoutFormat1.fontSize = 18;
+            textLayoutFormat1.textIndent = 15;
+            textLayoutFormat1.paragraphSpaceAfter = 15;
+            textLayoutFormat1.paddingTop = 4;
+            textLayoutFormat1.paddingLeft = 4;
+            textFlow.hostFormat = textLayoutFormat1;
+            textFlow.flowComposer.addController(controllerThree);
+
+            _textFlowSprite = new Sprite();
+            _textFlowSprite.addChild(_container1);
+            _textFlowSprite.addChild(_container2);
+            _textFlowSprite.addChild(_container3);
+
+            _textFlow = textFlow;
+
+        }
+
+        private function initializeFlow():void
+        {
+            _flowComposer = _textFlow.flowComposer;
+            _testCanvas = myEmptyChilds();
+            _testCanvas.rawChildren.addChild(_textFlowSprite);
+
             // Set the writing direction specified by the test
-			_textFlow.blockProgression = writingDirection[0];
-			_textFlow.direction        = writingDirection[1];
-			
+            _textFlow.blockProgression = writingDirection[0];
+            _textFlow.direction = writingDirection[1];
+
             _verticalText = (_textFlow.blockProgression == BlockProgression.RL);
             _rtlText = (_textFlow.direction == Direction.RTL);
-            
-			SelManager = EditManager(_textFlow.interactionManager);
-			if(SelManager) 
-			{
-				SelManager.selectRange(0, 0);
-				//make sure there is never any blinking when running these tests
-				setCaretBlinkRate (0);
-			}
-            
-			_textFlow.flowComposer.updateAllControllers();
-		}
-		
-		private function myEmptyChilds():Canvas
-		{
-			var TestCanvas:Canvas = null;
-			TestDisplayObject = testApp.getDisplayObject();
-			if (TestDisplayObject)
-			{
-				TestCanvas = Canvas(TestDisplayObject);
-				TestCanvas.removeAllChildren();
-				var iCnt:int = TestCanvas.rawChildren.numChildren;
-				for ( var a:int = 0; a < iCnt; a ++ )
-				{
-					TestCanvas.rawChildren.removeChildAt(0);
-				}
-			}
-			
-			return TestCanvas;
-		}
-		
-		public function callTestMethod():void
-		{
-				var TestCase:XML = _testXML;
-				var methodName:String = TestCase.TestData.(@name == "methodName").toString();
-				this[methodName]();
-		}
-		
-		private function crossContainerTest():void
-		{
-			var tb:TextBlock = (_textFlow.getChildAt(2) as ParagraphElement).getTextBlock();
-			assertTrue ("The _textBlock of the second paragraph should not be null",  tb);
-			var fLine:TextLine = tb.firstLine;
-			assertTrue ("The first TextLine of the second paragraph should not be null",  fLine);
-			assertTrue ("The first TextLine of the second paragraph should be on the second container",  fLine.parent == _container2);
-		}
-		
-    } // !class
+
+            SelManager = EditManager(_textFlow.interactionManager);
+            if (SelManager)
+            {
+                SelManager.selectRange(0, 0);
+                //make sure there is never any blinking when running these tests
+                setCaretBlinkRate(0);
+            }
+
+            _textFlow.flowComposer.updateAllControllers();
+        }
+
+        private function myEmptyChilds():Canvas
+        {
+            var TestCanvas:Canvas = null;
+            TestDisplayObject = testApp.getDisplayObject();
+            if (TestDisplayObject)
+            {
+                TestCanvas = Canvas(TestDisplayObject);
+                TestCanvas.removeAllChildren();
+                var iCnt:int = TestCanvas.rawChildren.numChildren;
+                for (var a:int = 0; a < iCnt; a++)
+                {
+                    TestCanvas.rawChildren.removeChildAt(0);
+                }
+            }
+
+            return TestCanvas;
+        }
+
+    }
 }