incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1369998 [8/9] - in /incubator/flex/trunk/mustella/tests/States: ./ CurrentSyntax/ CurrentSyntax/Clear/ CurrentSyntax/Dot/ CurrentSyntax/Events/ CurrentSyntax/ExcludeFrom/ CurrentSyntax/IncludeIn/ CurrentSyntax/IncludeIn/baselines/ CurrentS...
Date Mon, 06 Aug 2012 20:42:49 GMT
Added: incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups1.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups1.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups1.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups1.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,436 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="States/CurrentSyntax/StateGroups/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="stateGroupsApp1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+        import mx.core.Application;
+	]]>
+	</mx:Script>
+
+    <testCases>
+
+<!--
+================================================================================
+Format of the stateGroups param.
+================================================================================
+-->
+<TestCase testID="stateGroups_commas_1" keywords="[States,StateGroups]" description="StateGroups array with commas, no whitespace.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state1" waitTarget="btn1" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_2" keywords="[States,StateGroups]" description="StateGroups array with commas, no whitespace.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state1" waitTarget="btn2" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn2" propertyName="label" value="f" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_3" keywords="[States,StateGroups]" description="StateGroups array with commas, no whitespace.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state1" waitTarget="btn3" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="k" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_4" keywords="[States,StateGroups]" description="StateGroups array with commas and spaces.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state2" waitTarget="btn1" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="b" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_5" keywords="[States,StateGroups]" description="StateGroups array with commas and spaces.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state2" waitTarget="btn2" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn2" propertyName="label" value="g" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_6" keywords="[States,StateGroups]" description="StateGroups array with commas and spaces.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state2" waitTarget="btn3" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="l" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_7" keywords="[States,StateGroups]" description="StateGroups array with commas and tabs.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state3" waitTarget="btn1" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="c" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_8" keywords="[States,StateGroups]" description="StateGroups array with commas and tabs.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state3" waitTarget="btn2" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn2" propertyName="label" value="h" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_9" keywords="[States,StateGroups]" description="StateGroups array with commas and tabs.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state3" waitTarget="btn3" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="m" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_10" keywords="[States,StateGroups]" description="StateGroups array with mix of commas and tabs.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state4" waitTarget="btn1" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="d" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_11" keywords="[States,StateGroups]" description="StateGroups array with mix of commas and tabs.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state4" waitTarget="btn2" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn2" propertyName="label" value="i" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_12" keywords="[States,StateGroups]" description="StateGroups array with mix of commas and tabs.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state4" waitTarget="btn3" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="n" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_13" keywords="[States,StateGroups]" description="StateGroups array with array brackets.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state5" waitTarget="btn1" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="e" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_14" keywords="[States,StateGroups]" description="StateGroups array with array brackets.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state5" waitTarget="btn2" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn2" propertyName="label" value="j" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_commas_15" keywords="[States,StateGroups]" description="StateGroups array with array brackets.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state5" waitTarget="btn3" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="o" />
+    </body>
+</TestCase>
+
+<!--
+================================================================================
+Properties and stateGroups
+================================================================================
+-->
+<!-- This is done by the whitespace tests. -->
+<!--TestCase testID="stateGroups_properties_" keywords="[States,StateGroups]" description="Assign a property a value for a StateGroup."-->
+
+<TestCase testID="stateGroups_properties_1" keywords="[States,StateGroups]" description="Assign a property a value for a StateGroup, then switch to another state in the same StateGroup.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state6" waitTarget="btn4" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn4" propertyName="label" value="p" />
+        <SetProperty propertyName="currentState" value="state7" waitTarget="btn4" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn4" propertyName="label" value="p" />
+    </body>
+</TestCase>
+
+<!-- These are done by the whitespace tests. -->
+<!--TestCase testID="stateGroups_properties_2" keywords="[States,StateGroups]" description="Assign a property a value for a StateGroup, then switch to another state in a different StateGroup."-->
+
+<TestCase testID="stateGroups_properties_4" keywords="[States,StateGroups]" description="Assign a property a value for a state, and a different value for a StateGroup that state is not in.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state8" waitTarget="btn5" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn5" propertyName="label" value="q" />
+        <SetProperty propertyName="currentState" value="state9" waitTarget="btn5" waitEvent="updateComplete" />
+        <AssertPropertyValue target="btn5" propertyName="label" value="r" />
+    </body>
+</TestCase>
+
+<!--
+================================================================================
+Styles and stateGroups
+================================================================================
+-->
+<TestCase testID="stateGroups_styles_1" keywords="[States,StateGroups]" description="Assign a style a value for a StateGroup.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state10" waitTarget="btn6" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn6" styleName="testStringStyle" value="s" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_styles_2" keywords="[States,StateGroups]" description="Assign a style a value for a StateGroup, then switch to another state in the same StateGroup.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state10" waitTarget="btn7" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn7" styleName="testStringStyle" value="t" />
+        <SetProperty propertyName="currentState" value="state11" waitTarget="btn7" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn7" styleName="testStringStyle" value="t" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_styles_3" keywords="[States,StateGroups]" description="Assign a style a value for a StateGroup, then switch to another state in a different StateGroup.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state11" waitTarget="btn8" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn8" styleName="testStringStyle" value="u" />
+        <SetProperty propertyName="currentState" value="state12" waitTarget="btn8" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn8" styleName="testStringStyle" value="v" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_styles_4" keywords="[States,StateGroups]" description="Assign a style a value for a state, and a different value for a StateGroup that state is not in.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state12" waitTarget="btn9" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn9" styleName="testStringStyle" value="w" />
+        <SetProperty propertyName="currentState" value="state13" waitTarget="btn9" waitEvent="updateComplete" />
+        <AssertStyleValue target="btn9" styleName="testStringStyle" value="x" />
+    </body>
+</TestCase>
+
+<!--
+================================================================================
+includeIn and stateGroups
+================================================================================
+-->
+<TestCase testID="stateGroups_includeIn_1" keywords="[States,StateGroups]" description="Use a StateGroup in an includeIn." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state14" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn10" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state13" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn10" propertyName="parent" value="null" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_includeIn_2" keywords="[States,StateGroups]" description="Use multiple StateGroups in an includeIn." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state15" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn11" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state14" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn11" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state13" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn11" propertyName="parent" value="null" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_includeIn_3" keywords="[States,StateGroups]" description="Use a StateGroup and a state in an includeIn.  The state is in the StateGroup." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state16" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn12" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state15" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn12" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state14" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn12" propertyName="parent" value="null" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_includeIn_4" keywords="[States,StateGroups]" description="Use a StateGroup and a state in an includeIn.  The state is in a different StateGroup." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state16" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn13" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state15" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn13" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state14" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn13" propertyName="parent" value="stateGroupsApp1_0" />
+        <SetProperty propertyName="currentState" value="state13" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn13" propertyName="parent" value="null" />
+    </body>
+</TestCase>
+
+<!--
+================================================================================
+excludeFrom and stateGroups
+================================================================================
+-->
+<TestCase testID="stateGroups_excludeFrom_1" keywords="[States,StateGroups]" description="Use a StateGroup in an excludeFrom." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state17" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn14" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state16" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn14" propertyName="parent" value="stateGroupsApp1_0" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_excludeFrom_2" keywords="[States,StateGroups]" description="Use multiple StateGroups in an excludeFrom." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state17" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn15" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state18" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn15" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state16" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn15" propertyName="parent" value="stateGroupsApp1_0" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_excludeFrom_3" keywords="[States,StateGroups]" description="Use a StateGroup and a state in an excludeFrom.  The state is in the StateGroup." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state18" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn16" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state19" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn16" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state16" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn16" propertyName="parent" value="stateGroupsApp1_0" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_excludeFrom_4" keywords="[States,StateGroups]" description="Use a StateGroup and a state in an excludeFrom.  The state is in a different StateGroup." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state17" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn17" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state18" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn17" propertyName="parent" value="null" />
+        <SetProperty propertyName="currentState" value="state16" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn17" propertyName="parent" value="stateGroupsApp1_0" />
+    </body>
+</TestCase>
+
+<!--
+================================================================================
+Other stateGroups tests
+================================================================================
+-->
+<TestCase testID="stateGroups_childNodeSyntax" keywords="[States,StateGroups]" description="Use StateGroups in child node syntax." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state20" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn18" propertyName="label" value="y" />
+        <SetProperty propertyName="currentState" value="state21" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn18" propertyName="label" value="z" />
+        <SetProperty propertyName="currentState" value="state22" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn18" propertyName="label" value="a" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_clear" keywords="[States,StateGroups]" description="Use @Clear() with a StateGroup." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state23" waitEvent="currentStateChange" />
+        <AssertStyleValue target="btn19" styleName="color" value="0x000000" />
+    </body>
+</TestCase>
+
+	</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups2.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups2.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups2.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups2.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="States/CurrentSyntax/StateGroups/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="stateGroupsApp2.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+        import mx.core.Application;
+	]]>
+	</mx:Script>
+
+    <testCases>
+<!--
+================================================================================
+All states are in one state group.
+================================================================================
+-->
+<TestCase testID="stateGroups_allStatesOneGroup_1" keywords="[States,StateGroups]" description="Put all states in one group; assign a label for the group." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <!-- The app. starts in state1, so don't set it here. /-->
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+        <SetProperty propertyName="currentState" value="state2" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+        <SetProperty propertyName="currentState" value="state3" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+        <SetProperty propertyName="currentState" value="state4" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+        <SetProperty propertyName="currentState" value="state5" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_allStatesOneGroup_2" keywords="[States,StateGroups]" description="Put all states in one group; assign a label for state1." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <!-- The app. starts in state1, so don't set it here. /-->
+        <AssertPropertyValue target="btn2" propertyName="label" value="b" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_allStatesOneGroup_3" keywords="[States,StateGroups]" description="Put all states in one group; assign a label for state2." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state2" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="c" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_allStatesOneGroup_4" keywords="[States,StateGroups]" description="Put all states in one group; assign a label for state3." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state3" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn4" propertyName="label" value="d" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_allStatesOneGroup_5" keywords="[States,StateGroups]" description="Put all states in one group; assign a label for state4." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state4" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn5" propertyName="label" value="e" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_allStatesOneGroup_6" keywords="[States,StateGroups]" description="Put all states in one group; assign a label for state5." >
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <SetProperty propertyName="currentState" value="state5" waitEvent="currentStateChange" />
+        <AssertPropertyValue target="btn6" propertyName="label" value="f" />
+    </body>
+</TestCase>
+
+	</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups3.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups3.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups3.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/CurrentSyntax/StateGroups/stateGroups3.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="States/CurrentSyntax/StateGroups/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="stateGroupsApp3.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+        import mx.core.Application;
+	]]>
+	</mx:Script>
+
+    <testCases>
+
+<!--
+================================================================================
+There is only one state, and it is in multiple groups.
+================================================================================
+-->
+
+<TestCase testID="stateGroups_allGroupsOneState_1" keywords="[States,StateGroups]" description="All states in one StateGroup, verify label attached to the groups.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <!-- The app. starts in state1, so don't set it here. /-->
+        <AssertPropertyValue target="btn1" propertyName="label" value="a" />
+        <AssertPropertyValue target="btn2" propertyName="label" value="b" />
+        <AssertPropertyValue target="btn3" propertyName="label" value="c" />
+        <AssertPropertyValue target="btn4" propertyName="label" value="d" />
+        <AssertPropertyValue target="btn5" propertyName="label" value="e" />
+    </body>
+</TestCase>
+
+<TestCase testID="stateGroups_allGroupsOneState_2" keywords="[States,StateGroups]" description="All states in one StateGroup, verify label attached to the state.">
+    <setup>
+        <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" />
+    </setup>
+    <body>
+        <!-- The app. starts in state1, so don't set it here. /-->
+        <AssertPropertyValue target="btn6" propertyName="label" value="f" />
+    </body>
+</TestCase>
+
+	</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/AddChild_Integration.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/AddChild_Integration.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/AddChild_Integration.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/AddChild_Integration.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="States/Flex3Syntax/AddChild/Integration/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="AddChildApp01.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+        import mx.core.Application;
+        
+        public var anInt:int = 0;
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+        <!-- The setup sets the app. to a ReinitState, then to the default state.  We need to start each
+             test in a default state, but don't know if the previous test run left us in that state or some other.
+             If it left us in the default state, then we can't reset to the default state and then wait for some 
+             event, because the app. will be in that state and no event will occur.
+        -->
+        
+        <!-- Use AddChild with no extra parameters (basic sanity tests with bitmap compares). -->
+        <TestCase testID="AddChild_None_TextInput_01" keywords="[States,AddChild]" description="AddChild adds a Text control when changing from the default state to a new state.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_None_TextInput_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <AssertPropertyValue target="addChild9.target" propertyName="parent" value="AddChildApp01_0" />
+                <CompareBitmap target="tiAddChild_None_TextInput_01" url="../Integration/baselines/AddChild_None_TextInput_01.png" />
+            </body>
+        </TestCase>
+
+        <TestCase testID="AddChild_None_TextInput_02" keywords="[States,AddChild]" description="AddChild adds a Text control when changing from a non-default state to a new state.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_None_TextInput_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_None_TextInput_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <AssertPropertyValue target="addChild10.target" propertyName="parent" value="AddChildApp01_0" />
+                <CompareBitmap target="tiAddChild_None_TextInput_02" url="../Integration/baselines/AddChild_None_TextInput_02.png" />
+            </body>
+        </TestCase>
+
+        <TestCase testID="AddChild_None_TextInput_03" keywords="[States,AddChild]" description="Confirm that the target added by AddChild does not exist before AddChild is called.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <AssertMethodValue method="value=Application.application.tiAddChild_None_TextInput_03 == null" value="true" />
+            </body>
+        </TestCase>
+
+	</testCases>                	     
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/baselines/AddChild_None_TextInput_01.png
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/baselines/AddChild_None_TextInput_01.png?rev=1369998&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/baselines/AddChild_None_TextInput_01.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/baselines/AddChild_None_TextInput_02.png
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/baselines/AddChild_None_TextInput_02.png?rev=1369998&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Integration/baselines/AddChild_None_TextInput_02.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Properties/AddChild_Properties.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Properties/AddChild_Properties.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Properties/AddChild_Properties.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/Properties/AddChild_Properties.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="States/Flex3Syntax/AddChild/Properties/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="AddChildApp01.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+        import mx.core.Application;
+        
+        // Just handy script variables to use in various tests.
+        public var anInt:int = 0;
+        
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+        <!-- The setup sets the app. to a ReinitState, then to the default state.  We need to start each
+             test in a default state, but don't know if the previous test run left us in that state or some other.
+             If it left us in the default state, then we can't reset to the default state and then wait for some 
+             event, because the app. will be in that state and no event will occur.
+             
+             We decide that a control has been added if it has a parent (instead of parent being null).
+
+             Needed: 
+                 - Some basic sanity tests.  e.g. Prove that a control, when parented, really appears.
+                 - Mutliple controls in a state.
+                 - No controls in a state.
+                 - AddChild and other actions, such as RemoveChild, in a state (put in Integration).
+        -->
+
+<!--
+================================================================================
+creationPolicy and targetFactory
+================================================================================
+-->
+
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_None_01a" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild does not create the control when creationPolicy is 'none'.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+               <AssertPropertyValue target="addChild1" propertyName="target" value="null" />
+             </body>
+        </TestCase>
+
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_None_02" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild creates the control when creationPolicy is 'none' and createInstance() is called.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+               <RunCode code="Application.application.addChild2.createInstance()" />
+               <AssertPropertyValue target="addChild2.target" propertyName="parent" value="null" />
+             </body>
+        </TestCase>
+
+        <!-- This can only be tested by calling createInstance() before changing the state due to bug SDK-14966. -->
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_None_03" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild creates the control and parents it when creationPolicy is 'none', createInstance() is called, and then the state is changed.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+               <RunCode code="Application.application.addChild3.createInstance()" />
+               <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_TargetFactory-CreationPolicy_TextInput_None_03" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+               <AssertPropertyValue target="addChild3.target" propertyName="parent" value="AddChildApp01_0" />
+             </body>
+        </TestCase>
+
+        <!-- Fails due to SDK-14992
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_Auto_01" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild does not create the control before AddChild is called if creationPolicy is 'auto'.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body></body>
+               <AssertPropertyValue target="addChild4" propertyName="target" value="null" />
+             </body>
+        </TestCase>
+         -->
+
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_Auto_02" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild creates the control if creationPolicy is 'auto'.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+               <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_TargetFactory-CreationPolicy_TextInput_Auto_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+               <AssertPropertyValue target="addChild5.target" propertyName="parent" value="AddChildApp01_0" />
+             </body>
+        </TestCase>
+
+        <!-- Note: If we can get the target's parent, then we know the target isn't null...kill 2 birds. -->
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_All_01" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild creates the control before AddChild is called if creationPolicy is 'all'.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+               <AssertPropertyValue target="addChild6.target" propertyName="parent" value="null" />
+            </body>
+        </TestCase>
+
+        <TestCase testID="AddChild_TargetFactory-CreationPolicy_TextInput_All_02" keywords="[States,AddChild]" description="Confirm that the TargetFactory indicated by AddChild has created the control and parented it after swtiching states when the creationPolicy is 'all'.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+               <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_TargetFactory-CreationPolicy_TextInput_All_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+               <AssertPropertyValue target="addChild7.target" propertyName="parent" value="AddChildApp01_0" />
+            </body>
+        </TestCase>
+
+<!--
+================================================================================
+position & relativeTo (PRT)
+================================================================================
+-->
+
+<TestCase testID="AddChild_PRT_TextInput_Default_01" keywords="[States,AddChild]" description="Defaults should be 'lastChild' and the parent of the State object.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_Default_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedToEnd', 'TextInput')" value="true" />
+    </body>
+</TestCase>
+
+<!-- TODO for these next 2 tests: Programmatically determine the first and last child instead of hard coding. -->
+<TestCase testID="AddChild_PRT_TextInput_Before_01" keywords="[States,AddChild]" description="Before the first item.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_Before_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedBefore', 'TextInput', Application.application.btn1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_Before_02" keywords="[States,AddChild]" description="Before the last item.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_Before_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedBefore', 'TextInput', Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_Before_03" keywords="[States,AddChild]" description="Before the first item in a container.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_Before_03" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedBefore', 'TextInput', Application.application.btn4, Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_Before_04" keywords="[States,AddChild]" description="Before the last item in a container.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_Before_04" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedBefore', 'TextInput', Application.application.btn6, Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_After_01" keywords="[States,AddChild]" description="After the first item.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_After_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedAfter', 'TextInput', Application.application.btn1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_After_02" keywords="[States,AddChild]" description="After the last item.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_After_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedAfter', 'TextInput', Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_After_03" keywords="[States,AddChild]" description="After the first item in a container.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_After_03" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedAfter', 'TextInput', Application.application.btn4, Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_After_04" keywords="[States,AddChild]" description="After the last item in a container.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_After_04" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedAfter', 'TextInput', Application.application.btn6, Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_FirstChild_01" keywords="[States,AddChild]" description="The first child in the main app.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_FirstChild_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedToFront', 'TextInput')" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_FirstChild_02" keywords="[States,AddChild]" description="The first child in a container.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_FirstChild_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedToFront', 'TextInput', null, Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_LastChild_01" keywords="[States,AddChild]" description="The last child in the main app.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_LastChild_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedToEnd', 'TextInput')" value="true" />
+    </body>
+</TestCase>
+
+<TestCase testID="AddChild_PRT_TextInput_LastChild_02" keywords="[States,AddChild]" description="The last child in a container.">
+    <setup>
+        <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+    </setup>
+    <body>
+        <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+        <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_PRT_TextInput_LastChild_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+        <AssertMethodValue method="value = Application.application.confirmChildrenDiff('addedToEnd', 'TextInput', null, Application.application.box1)" value="true" />
+    </body>
+</TestCase>
+
+<!--
+================================================================================
+target
+================================================================================
+-->
+        <TestCase testID="AddChild_Target_TextInput_01" keywords="[States,AddChild]" description="Confirm that the target added by AddChild exists, but does not have a parent, before AddChild is called if the 'target' is set.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <AssertPropertyValue target="tiAddChild_Target_TextInput_01" propertyName="parent" valueExpression="null" />
+            </body>
+        </TestCase>
+
+        <TestCase testID="AddChild_Target_TextInput_02" keywords="[States,AddChild]" description="Confirm that the target added by AddChild is now parented after changing states.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="AddChild_Target_TextInput_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <AssertPropertyValue target="tiAddChild_Target_TextInput_02" propertyName="parent" value="AddChildApp01_0" />
+            </body>
+        </TestCase>
+
+
+<!--
+-->
+	</testCases>                	     
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.compile
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.compile?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.compile (added)
+++ incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.compile Mon Aug  6 20:42:44 2012
@@ -0,0 +1 @@
+ -theme=${flexlib}/themes/Halo/halo.swc

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/Flex3Syntax/AddChild/SWFs/AddChildApp01.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,350 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<mx:Application backgroundColor="0xFFFFFF" backgroundImage="" width="800" height="600" xmlns:mx="http://www.adobe.com/2006/mxml" >
+
+<mx:Script>
+<![CDATA[
+
+    import mx.core.*;
+
+    public var oldChildren:Array;
+    
+    // This is an attempt to write a method which will compare the current getChildren()
+    // array to a previous set of children.
+    // The idea is that you set theChildren = getChildren() first, then change, states,
+    // then call this method to see if the changes are correct.  Sample usage:
+    //
+    //     confirmControlDifferences("addedToFront", "TextInput"): Make sure that a TextInput was added at the front.
+    //     confirmControlDifferences("addedToEnd", "TextInput"): Make sure that a TextInput was added at the end.
+    //     confirmControlDifferences("addedBefore", "TextInput", txt1): Make sure that a TextInput was added before txt1.
+    //     confirmControlDifferences("addedAfter", "TextInput", txt1): Make sure that a TextInput was added after txt1.
+    //     confirmControlDifferences("addedAfter", "TextInput", txt1, box1): Make sure that a TextInput was added after txt1, which is in box1.
+    //
+    // The general strategy is to confirm the new one is the right type, and then make sure the rest are the same.
+    //
+    // The motivation for this is to avoid screen shots.
+
+    public function confirmChildrenDiff(action:String, type:String, control:UIComponent = null, container:Container = null):Boolean{
+        var ret:Boolean = false;
+        var newChildren:Array;
+        var i:int;
+
+        if(container)
+        	newChildren = container.getChildren();
+        else
+        	newChildren = getChildren();
+        
+        if(action == "addedToFront"){
+            // Verify the first item, then loop through the rest.
+            if(newChildren[0].className == type){
+                for(i = 0; i < oldChildren.length; ++i){                    
+                    if(oldChildren[i] != newChildren[i + 1]){
+                        break;
+                    }
+                    
+                    if(i == oldChildren.length - 1){
+                        ret = true;
+                    }
+                }
+            }
+        }else if(action == "addedToEnd"){
+            // Verify the last item, then loop through the rest.
+            if(newChildren[newChildren.length - 1].className == type){
+                for(i = 0; i < oldChildren.length; ++i){                    
+                    if(oldChildren[i] != newChildren[i]){
+                        break;
+                    }
+                    
+                    if(i == oldChildren.length - 1){
+                        ret = true;
+                    }
+                }
+            }
+        }else if(action == "addedBefore"){
+			for(i = 0; i < oldChildren.length; ++i){
+				if(oldChildren[i] != newChildren[i]){ // there is a difference.
+					if(newChildren[i].className == type && newChildren[i + 1] === control && oldChildren[i] === control){ // the type is right, and the next control in the list is right.
+						++i;
+						ret = true;
+						break;
+					}else{
+						break; // the difference was the wrong type of in the wrong place relative to control.
+					}
+				}
+			}
+
+			// Now compare the items after the difference.
+			if(ret){
+				for(; i < oldChildren.length; ++i){
+					if(newChildren[i + 1] != oldChildren[i]){
+						ret = false;
+					}
+				}
+			}
+        }else if(action == "addedAfter"){
+        	// Advance until we find a difference.
+        	// Verify the type is right.
+        	// Verify the previous item
+        	for(i = 0; i < newChildren.length; ++i){
+        		if(i >= oldChildren.length || oldChildren[i] != newChildren[i]){ // the new item is at the end of newChildren or there's a difference.
+					if(newChildren[i].className == type && newChildren[i - 1] === control){ // the type is right, and the prev. control in the list is right.
+						++i;
+						ret = true;
+						break;
+					}else{
+						break; // the difference was the wrong type of in the wrong place relative to control.
+					}
+        		}
+        	}
+
+			// Now compare the items after the difference.
+			if(ret){
+				for(; i < oldChildren.length; ++i){
+					if(newChildren[i + 1] != oldChildren[i]){
+						ret = false;
+					}
+				}
+			}
+        }
+                
+        return ret;
+    }
+
+
+
+]]>
+</mx:Script>
+
+<!-- Embed fonts for cross platform compatibility of bitmap compares. -->
+<mx:Style>
+    @font-face {
+        src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
+        fontFamily: EmbeddedVerdana;
+			embedAsCFF: false;
+    }
+
+    @font-face {
+        src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
+        fontWeight: bold;
+        fontFamily: EmbeddedVerdana;
+			embedAsCFF: false;
+    }
+
+    @font-face {
+        src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
+        fontStyle: italic;
+        fontFamily: EmbeddedVerdana;
+			embedAsCFF: false;
+    }
+    
+    global{
+        fontFamily: EmbeddedVerdana;
+        fontAntiAliasType: normal;
+    }
+</mx:Style>
+
+<!--
+    State naming convention: 
+        Method_Param_ControlBeingActedUpon_DetailsIfAny_Number
+-->
+
+<mx:states>
+    <mx:State name="ReinitState" />
+
+<!--
+================================================================================
+Integration
+================================================================================
+-->
+    <mx:State name="AddChild_None_TextInput_01" >
+        <mx:AddChild id="addChild9">
+            <mx:TextInput id="tiAddChild_None_TextInput_01" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_None_TextInput_02" >
+        <mx:AddChild id="addChild10">
+            <mx:TextInput id="tiAddChild_None_TextInput_02" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_None_TextInput_03" >
+        <mx:AddChild id="addChild11">
+            <mx:TextInput id="tiAddChild_None_TextInput_03" />
+        </mx:AddChild>
+    </mx:State>
+
+
+<!--
+================================================================================
+targetFactory & creationPolicy
+================================================================================
+-->
+
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_None_01" >
+        <mx:AddChild id="addChild1" targetFactory="mx.controls.TextInput" creationPolicy="none" />
+    </mx:State>
+
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_None_02" >
+        <mx:AddChild id="addChild2" targetFactory="mx.controls.TextInput" creationPolicy="none" />
+    </mx:State>
+
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_None_03" >
+        <mx:AddChild id="addChild3" targetFactory="mx.controls.TextInput" creationPolicy="none" />
+    </mx:State>
+
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_Auto_01" >
+        <mx:AddChild id="addChild4" targetFactory="mx.controls.TextInput" creationPolicy="auto" />
+    </mx:State>
+
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_Auto_02" >
+        <mx:AddChild id="addChild5" targetFactory="mx.controls.TextInput" creationPolicy="auto" />
+    </mx:State>
+         
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_All_01" >
+        <mx:AddChild id="addChild6" targetFactory="mx.controls.TextInput" creationPolicy="all" />
+    </mx:State>
+
+    <mx:State name="AddChild_TargetFactory-CreationPolicy_TextInput_All_02" >
+        <mx:AddChild id="addChild7" targetFactory="mx.controls.TextInput" creationPolicy="all" />
+    </mx:State>
+
+<!--
+================================================================================
+position & relativeTo (PRT)
+================================================================================
+-->
+
+    <mx:State name="AddChild_PRT_TextInput_Default_01" >
+        <mx:AddChild id="addChild8" >
+            <mx:TextInput id="tiAddChild_PRT_TextInput_Default_01" />
+        </mx:AddChild>
+    </mx:State>
+        
+    <mx:State name="AddChild_PRT_TextInput_Before_01" >
+        <mx:AddChild position="before" relativeTo="{btn1}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_Before_01" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_Before_02" >
+        <mx:AddChild position="before" relativeTo="{box1}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_Before_02" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_Before_03" >
+        <mx:AddChild position="before" relativeTo="{btn4}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_Before_03" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_Before_04" >
+        <mx:AddChild position="before" relativeTo="{btn6}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_Before_04" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_After_01" >
+        <mx:AddChild position="after" relativeTo="{btn1}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_After_01" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_After_02" >
+        <mx:AddChild position="after" relativeTo="{box1}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_After_02" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_After_03" >
+        <mx:AddChild position="after" relativeTo="{btn4}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_After_03" />
+        </mx:AddChild>
+    </mx:State>
+    
+    <mx:State name="AddChild_PRT_TextInput_After_04" >
+        <mx:AddChild position="after" relativeTo="{btn6}">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_After_04" />
+        </mx:AddChild>
+    </mx:State>
+
+
+    <mx:State name="AddChild_PRT_TextInput_FirstChild_01" >
+        <mx:AddChild position="firstChild">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_FirstChild_01" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_FirstChild_02" >
+        <mx:AddChild position="firstChild" relativeTo="{box1}" >
+            <mx:TextInput id="tiAddChild_PRT_TextInput_FirstChild_02" />
+        </mx:AddChild>
+    </mx:State>
+
+
+    <mx:State name="AddChild_PRT_TextInput_LastChild_01" >
+        <mx:AddChild position="lastChild">
+            <mx:TextInput id="tiAddChild_PRT_TextInput_LastChild_01" />
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_PRT_TextInput_LastChild_02" >
+        <mx:AddChild position="lastChild" relativeTo="{box1}" >
+            <mx:TextInput id="tiAddChild_PRT_TextInput_LastChild_02" />
+        </mx:AddChild>
+    </mx:State>
+
+
+<!--
+================================================================================
+target
+================================================================================
+-->
+
+    <mx:State name="AddChild_Target_TextInput_01" >
+        <mx:AddChild>
+            <mx:target>
+                <mx:TextInput id="tiAddChild_Target_TextInput_01" />
+            </mx:target>
+        </mx:AddChild>
+    </mx:State>
+
+    <mx:State name="AddChild_Target_TextInput_02" >
+        <mx:AddChild>
+            <mx:target>
+                <mx:TextInput id="tiAddChild_Target_TextInput_02" />
+            </mx:target>
+        </mx:AddChild>
+    </mx:State>
+
+</mx:states>
+
+<mx:Button id="btn1" label="Control 1" />
+<mx:Button id="btn2" label="Control 2" />
+<mx:Button id="btn3" label="Control 3" />
+
+<mx:Box id="box1" borderStyle="solid" borderThickness="1">
+    <mx:Button id="btn4" label="Control 4" />
+    <mx:Button id="btn5" label="Control 5" />
+    <mx:Button id="btn6" label="Control 6" />
+</mx:Box>
+
+</mx:Application>

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/Properties/RemoveChild_Properties.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/Properties/RemoveChild_Properties.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/Properties/RemoveChild_Properties.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/Properties/RemoveChild_Properties.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="States/Flex3Syntax/RemoveChild/Properties/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="RemoveChildApp01.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+        import mx.core.Application;        
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+        <!-- The setup sets the app. to a ReinitState, then to the default state.  We need to start each
+             test in a default state, but don't know if the previous test run left us in that state or some other.
+             If it left us in the default state, then we can't reset to the default state and then wait for some 
+             event, because the app. will be in that state and no event will occur.
+             
+             We decide that a control has been added if it has a parent (instead of parent being null).
+        -->
+
+<!--
+================================================================================
+target
+================================================================================
+-->
+        <TestCase testID="RemoveChild_01" keywords="[States,AddChild]" description="Remove a control.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="RemoveChild_01" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <AssertMethodValue method="value = Application.application.confirmChildRemoval(Application.application.btn1)" value="true" />
+            </body>
+        </TestCase>
+
+        <TestCase testID="RemoveChild_02" keywords="[States,AddChild]" description="Remove a control in a container.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <RunCode code="Application.application.oldChildren = Application.application.box1.getChildren()" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="RemoveChild_02" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <AssertMethodValue method="value = Application.application.confirmChildRemoval(Application.application.btn4, Application.application.box1)" value="true" />
+            </body>
+        </TestCase>
+
+        <TestCase testID="RemoveChild_03" keywords="[States,AddChild]" description="Remove a container containing controls.">
+            <setup>
+                <SetProperty target="{Application.application}" propertyName="currentState" value="ReinitState" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+            </setup>
+            <body>
+                <RunCode code="Application.application.oldChildren = Application.application.getChildren()" />
+                <SetProperty target="{Application.application}" propertyName="currentState" value="RemoveChild_03" waitTarget="{Application.application}" waitEvent="currentStateChange" />
+                <AssertMethodValue method="value = Application.application.confirmChildRemoval(Application.application.box1)" value="true" />
+                <AssertMethodValue method="value = Application.application.confirmChildRemoval(Application.application.btn4, Application.application.box1)" value="false" />
+                <AssertMethodValue method="value = Application.application.confirmChildRemoval(Application.application.btn5, Application.application.box1)" value="false" />
+                <AssertMethodValue method="value = Application.application.confirmChildRemoval(Application.application.btn6, Application.application.box1)" value="false" />
+            </body>
+        </TestCase>
+	</testCases>                	     
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/SWFs/RemoveChildApp01.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/SWFs/RemoveChildApp01.mxml?rev=1369998&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/SWFs/RemoveChildApp01.mxml (added)
+++ incubator/flex/trunk/mustella/tests/States/Flex3Syntax/RemoveChild/SWFs/RemoveChildApp01.mxml Mon Aug  6 20:42:44 2012
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<mx:Application backgroundColor="0xFFFFFF"  width="800" height="600" xmlns:mx="http://www.adobe.com/2006/mxml" >
+
+<mx:Script>
+<![CDATA[
+
+    import mx.core.*;
+
+    public var oldChildren:Array;
+
+    public function confirmChildRemoval(control:UIComponent, container:Container = null):Boolean{
+        var ret:Boolean = false;
+        var newChildren:Array;
+        var i:int;
+
+		// Be sure there is no parent.
+		if(!control.parent){
+	        
+	        if(container)
+	        	newChildren = container.getChildren();
+	        else
+	        	newChildren = getChildren();
+	
+			// Confirm before and up to the control.
+			for(i = 0; i < oldChildren.length; ++i){
+				if(oldChildren[i] != newChildren[i] || oldChildren[i] === control){
+					ret = true;
+					break;
+				}
+	        }
+	        
+	        // Confirm after the control.
+   			for(; i < oldChildren.length; ++i){
+   				if(oldChildren[i + 1] != newChildren[i]){
+   					ret = false;
+   					break;
+   				}
+   			}
+
+	 	}
+
+		return ret;
+    }
+]]>
+</mx:Script>
+
+<!-- Embed fonts for cross platform compatibility of bitmap compares. -->
+<mx:Style>
+    @font-face {
+        src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
+        fontFamily: EmbeddedVerdana;
+			embedAsCFF: false;
+    }
+
+    @font-face {
+        src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
+        fontWeight: bold;
+        fontFamily: EmbeddedVerdana;
+			embedAsCFF: false;
+    }
+
+    @font-face {
+        src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
+        fontStyle: italic;
+        fontFamily: EmbeddedVerdana;
+			embedAsCFF: false;
+    }
+    
+    global{
+        fontFamily: EmbeddedVerdana;
+        fontAntiAliasType: normal;
+    }
+</mx:Style>
+
+<mx:states>
+    <mx:State name="ReinitState" />
+
+    <mx:State name="RemoveChild_01" >
+        <mx:RemoveChild target="{btn1}" />
+    </mx:State>
+
+    <mx:State name="RemoveChild_02" >
+        <mx:RemoveChild target="{btn4}" />
+    </mx:State>
+
+    <mx:State name="RemoveChild_03" >
+        <mx:RemoveChild target="{box1}" />
+    </mx:State>
+
+</mx:states>
+
+<mx:Button id="btn1" label="Control 1" />
+<mx:Button id="btn2" label="Control 2" />
+<mx:Button id="btn3" label="Control 3" />
+
+<mx:Box id="box1" borderStyle="solid" >
+    <mx:Button id="btn4" label="Control 4" />
+    <mx:Button id="btn5" label="Control 5" />
+    <mx:Button id="btn6" label="Control 6" />
+</mx:Box>
+
+</mx:Application>



Mime
View raw message