| <?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="resources/ResourceManager/Methods/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ResourceManagerApp.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.resources.ResourceManager; |
| |
| import mx.resources.IResourceManager; |
| |
| import mx.resources.ResourceBundle; |
| |
| ]]></mx:Script> |
| |
| |
| |
| <testCases> |
| |
| |
| |
| <TestCase frequency="all" testID="RTL_ResourceManager_Method_getLocales_OneLocale" description="Call getLocales() with 1 locale." keywords="[Runtime Localization,ResourceManager,getLocales]" > |
| |
| <setup> |
| |
| <RunCode code="application.clearLocales()" /> |
| |
| <RunCode code="application.doAddResourceBundle('fr_FR', 'bundle1')" /> |
| |
| </setup> |
| |
| <body> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length" value="1" /> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('fr_FR')" value="0" /> |
| |
| <Pause timeout="1" /> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <TestCase frequency="all" testID="RTL_ResourceManager_Method_getLocales_ThreeLocales" description="Call getLocales() with 3 locales." keywords="[Runtime Localization,ResourceManager,getLocales]" > |
| |
| <setup> |
| |
| <RunCode code="application.clearLocales()" /> |
| |
| <RunCode code="application.doAddResourceBundle('fr_FR', 'bundle1')" /> |
| |
| <RunCode code="application.doAddResourceBundle('en_US', 'bundle1')" /> |
| |
| <RunCode code="application.doAddResourceBundle('ja_JP', 'bundle1')" /> |
| |
| </setup> |
| |
| <body> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length" value="3" /> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('fr_FR') != -1" valueExpression="value=true" /> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('en_US') != -1" valueExpression="value=true" /> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('ja_JP') != -1" valueExpression="value=true" /> |
| |
| <Pause timeout="1" /> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <TestCase frequency="all" testID="RTL_ResourceManager_Method_getLocales_NoLocales" description="Call getLocales() with no locales." keywords="[Runtime Localization,ResourceManager,getLocales]" > |
| |
| <setup> |
| |
| <RunCode code="application.clearLocales()" /> |
| |
| </setup> |
| |
| <body> |
| |
| <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length" value="0" /> |
| |
| <Pause timeout="1" /> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| </testCases> |
| |
| </UnitTester> |