I'm for the last proposal and I was thinking about to create an other
assertion like AssertErrorContains which would take an Array as parameter to
check the error value against.
Something like <AssertErrorContains value="{['ReferenceError: Error #1074:',
'variant', 'mx.resources.Locale.']}"/>
What do you think ?
-----Message d'origine-----
From: Alex Harui
Sent: Monday, November 05, 2012 6:12 AM
To: flex-dev@incubator.apache.org
Subject: Re: About Flex runtime
On 11/4/12 6:51 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
3- I've still got 48 failures, that's because they expect english error
text
to be return and my debug flash player version output them in french.
[java] resources/Locale/Properties/Locale_Properties_variant
Locale_variant_is_read_only Failed AssertErro(body:ste
p 2) Expected Error ReferenceError: Error #1074: Illegal write to
read-only
property variant on mx.resources.Locale., g
ot ReferenceError: Error #1074: Ecriture illÚgale dans une propriÚtÚ en
lecture seule variant sur mx.resources.Locale.
Thanks for finding this issue. I think we should change AssertError to clip
off everything after the second ":". Then it would compare just
"ReferenceError: Error #1074:".
Another option is to create a low-level sequence of code to generate the
correct answer. I did that on some tests already. There were some tests
that would sort some french strings and different Mac OS versions reported
different ordering due to some unicode standard change. The goal of those
tests were to make sure all of the Flex sorting code would return the same
order as the player would on a simple sort of some strings in an Array so
the test sets up a low-level array, sorts it, and makes that the "correct
answer". You could do somehing similar by setting up a simple AS class with
a read-only property, try to write to it, capture the error message,
determine the pattern, convert it to be the correct answer for a read-only
property on the mx.resource.Locale class.
Yet another option is the first option but also add new properties that
require that certain non-translatable strings be in the remainder of the
error message. So, a ReferenceError of #1074 that has the strings 'variant'
and 'mx.resource.Locale' in it. That would really limit false results.
I think I like this last one best. How about you?
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui