| <?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="Modules/SubModules/Integration/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="*" |
| testSWF="SubModuleTest_basic2.mxml"> |
| |
| <!-- this set of lines form a template that must be in each unit test --> |
| <fx:Script> |
| <![CDATA[ |
| import mx.core.FlexGlobals; |
| import mx.managers.PopUpManager; |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </fx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| |
| <testCases> |
| |
| <TestCase testID="loadSubModule_module1" keywords="[SubModule, ModuleManager]" description="load a module test using ModuleManager" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" /> |
| <SetProperty target="dg" propertyName="selectedIndex" value="0" waitEvent="valueCommit" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" /> |
| <DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" /> |
| <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.label1" value="SubModuleWithLabel loaded"/> |
| <DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" /> |
| </body> |
| </TestCase> |
| |
| |
| |
| <TestCase testID="loadSubModule_module2" keywords="[SubModule, ModuleManager]" description="load a sub module which uses PopUpManager, module is loaded by using ModuleManager" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" /> |
| <SetProperty target="dg" propertyName="selectedIndex" value="1" waitEvent="valueCommit" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" /> |
| <DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" /> |
| <Pause timeout="200"/> |
| <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.tw.label1" value="SimpleTitleWindow loaded"/> |
| <RunCode code="PopUpManager.removePopUp(FlexGlobals.topLevelApplication.moduleHolder.getChildAt(0).subModuleLoader1.child.tw);" /> |
| <DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" /> |
| </body> |
| |
| </TestCase> |
| |
| |
| <TestCase testID="loadSubModule_module3" keywords="[SubModule, ModuleManager]" description="load a mxTitleWindow content subModule, module is loaded by using ModuleManager" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" /> |
| <SetProperty target="dg" propertyName="selectedIndex" value="2" waitEvent="valueCommit" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" /> |
| <DispatchMouseClickEvent target="moduleCnt.mdBtn1" waitEvent="moduleLoaded" waitTarget="moduleHolder.getElementAt(0)" /> |
| <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).subModuleLoader1.child.mxTW.label1" value="MXTitleWindow loaded"/> |
| <DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" /> |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <TestCase testID="loadSubModule_module4" keywords="[SubModule, ModuleManager]" description="load a subModule,module is loaded by using ModuleManager" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" /> |
| <SetProperty target="dg" propertyName="selectedIndex" value="3" waitEvent="valueCommit" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" /> |
| <Pause timeout="200"/> |
| <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).ccm.label1" value="SubModuleWithLabel loaded"/> |
| <DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" /> |
| </body> |
| |
| </TestCase> |
| |
| |
| <TestCase testID="loadSubModule_module5" keywords="[SubModule, ModuleManager]" description="load a subModule,module is created in actionscript, loaded by using ModuleManager" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleHolder()" /> |
| <SetProperty target="dg" propertyName="selectedIndex" value="4" waitEvent="valueCommit" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="btn1" waitEvent="moduleLoaded" waitTarget="" /> |
| <Pause timeout="500"/> |
| <DispatchMouseClickEvent target="moduleHolder.getChildAt(0).b1" waitEvent="updateComplete" waitTarget="moduleHolder.getChildAt(0).label1" /> |
| <AssertPropertyValue propertyName="text" target="moduleHolder.getChildAt(0).label1" value="12"/> |
| <DispatchMouseClickEvent target="btn2" waitEvent="moduleRemoved" waitTarget="" /> |
| </body> |
| </TestCase> |
| |
| |
| </testCases> |
| |
| </UnitTester> |