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/06 23:08:12 UTC

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

Frédéric THOMAS created FLEX-33242:
--------------------------------------

             Summary: 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


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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495037#comment-13495037 ] 

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

Well, I'm a bit perplex with one of the issues, as I said, my OS is in french, when I run the 2 first tests in RuntimeLocalization\RTL_SparkSkin\Integration\RTL_Compiler_LocaleParams_2_Tester :

        <TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body>
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="{['en_US','fr_FR','ja_JP']}" />
                <Pause timeout="1" />
            </body>
        </TestCase>

        <TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_NOT_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body>
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="{['en_US','fr_FR','ja_JP']}" />
                <Pause timeout="1" />
            </body>
        </TestCase>

The second one fails :

[java] RuntimeLocalization/RTL_SparkSkin/Integration/RTL_Compiler_LocaleParams_2_Tester RTL_Compiler_LocaleParams_1
_LocaleChain_NOT_AIR_Mac Failed AssertMethodValue (method cannot be shown)(body:step 1)  method returned fr_FR,en_US,ja_
JP, expected en_US,fr_FR,ja_JP

But the first one pass and I can't see the difference, I could make the test pass with my patch but I'm not sure if I have to do that, then at the moment I won't, especially because this test conatins weird things as well, I'm gonna open.

Otherwize, for this patch, everything goes well, just need to refactor it, it doesn't please me how I wrote it.
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frédéric THOMAS updated FLEX-33242:
-----------------------------------

    Attachment:     (was: FLEX-33242.patch)
    
> 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
>
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frédéric THOMAS updated FLEX-33242:
-----------------------------------

    Attachment: FLEX-33242.patch

This patch works for for me, but because they are other kinds of issues, I would like to fix them before this pach been applied, it can be reviewed anyway
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495037#comment-13495037 ] 

Frédéric THOMAS edited comment on FLEX-33242 at 11/11/12 11:17 PM:
-------------------------------------------------------------------

Well, I'm a bit perplex with one of the issues, as I said, my OS is in french, when I run the 2 first tests in RuntimeLocalization\RTL_SparkSkin\Integration\RTL_Compiler_LocaleParams_2_Tester :

        <TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body>
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="{['en_US','fr_FR','ja_JP']}" />
                <Pause timeout="1" />
            </body>
        </TestCase>

        <TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_NOT_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body>
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="{['en_US','fr_FR','ja_JP']}" />
                <Pause timeout="1" />
            </body>
        </TestCase>

The second one fails :

[java] RuntimeLocalization/RTL_SparkSkin/Integration/RTL_Compiler_LocaleParams_2_Tester RTL_Compiler_LocaleParams_1
_LocaleChain_NOT_AIR_Mac Failed AssertMethodValue (method cannot be shown)(body:step 1)  method returned fr_FR,en_US,ja_
JP, expected en_US,fr_FR,ja_JP

But the first one pass and I can't see the difference, I could make the test pass with my patch but I'm not sure if I have to do that, then at the moment I won't, especially because this test contains weird things as well, I'm gonna open a bug for it.

Otherwize, for this patch, everything goes well, just need to refactor it, it doesn't please me how I wrote it.
                
      was (Author: doublefx):
    Well, I'm a bit perplex with one of the issues, as I said, my OS is in french, when I run the 2 first tests in RuntimeLocalization\RTL_SparkSkin\Integration\RTL_Compiler_LocaleParams_2_Tester :

        <TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body>
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="{['en_US','fr_FR','ja_JP']}" />
                <Pause timeout="1" />
            </body>
        </TestCase>

        <TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_NOT_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body>
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="{['en_US','fr_FR','ja_JP']}" />
                <Pause timeout="1" />
            </body>
        </TestCase>

The second one fails :

[java] RuntimeLocalization/RTL_SparkSkin/Integration/RTL_Compiler_LocaleParams_2_Tester RTL_Compiler_LocaleParams_1
_LocaleChain_NOT_AIR_Mac Failed AssertMethodValue (method cannot be shown)(body:step 1)  method returned fr_FR,en_US,ja_
JP, expected en_US,fr_FR,ja_JP

But the first one pass and I can't see the difference, I could make the test pass with my patch but I'm not sure if I have to do that, then at the moment I won't, especially because this test conatins weird things as well, I'm gonna open.

