You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/03/02 07:14:34 UTC

[11/12] git commit: [flex-asjs] [refs/heads/develop] - BasicTests needs info() structure processing bead for processing mixins

BasicTests needs info() structure processing bead for processing mixins


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

Branch: refs/heads/develop
Commit: 84b366817b88bf75e898baf07a401b23545ad423
Parents: 24d2e39
Author: Alex Harui <ah...@apache.org>
Authored: Sat Mar 1 21:27:57 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Sat Mar 1 21:29:51 2014 -0800

----------------------------------------------------------------------
 build.xml                                       |   2 +-
 .../as/projects/FlexJSUI/basic-manifest.xml     |   1 +
 .../src/org/apache/flex/core/Application.as     |  13 ++-
 .../src/org/apache/flex/utils/MixinManager.as   |  81 +++++++++++++++
 mustella/tests/basicTests/BasicTests-config.xml | 102 -------------------
 .../tests/basicTests/BasicTestsApp-config.xml   | 102 +++++++++++++++++++
 mustella/tests/basicTests/BasicTestsApp.mxml    |   9 +-
 7 files changed, 203 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index aad6e98..cbd2c0b 100644
--- a/build.xml
+++ b/build.xml
@@ -1213,7 +1213,7 @@
     <target name="basictests" depends="load-task" description="run basic tests using mustella">
 
         <property name="FLEX_HOME" value="${basedir}" />
-        <mxmlc fork="true"
+        <mxmlc fork="true" debug="true"
                file="${basedir}/mustella/tests/basicTests/BasicTestsApp.mxml">
             <jvmarg line="${mxmlc.jvm.args}"/>
             <arg line="-compiler.mxml.children-as-data=true" />

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/frameworks/as/projects/FlexJSUI/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/basic-manifest.xml b/frameworks/as/projects/FlexJSUI/basic-manifest.xml
index 7a9ace9..2708303 100644
--- a/frameworks/as/projects/FlexJSUI/basic-manifest.xml
+++ b/frameworks/as/projects/FlexJSUI/basic-manifest.xml
@@ -71,5 +71,6 @@
     <component id="NumericOnlyTextInputBead" class="org.apache.flex.html.staticControls.accessories.NumericOnlyTextInputBead" />
     <component id="PasswordInputBead" class="org.apache.flex.html.staticControls.accessories.PasswordInputBead" />
     <component id="TextPromptBead" class="org.apache.flex.html.staticControls.accessories.TextPromptBead" />
+    <component id="MixinManager" class="org.apache.flex.utils.MixinManager" />
 
 </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
index cdf3094..57f658d 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
@@ -23,6 +23,8 @@ package org.apache.flex.core
     import flash.display.StageAlign;
     import flash.display.StageScaleMode;
     import flash.events.IOErrorEvent;
+    import flash.system.ApplicationDomain;
+    import flash.utils.getQualifiedClassName;
     
     import org.apache.flex.events.Event;
     import org.apache.flex.utils.MXMLDataInterpreter;
@@ -262,6 +264,8 @@ package org.apache.flex.core
             return null;
         }
         
+        private var _info:Object;
+        
         /**
          *  An Object containing information generated
          *  by the compiler that is useful at startup time.
@@ -273,7 +277,14 @@ package org.apache.flex.core
          */
         public function get info():Object
         {
-            return {};           
+            if (!_info)
+            {
+                var mainClassName:String = getQualifiedClassName(this);
+                var initClassName:String = "_" + mainClassName + "_FlexInit";
+                var c:Class = ApplicationDomain.currentDomain.getDefinition(initClassName) as Class;
+                _info = c.info();
+            }
+            return _info;
         }
         
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MixinManager.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MixinManager.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MixinManager.as
new file mode 100644
index 0000000..b61222e
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MixinManager.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.utils
+{
+
+import flash.system.ApplicationDomain;
+
+import org.apache.flex.core.IBead;
+import org.apache.flex.core.IFlexInfo;
+import org.apache.flex.core.IStrand;
+
+/**
+ *  The MixinManager class is the class that instantiates mixins
+ *  linked into the application.  Mixins are classes with [Mixin]
+ *  metadata and are often linked in via the -includes option.
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 10.2
+ *  @playerversion AIR 2.6
+ *  @productversion FlexJS 0.0
+ */
+public class MixinManager implements IBead
+{
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public function MixinManager()
+    {
+        super();
+    }
+    	
+    private var _strand:IStrand;
+    
+    /**
+     *  @copy org.apache.flex.core.IBead#strand
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public function set strand(value:IStrand):void
+    {
+        _strand = value;
+        
+        var app:IFlexInfo = value as IFlexInfo;
+        if (app)
+        {
+            var mixins:Array = app.info.mixins;
+            var domain:ApplicationDomain = app.info.currentDomain;
+            for each (var mixin:String in mixins)
+            {
+                var mixinClass:Object = domain.getDefinition(mixin); 
+                mixinClass.init(value);
+            }
+        }
+    }    
+   
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/mustella/tests/basicTests/BasicTests-config.xml
----------------------------------------------------------------------
diff --git a/mustella/tests/basicTests/BasicTests-config.xml b/mustella/tests/basicTests/BasicTests-config.xml
deleted file mode 100644
index e87fca1..0000000
--- a/mustella/tests/basicTests/BasicTests-config.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.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.
-
--->
-<flex-config>
-    <compiler>
-	    <debug>true</debug>
-    </compiler>
-    <includes>
-    <!--
-    -->
-        <symbol>halo.scripts.ButtonTestScript</symbol>
-        <symbol>halo.scripts.CheckBoxTestScript</symbol>
-        <symbol>halo.scripts.RadioButtonTestScript</symbol>
-        <symbol>halo.scripts.TextInputTestScript</symbol>
-        <symbol>halo.scripts.TextAreaTestScript</symbol>
-        <symbol>halo.scripts.ComboBoxTestScript</symbol>
-        <!--<symbol>halo.scripts.ColorPickerTestScript</symbol>-->
-        <symbol>halo.scripts.NumericStepperTestScript</symbol>
-        <!--<symbol>halo.scripts.DateFieldTestScript</symbol>-->
-        <!--<symbol>halo.scripts.MenuTestScript</symbol>-->
-        <!--<symbol>halo.scripts.MenuBarTestScript</symbol>-->
-        <!--<symbol>halo.scripts.FocusManagerTestScript</symbol>-->
-        <symbol>halo.scripts.ListAndDataGridTestScript</symbol>
-        <!--<symbol>halo.scripts.TreeTestScript</symbol>-->
-        <symbol>halo.scripts.ImageTestScript</symbol>
-        <!--<symbol>halo.scripts.SWFLoaderTestScript</symbol>-->
-        <symbol>halo.scripts.TextTestScript</symbol>
-        <!--<symbol>halo.scripts.FTETextTestScript</symbol>-->
-        <!--<symbol>halo.scripts.ProgressBarTestScript</symbol>-->
-        <symbol>halo.scripts.SliderTestScript</symbol>
-        <symbol>halo.scripts.AlertTestScript</symbol>
-        <!--<symbol>halo.scripts.TabNavigatorTestScript</symbol>-->
-        <!--<symbol>halo.scripts.AccordionTestScript</symbol>-->
-        <!--<symbol>halo.scripts.RPCDataBindingTestScript</symbol>-->
-        <!--<symbol>halo.scripts.CollectionTestScript</symbol>-->
-        <!--<symbol>spark.scripts.ListDragDropTestScript</symbol>-->
-        <!--<symbol>halo.scripts.MXItemRendererTestScript</symbol>-->
-        <!--<symbol>spark.scripts.BorderContainerTestScript</symbol>-->
-        <!--<symbol>spark.scripts.ButtonTestScript</symbol>-->
-        <!--<symbol>spark.scripts.CheckBoxTestScript</symbol>-->
-        <!--<symbol>spark.scripts.EasingTestScript</symbol>-->
-        <!--<symbol>spark.scripts.RadioButtonTestScript</symbol>-->
-        <!--<symbol>spark.scripts.TextInputTestScript</symbol>-->
-        <!--<symbol>spark.scripts.TextAreaTestScript</symbol>-->
-        <!--<symbol>spark.scripts.DesignLayerTestScript</symbol>-->
-        <!--<symbol>spark.scripts.ComboBoxTestScript</symbol>-->
-        <!--<symbol>spark.scripts.DropDownListTestScript</symbol>-->
-        <!--<symbol>spark.scripts.FormTestScript</symbol>-->
-        <!--<symbol>spark.scripts.NumericStepperTestScript</symbol>-->
-        <!--<symbol>spark.scripts.SliderTestScript</symbol>-->
-        <!--<symbol>spark.scripts.ScrollBarTestScript</symbol>-->
-        <!--<symbol>spark.scripts.DeferredInstantiationTestScript</symbol>-->
-        <!--<symbol>spark.scripts.LayoutDirectionTestScript</symbol>-->
-        <!--<symbol>spark.scripts.LayoutTestScript</symbol>-->
-        <!--<symbol>spark.scripts.PanelControlBarTestScript</symbol>-->
-        <!--<symbol>spark.scripts.ButtonBarTestScript</symbol>-->
-        <!--<symbol>spark.scripts.TileGroupTestScript</symbol>-->
-        <!--<symbol>spark.scripts.TitleWindowTestScript</symbol>-->
-        <!--<symbol>graphics.scripts.GraphicsTagsTestScript</symbol>-->
-        <!--<symbol>fxg.scripts.FXGCompileTestScript</symbol>-->
-        <!--<symbol>fxg.scripts.FXG2CompileTestScript</symbol>-->
-        <!--<symbol>spark.scripts.StyleManagerTestScript</symbol>-->
-	    <!--<symbol>spark.scripts.FXG2RuntimeTestScript</symbol>-->
-	    <!--<symbol>dmv.scripts.ADGTestScript</symbol>-->
-	    <!--<symbol>dmv.scripts.ODGTestScript</symbol>-->
-	    <symbol>dmv.scripts.ChartsTestScript</symbol>	
-        <!--<symbol>spark.scripts.AnimateConstraintsTestScript</symbol>-->
-        <!--<symbol>spark.scripts.ImageTestScript</symbol>-->
-        <!--<symbol>spark.scripts.DateTimeFormatterTestScript</symbol>-->
-        <!--<symbol>spark.scripts.AdvancedStyleClientTestScript</symbol>-->
-        <!--<symbol>spark.scripts.NumberFormatterTestScript</symbol>-->
-        <!--<symbol>spark.scripts.StringToolsTestScript</symbol>-->
-        <!--<symbol>spark.scripts.CollatorTestScript</symbol>-->
-        <!--<symbol>spark.scripts.CurrencyFormatterTestScript</symbol>-->
-        <!--<symbol>spark.scripts.DataGridTestScript</symbol>-->
-		<!--<symbol>spark.scripts.CurrencyValidatorTestScript</symbol>-->
-        <!--<symbol>spark.scripts.NumberValidatorTestScript</symbol>-->
-	<!--<symbol>spark.scripts.SortTestScript</symbol>-->
-    <!--
-        From mustella.swc
-    -->
-        <symbol>ExitWhenDone</symbol>
-        <symbol>SetShowRTE</symbol>
-        <symbol>SendFormattedResultsToLog</symbol>
-    </includes>
-</flex-config>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/mustella/tests/basicTests/BasicTestsApp-config.xml
----------------------------------------------------------------------
diff --git a/mustella/tests/basicTests/BasicTestsApp-config.xml b/mustella/tests/basicTests/BasicTestsApp-config.xml
new file mode 100644
index 0000000..e87fca1
--- /dev/null
+++ b/mustella/tests/basicTests/BasicTestsApp-config.xml
@@ -0,0 +1,102 @@
+<?xml version="1.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.
+
+-->
+<flex-config>
+    <compiler>
+	    <debug>true</debug>
+    </compiler>
+    <includes>
+    <!--
+    -->
+        <symbol>halo.scripts.ButtonTestScript</symbol>
+        <symbol>halo.scripts.CheckBoxTestScript</symbol>
+        <symbol>halo.scripts.RadioButtonTestScript</symbol>
+        <symbol>halo.scripts.TextInputTestScript</symbol>
+        <symbol>halo.scripts.TextAreaTestScript</symbol>
+        <symbol>halo.scripts.ComboBoxTestScript</symbol>
+        <!--<symbol>halo.scripts.ColorPickerTestScript</symbol>-->
+        <symbol>halo.scripts.NumericStepperTestScript</symbol>
+        <!--<symbol>halo.scripts.DateFieldTestScript</symbol>-->
+        <!--<symbol>halo.scripts.MenuTestScript</symbol>-->
+        <!--<symbol>halo.scripts.MenuBarTestScript</symbol>-->
+        <!--<symbol>halo.scripts.FocusManagerTestScript</symbol>-->
+        <symbol>halo.scripts.ListAndDataGridTestScript</symbol>
+        <!--<symbol>halo.scripts.TreeTestScript</symbol>-->
+        <symbol>halo.scripts.ImageTestScript</symbol>
+        <!--<symbol>halo.scripts.SWFLoaderTestScript</symbol>-->
+        <symbol>halo.scripts.TextTestScript</symbol>
+        <!--<symbol>halo.scripts.FTETextTestScript</symbol>-->
+        <!--<symbol>halo.scripts.ProgressBarTestScript</symbol>-->
+        <symbol>halo.scripts.SliderTestScript</symbol>
+        <symbol>halo.scripts.AlertTestScript</symbol>
+        <!--<symbol>halo.scripts.TabNavigatorTestScript</symbol>-->
+        <!--<symbol>halo.scripts.AccordionTestScript</symbol>-->
+        <!--<symbol>halo.scripts.RPCDataBindingTestScript</symbol>-->
+        <!--<symbol>halo.scripts.CollectionTestScript</symbol>-->
+        <!--<symbol>spark.scripts.ListDragDropTestScript</symbol>-->
+        <!--<symbol>halo.scripts.MXItemRendererTestScript</symbol>-->
+        <!--<symbol>spark.scripts.BorderContainerTestScript</symbol>-->
+        <!--<symbol>spark.scripts.ButtonTestScript</symbol>-->
+        <!--<symbol>spark.scripts.CheckBoxTestScript</symbol>-->
+        <!--<symbol>spark.scripts.EasingTestScript</symbol>-->
+        <!--<symbol>spark.scripts.RadioButtonTestScript</symbol>-->
+        <!--<symbol>spark.scripts.TextInputTestScript</symbol>-->
+        <!--<symbol>spark.scripts.TextAreaTestScript</symbol>-->
+        <!--<symbol>spark.scripts.DesignLayerTestScript</symbol>-->
+        <!--<symbol>spark.scripts.ComboBoxTestScript</symbol>-->
+        <!--<symbol>spark.scripts.DropDownListTestScript</symbol>-->
+        <!--<symbol>spark.scripts.FormTestScript</symbol>-->
+        <!--<symbol>spark.scripts.NumericStepperTestScript</symbol>-->
+        <!--<symbol>spark.scripts.SliderTestScript</symbol>-->
+        <!--<symbol>spark.scripts.ScrollBarTestScript</symbol>-->
+        <!--<symbol>spark.scripts.DeferredInstantiationTestScript</symbol>-->
+        <!--<symbol>spark.scripts.LayoutDirectionTestScript</symbol>-->
+        <!--<symbol>spark.scripts.LayoutTestScript</symbol>-->
+        <!--<symbol>spark.scripts.PanelControlBarTestScript</symbol>-->
+        <!--<symbol>spark.scripts.ButtonBarTestScript</symbol>-->
+        <!--<symbol>spark.scripts.TileGroupTestScript</symbol>-->
+        <!--<symbol>spark.scripts.TitleWindowTestScript</symbol>-->
+        <!--<symbol>graphics.scripts.GraphicsTagsTestScript</symbol>-->
+        <!--<symbol>fxg.scripts.FXGCompileTestScript</symbol>-->
+        <!--<symbol>fxg.scripts.FXG2CompileTestScript</symbol>-->
+        <!--<symbol>spark.scripts.StyleManagerTestScript</symbol>-->
+	    <!--<symbol>spark.scripts.FXG2RuntimeTestScript</symbol>-->
+	    <!--<symbol>dmv.scripts.ADGTestScript</symbol>-->
+	    <!--<symbol>dmv.scripts.ODGTestScript</symbol>-->
+	    <symbol>dmv.scripts.ChartsTestScript</symbol>	
+        <!--<symbol>spark.scripts.AnimateConstraintsTestScript</symbol>-->
+        <!--<symbol>spark.scripts.ImageTestScript</symbol>-->
+        <!--<symbol>spark.scripts.DateTimeFormatterTestScript</symbol>-->
+        <!--<symbol>spark.scripts.AdvancedStyleClientTestScript</symbol>-->
+        <!--<symbol>spark.scripts.NumberFormatterTestScript</symbol>-->
+        <!--<symbol>spark.scripts.StringToolsTestScript</symbol>-->
+        <!--<symbol>spark.scripts.CollatorTestScript</symbol>-->
+        <!--<symbol>spark.scripts.CurrencyFormatterTestScript</symbol>-->
+        <!--<symbol>spark.scripts.DataGridTestScript</symbol>-->
+		<!--<symbol>spark.scripts.CurrencyValidatorTestScript</symbol>-->
+        <!--<symbol>spark.scripts.NumberValidatorTestScript</symbol>-->
+	<!--<symbol>spark.scripts.SortTestScript</symbol>-->
+    <!--
+        From mustella.swc
+    -->
+        <symbol>ExitWhenDone</symbol>
+        <symbol>SetShowRTE</symbol>
+        <symbol>SendFormattedResultsToLog</symbol>
+    </includes>
+</flex-config>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/84b36681/mustella/tests/basicTests/BasicTestsApp.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/basicTests/BasicTestsApp.mxml b/mustella/tests/basicTests/BasicTestsApp.mxml
index fa1f8cd..c2fe853 100644
--- a/mustella/tests/basicTests/BasicTestsApp.mxml
+++ b/mustella/tests/basicTests/BasicTestsApp.mxml
@@ -35,8 +35,11 @@ limitations under the License.
     </basic:model>
     <basic:controller>
         <controllers:MyController />
-    </basic:controller>
+    </basic:controller>    
+    -->
     <basic:beads>
+        <basic:MixinManager />
+        <!--
         <basic:HTTPService id="service">
             <basic:LazyCollection id="collection">
                 <basic:inputParser>
@@ -47,7 +50,7 @@ limitations under the License.
                 </basic:itemConverter> 
             </basic:LazyCollection>
         </basic:HTTPService>
-        <basic:ViewSourceContextMenuOption />
-    </basic:beads>
+        <basic:ViewSourceContextMenuOption />    
     -->
+    </basic:beads>
 </basic:Application>
\ No newline at end of file