| <?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="SparkModules/SubModules/Integration/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="*" |
| |
| testSWF="SubModuleTest_basic3.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; |
| |
| import mx.managers.SystemManager; |
| |
| |
| |
| public var subAppRef2:SystemManager; |
| |
| 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="subAppWithSubModule_test1" keywords="[SubApplication, SubModule, ModuleLoader]" description="swfLoader=>subapp=>moduleLoader=>module1(moduleLoaderr)=>submodule1(by moduleLoader);load a sub application which loads module, module loads a subModule which is loaded by moduleLoader" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');" waitTarget="" waitEvent="SWFLoaded" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" /> |
| |
| <WaitForLayoutManager /> |
| |
| <SetProperty target="subAppRef.document.dg" propertyName="selectedIndex" value="0" /> |
| |
| </setup> |
| |
| <body> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module1.swf')" |
| waitEvent="ready" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.loadModule1()" |
| waitEvent="ready" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1.child.subModuleLoader1" /> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.subModuleLoader1.child.label1" value="SubModuleWithLabel loaded"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| |
| |
| <TestCase testID="subAppWithSubModule_test2" keywords="[SubApplication, SubModule, ModuleLoader]" description="swfLoader=>subApp=>moduleLoader=>Module1(moduleLoader)=>submodule1(by moduleManager):load a sub application,the subapp loads a module through moduleLoader, a submodule is loaded ModuleManager" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');" waitTarget="" waitEvent="SWFLoaded" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" /> |
| |
| <WaitForLayoutManager /> |
| |
| <SetProperty target="subAppRef.document.dg" propertyName="selectedIndex" value="1" /> |
| |
| </setup> |
| |
| <body> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module6.swf')" |
| waitEvent="ready" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.loadModule1()" |
| waitEvent="moduleLoaded" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1.child" /> |
| |
| <WaitForEvent eventName="moduleLoaded" target="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1.child.subModuleLoader1.child" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.subModuleLoader1.child.addNumbers(5,7)"/> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.subModuleLoader1.child.label1" value="12"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| |
| |
| |
| |
| <TestCase testID="subAppWithSubModule_test3" keywords="[SubApplication,SubModule, ModuleLoader]" description="swfLoader=>subApp=>moduleLoader=>Module1(ModuleManager)=>subModule(ModuleLoader):load a sub application, which loads module, the module loads a subModule" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');" waitTarget="" waitEvent="SWFLoaded" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" /> |
| |
| <WaitForLayoutManager /> |
| |
| <SetProperty target="subAppRef.document.dg" propertyName="selectedIndex" value="2" /> |
| |
| </setup> |
| |
| <body> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module4.swf')" |
| waitEvent="moduleLoaded" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document" /> |
| |
| <WaitForEvent eventName="moduleLoaded" target="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1.child" /> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.ccm.label1" value="SubModuleWithLabel loaded"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| <TestCase testID="subAppWithSubModule_test4" keywords="[SubApplication, SubModule, ModuleLoader]" description="swfLoader=>subApp=>moduleLoader=>Module1(Modulemanager)=>subModule(ModuleManager):load a sub application which loads module created in moduleManager, subModule is loaded by using ModuleLoader" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadContent('assets/SubApp1.swf');" waitTarget="" waitEvent="SWFLoaded" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.resetModuleLoader()" /> |
| |
| <WaitForLayoutManager /> |
| |
| <SetProperty target="subAppRef.document.dg" propertyName="selectedIndex" value="3" /> |
| |
| </setup> |
| |
| <body> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.loadModule('assets/Module5.swf')" |
| waitEvent="ready" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.subAppRef.document.moduleLoader1"/> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.moduleLoader1.child.vg.getChildAt(0).addNumbers(5,7)"/> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="subAppRef.document.moduleLoader1.child.vg.getChildAt(0).label1" value="12"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.subAppRef.document.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| |
| |
| <TestCase testID="subAppWithSubModule_test5" keywords="[ModuleLoader, SubApplication, SubModule]" description="moduleLoader=>module=>subapp=>module(moduleLoader):a moduleLoader loads a module, the module has sub application, subapp loads a module by using moduleLoader,loading is done automatically without user interaction" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadModule('assets/ModuleLoadSubApp3.swf');" waitTarget="" waitEvent="moduleLoaded" /> |
| |
| <WaitForEvent eventName="SWFLoaded" target="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.moduleLoader1.child" /> |
| |
| </setup> |
| |
| <body> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.label1" value="SubModuleWithLabel loaded"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <TestCase testID="subAppWithSubModule_test6" keywords="[ModuleLoader, SubApplication, SubModule]" description="moduleLoader=>module=>subapp=>module(moduleLoader):a moduleLoader loads a module, the module loads a sub application, the subapp loads module which uses moduleLoader" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadModule('assets/ModuleLoadSubApp2.swf');" waitTarget="" waitEvent="moduleLoaded" /> |
| |
| <WaitForEvent eventName="SWFLoaded" target="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.moduleLoader1.child" /> |
| |
| </setup> |
| |
| <body> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.loadModule('assets/TitleWindowModule.swf')" |
| waitEvent="moduleLoaded" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.moduleLoader1.child.subAppRef.document" /> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.tw.label1" value="SimpleTitleWindow loaded"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.moduleLoader1.unloadModule()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <TestCase testID="subAppWithSubModule_test7" keywords="[ModuleLoader, SubApplication, SubModule]" description="moduleLoader=>module=>subapp=>module(moduleManager):a moduleLoader loads a module through ModuleLoader, the module loads a sub application, the subapp loads module which uses moduleManager" > |
| |
| <setup> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.resetModuleLoader()"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.loadModule('assets/ModuleLoadSubApp2.swf');" waitTarget="" waitEvent="moduleLoaded" /> |
| |
| <WaitForEvent eventName="SWFLoaded" target="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.moduleLoader1.child" /> |
| </setup> |
| |
| <body> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.loadModule('assets/SimpleASModuleTest.swf')" |
| waitEvent="ready" waitTarget="systemManager.info().currentDomain.getDefinition(mx.core.FlexGlobals).topLevelApplication.moduleLoader1.child.subAppRef.document.moduleLoader1" /> |
| |
| <WaitForLayoutManager /> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.child.subAppRef.document.moduleLoader1.child.addNumbers(5,7)"/> |
| |
| <WaitForLayoutManager /> |
| |
| <AssertPropertyValue propertyName="text" target="moduleLoader1.child.subAppRef.document.moduleLoader1.child.label1" value="12"/> |
| |
| <RunCode code="FlexGlobals.topLevelApplication.moduleLoader1.unloadModule()"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| </testCases> |
| |
| |
| |
| </UnitTester> |