| <?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.IResourceManager; |
| import mx.resources.ResourceManager; |
| |
| private var resourceManager:IResourceManager = ResourceManager.getInstance(); |
| |
| public function testGetBoolean(key:String, expectedValue:Boolean, locale:String = null):Boolean |
| { |
| return resourceManager.getBoolean('myResources', key, locale) === expectedValue; |
| } |
| |
| ]]></mx:Script> |
| |
| <testCases> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_NO_SUCH_KEY" description="Tests that the getBoolean() method of ResourceManager throws an Error when accessing a non-existent resource" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('NO_SUCH_KEY', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING" description="Tests the getBoolean() method of ResourceManager for a resource value which is a typical String" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_LIST" description="Tests the getBoolean() method of ResourceManager for a resource value which is a typical String of comma-separated items" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_LIST', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_EMPTY" description="Tests the getBoolean() method of ResourceManager for a resource value which is an empty String" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_EMPTY', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_NULL" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'null'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_NULL', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_UNDEFINED" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'undefined'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_UNDEFINED', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_TRUE_LOWERCASE" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'true'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_TRUE_LOWERCASE', true)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_TRUE_MIXEDCASE" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'True'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_TRUE_MIXEDCASE', true)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_TRUE_UPPERCASE" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'TRUE'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_TRUE_UPPERCASE', true)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_FALSE_LOWERCASE" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'false'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_FALSE_LOWERCASE', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_FALSE_MIXEDCASE" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'False'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_FALSE_MIXEDCASE', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_FALSE_UPPERCASE" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'FALSE'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_FALSE_UPPERCASE', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_NAN" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String 'NaN'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_NAN', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_ZERO" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String '0'" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_ZERO', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_POSITIVE_INTEGER" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String rep of a typical positive integer" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_POSITIVE_INTEGER', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_NEGATIVE_INTEGER" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String rep of a typical negative integer" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_NEGATIVE_INTEGER', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_FIXEDPOINT" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String rep of a typical fractional Number" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_FIXEDPOINT', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_STRING_FLOATINGPOINT" description="Tests the getBoolean() method of ResourceManager for a resource value which is the String rep of a typical fractional Number in exponential notation" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('STRING_FLOATINGPOINT', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_NULL" description="Tests the getBoolean() method of ResourceManager for a resource value which is null" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('NULL', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_UNDEFINED" description="Tests the getBoolean() method of ResourceManager for a resource value which is undefined" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('UNDEFINED', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_TRUE" description="Tests the getBoolean() method of ResourceManager for a resource value which is true" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('TRUE', true)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_FALSE" description="Tests the getBoolean() method of ResourceManager for a resource value which is false" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('FALSE', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_NAN" description="Tests the getBoolean() method of ResourceManager for a resource value which is NaN" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('NAN', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_ZERO" description="Tests the getBoolean() method of ResourceManager for a resource value which is 0" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('ZERO', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_POSITIVE_INTEGER" description="Tests the getBoolean() method of ResourceManager for a resource value which is a typical positive integer" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('POSITIVE_INTEGER', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_NEGATIVE_INTEGER" description="Tests the getBoolean() method of ResourceManager for a resource value which is a typical negative integer" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('NEGATIVE_INTEGER', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_FIXEDPOINT" description="Tests the getBoolean() method of ResourceManager for a resource value which is a typical fractional Number" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('FIXEDPOINT', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_FLOATINGPOINT" description="Tests the getBoolean() method of ResourceManager for a resource value which is a typical fractional Number in exponential notation" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('FLOATINGPOINT', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_CLASS" description="Tests the getBoolean() method of ResourceManager for a resource value which is a Class reference" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('CLASS', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_ARRAY" description="Tests the getBoolean() method of ResourceManager for a resource value which is an Array of Strings" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('ARRAY', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_OBJECT" description="Tests the getBoolean() method of ResourceManager for a resource value which is a plain Object" keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=testGetBoolean('OBJECT', false)" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_localeParam_firstInLocaleChain_true" description="Tests the getBoolean() method of ResourceManager for the ability to specify the locale." keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <RunCode code="ResourceManager.getInstance().localeChain=['fr_FR','ja_JP']" /> |
| <AssertMethodValue method="value=testGetBoolean('TRUE', true, 'fr_FR')" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_localeParam_firstInLocaleChain_false" description="Tests the getBoolean() method of ResourceManager for the ability to specify the locale." keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <RunCode code="ResourceManager.getInstance().localeChain=['fr_FR','ja_JP']" /> |
| <AssertMethodValue method="value=testGetBoolean('FALSE', false, 'fr_FR')" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_localeParam_notFirstInLocaleChain_true" description="Tests the getBoolean() method of ResourceManager for the ability to specify the locale." keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <RunCode code="ResourceManager.getInstance().localeChain=['fr_FR','ja_JP']" /> |
| <AssertMethodValue method="value=testGetBoolean('TRUE', true, 'ja_JP')" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_localeParam_notFirstInLocaleChain_false" description="Tests the getBoolean() method of ResourceManager for the ability to specify the locale." keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <RunCode code="ResourceManager.getInstance().localeChain=['fr_FR','ja_JP']" /> |
| <AssertMethodValue method="value=testGetBoolean('FALSE', false, 'ja_JP')" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| |
| <TestCase frequency="all" testID="ResourceManager_getBoolean_localeParam_localeMissing" description="Tests the getBoolean() method of ResourceManager for the ability to specify the locale." keywords="[resources,ResourceManager,getBoolean]"> |
| <setup> |
| <RunCode code="application.setup()"/> |
| </setup> |
| <body> |
| <RunCode code="ResourceManager.getInstance().localeChain=['fr_FR','ja_JP']" /> |
| <AssertMethodValue method="value=testGetBoolean('TRUE', false, 'fu_BR')" value="true"/> |
| <Pause timeout="1"/> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |
| |