Otherwize, for this patch, everything goes well, just need to refactor it, it doesn't please me how I wrote it.
                  
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494893#comment-13494893 ] 

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

I'm actually running the all test suite again to check the other kind of issues I discovered before and check if I applied the modifications of this one everywhere.
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frédéric THOMAS updated FLEX-33242:
-----------------------------------

    Attachment: FLEX-33242.patch

This patch is a temporary patch, I'll have to modifiy AssertMethodValue as well because the method can use try/catch and then fall back in the same issue.

I'll need to adapt the failed tests too.
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frédéric THOMAS updated FLEX-33242:
-----------------------------------

    Attachment:     (was: FLEX-33242.patch)
    
> 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
>
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ 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

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

Posted by "Alex Harui (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495105#comment-13495105 ] 

Alex Harui commented on FLEX-33242:
-----------------------------------

Ah yes, AssertError can assume to take a string, but AssertPropertyValue can take an array.  For me, instead of adding a ValueArray type which requires a binding {} to use, I would've gone back and added a new property like "stringTokens" of type Array (which should not need binding {} to use).  Thoughts on that approach?
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494882#comment-13494882 ] 

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

What I had to do basicly, was to create a ValueArray class to not break the tests where Array where really used, the the essensial of the implementation is this one :

package {
    public class ValueArray {
        private var _parts:Array;

        public function ValueArray(parts:Array) {
            _parts = parts;
        }

        public function get parts():Array {
            return _parts;
        }
    }
}

In Assert :



	/**
	 *  convert everything to strings (like null)
	 */
	protected function valueToString(value:*):String
	{
		if (value == null)
			return "null";
		var s:String;

		if (value is Number)
		{
			if ((value is int) || (value is uint))
				s = value.toString();
			else
				s = value.toFixed(6);
		}

        else if (value is ValueArray) // added a specific test here
            s = ValueArray(value).parts.join('"..."') + '"';
		else
			s = value.toString();

		if (s == "[object Object]")
			s = ObjectUtil.toString(value, null, excludeList);
		return s;
	}

    protected function contains(value:*, expectedError:ValueArray):Boolean {
        if (expectedError && expectedError.parts && expectedError.parts.length)
            for (var i:uint = 0; i < expectedError.parts.length; i++) {
                if (valueToString(value).indexOf(valueToString(expectedError.parts[i])) == -1)
                    return false;
            }

        return true;
    }

in the doStep method AssertError, AssertPropertyValue and AssertMethodValue, if the value type is ValueArray, the check uses the contains method and the doFail output is adapted.

The use of this test methods looks like that now in case of checking for errors:

<AssertError value="{new ValueArray(['ReferenceError: Error #1074:', 'country', 'mx.resources.Locale'])}"/>
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frédéric THOMAS updated FLEX-33242:
-----------------------------------

    Attachment: FLEX-33242.patch

I added a property errorArray which is an Array.
I tested it against all tests and it works
                
> 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

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

Posted by "Alex Harui (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495107#comment-13495107 ] 

Alex Harui commented on FLEX-33242:
-----------------------------------

There are probably lots of bad assumptions in the tests.  I think these tests were only run in the US and India.  I changed a few tests already to do a low-level query of the FlashPlayer globalization and Capabilities APIs and store the result in a variable as the correct answer.  The point of most of these tests is to make sure Flex doesn't mess with the FlashPlayer's underlying implementations so the answer doesn't have to be hard-coded in the scripts.  You should be able to find some of those changes in the SVN history.  
                
> 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

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

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ 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 edited comment on FLEX-33242 at 11/10/12 4:12 PM:
------------------------------------------------------------------

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.

This kind of tests don't work either:

<TestCase frequency="all" testID="RTL_Compiler_LocaleParams_1_LocaleChain_NOT_AIR_Mac" description="Be sure that the locale chain was set correctly." keywords="[Localization,Compiler,locale]" >
            <body> 
                <AssertMethodValue method="value=ResourceManager.getInstance().localeChain.toString()" value="en_US,fr_FR,ja_JP" /> 
                <Pause timeout="1" />
            </body> 
        </TestCase>  

Probably because my OS is in french, the fr_FR is return first, en_US was 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).
                
      was (Author: doublefx):
    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