You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Frédéric THOMAS (JIRA)" <ji...@apache.org> on 2012/11/07 00:16:12 UTC

[jira] [Commented] (FLEX-33242) Mustella tests failed: when your computer language doesn't match the expected localized error

    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491940#comment-13491940 ] 

Frédéric THOMAS commented on FLEX-33242:
----------------------------------------

As example: 

		<TestCase frequency="all" testID="Locale_country_is_read_only" description="Confirm that 'country' property of Locale is read-only" keywords="[resources,Locale,country]">
			<setup>
				<RunCode code="locale = new Locale('fr_FR_WIN')"/>
			</setup>
			<body>
				<SetProperty target="script:locale" propertyName="country" value="DE"/>
				<AssertError value="ReferenceError: Error #1074: Illegal write to read-only property country on mx.resources.Locale."/>
				<Pause timeout="1"/>
			</body>
		</TestCase>

In this case, the locale is set to french but the AssertError value is expected to be in english, one solution could be to set the expected error value to be in french but we don't want test the locale capabilities here, we test read-only country property.

The solution would be to be able to do such:

<TestCase frequency="all" testID="Locale_country_is_read_only" description="Confirm that 'country' property of Locale is read-only" keywords="[resources,Locale,country]">
			<setup>
				<RunCode code="locale = new Locale('fr_FR_WIN')"/>
			</setup>
			<body>
				<SetProperty target="script:locale" propertyName="country" value="DE"/>
				<AssertError value="{['ReferenceError: Error #1074:', 'country', 'mx.resources.Locale']}"/>
				<Pause timeout="1"/>
			</body>
		</TestCase>

Doing so it means AssertError will test that the returning error message should contain all of the elements of the array, stripping out the french part of the error message.

An other one :

<TestCase testID="hostComponent_none" keywords="[States]" description="Verify that there is no hostComponent property in a custom skin if the skin does not contain that metadata.">
    <setup>
        <ResetComponent target="sc2" className="assets.SkinnedMXMLComponent2" waitEvent="updateComplete" />
    </setup>
    <body>
        <AssertMethodValue method="try{application.sc2.skin.hostComponent}catch(e:Error){value = e.toString()}" value="ReferenceError: Error #1069: Property hostComponent not found on assets.HostlessSkin and there is no default value." />
    </body>
</TestCase>

In this case no locale has been set but my computer is in french, the raised error will output a error mesage in french whereas an english one is expected.



What I'm proposing is that the value could take a string as parameter and acts as it acts now (it should return the exact value) or could take an array (which means, it should contain all of the elements of the array).
                
> Mustella tests failed: when your computer language doesn't match the expected localized error
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33242
>                 URL: https://issues.apache.org/jira/browse/FLEX-33242
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Mustella
>    Affects Versions: Apache Flex 4.9.0
>            Reporter: Frédéric THOMAS
>            Priority: Critical
>              Labels: test
>         Attachments: FLEX-33242.patch
>
>
> Mustella tests fail when your computer language doesn't match the expected localized error

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira