You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Cedric Dumoulin <ce...@lifl.fr> on 2003/02/26 17:08:49 UTC

Test suites fail on localized computer

  Hi all,

  Today I have run the test suite test.tomcat.41, but it fail on my 
computer:

    [junit] junit.framework.AssertionFailedError: expected:<1,234> but 
was:<1Â 234>
    [junit]     at 
org.apache.struts.taglib.bean.TestWriteTag.formatAndTest(TestWriteTag.java:122)
    [junit]     at 
org.apache.struts.taglib.bean.TestWriteTag.endWriteTagNameFormat(TestWriteTag.java:153)
 
  Checking the code, it appear that we compare a localized string 
returned by the server with a static string not localized ;-). This 
should work well when the server is US_en, but doesn't work with FR_fr, 
and other locales.
Note that the shown returned string (<1Â 234>) is not necessarily the 
real returned string, because the text file used to catch the output 
doesn't support well localization.

  There is other comparisons of this kind in the TestWriteTag file, and 
maybe in other files. I have try to run ant with other locale 
parameters, with no success: Tomcat is always launched with the locale 
of my computer, which I can't change.
  As a result, I can't run the test suites. Is there someone who have a 
simple solution, or should we change the TestWriteTag file (how?).

        cedric



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Test suites fail on localized computer

Posted by Cedric Dumoulin <ce...@apache.org>.
  Thanks for the  fix, it works fine for me now.

    Cedric

James Mitchell wrote:

>LOL....now this is interesting, supposing I had picked a different
>locale....who knows how long this might have gone undetected.  
>
>I just changed my regional settings to France and my tests failed as
>well.  I already see the problem and will commit the fix tonight.  I
>forced the locale for the MessageTag tests, but forgot to do the same
>for WriteTag.
>
>
>--
>James Mitchell
>Software Engineer/Struts Evangelist
>
>
>
>
>  
>
>>-----Original Message-----
>>From: Cedric Dumoulin [mailto:cedric.dumoulin@lifl.fr] 
>>Sent: mercredi 26 février 2003 11:09
>>To: Struts Developers List
>>Subject: Test suites fail on localized computer
>>
>>
>>
>>  Hi all,
>>
>>  Today I have run the test suite test.tomcat.41, but it fail on my 
>>computer:
>>
>>    [junit] junit.framework.AssertionFailedError: 
>>expected:<1,234> but 
>>was:<1Â 234>
>>    [junit]     at 
>>org.apache.struts.taglib.bean.TestWriteTag.formatAndTest(TestW
>>riteTag.java:122)
>>    [junit]     at 
>>org.apache.struts.taglib.bean.TestWriteTag.endWriteTagNameForm
>>at(TestWriteTag.java:153)
>> 
>>  Checking the code, it appear that we compare a localized string 
>>returned by the server with a static string not localized ;-). This 
>>should work well when the server is US_en, but doesn't work 
>>with FR_fr, 
>>and other locales.
>>Note that the shown returned string (<1Â 234>) is not necessarily the 
>>real returned string, because the text file used to catch the output 
>>doesn't support well localization.
>>
>>  There is other comparisons of this kind in the TestWriteTag 
>>file, and 
>>maybe in other files. I have try to run ant with other locale 
>>parameters, with no success: Tomcat is always launched with 
>>the locale 
>>of my computer, which I can't change.
>>  As a result, I can't run the test suites. Is there someone 
>>who have a 
>>simple solution, or should we change the TestWriteTag file (how?).
>>
>>        cedric
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


RE: Test suites fail on localized computer

Posted by James Mitchell <jm...@apache.org>.
If you just want a quick fix.  Drop the attached files on top of the
current ones.  Those will be what I commit tonight.

/src/test/org/apache/struts/taglib/bean/TestWriteTag.java
/web/test/test/org/apache/struts/taglib/bean/TestWriteTag.jsp

--
James Mitchell
Software Engineer/Struts Evangelist




> -----Original Message-----
> From: James Mitchell [mailto:jmitchell@apache.org] 
> Sent: mercredi 26 f�vrier 2003 11:38
> To: 'Struts Developers List'
> Subject: RE: Test suites fail on localized computer
> 
> 
> LOL....now this is interesting, supposing I had picked a different
> locale....who knows how long this might have gone undetected.  
> 
> I just changed my regional settings to France and my tests failed as
> well.  I already see the problem and will commit the fix tonight.  I
> forced the locale for the MessageTag tests, but forgot to do the same
> for WriteTag.
> 
> 
> --
> James Mitchell
> Software Engineer/Struts Evangelist
> 
> 
> 
> 
> > -----Original Message-----
> > From: Cedric Dumoulin [mailto:cedric.dumoulin@lifl.fr] 
> > Sent: mercredi 26 f�vrier 2003 11:09
> > To: Struts Developers List
> > Subject: Test suites fail on localized computer
> > 
> > 
> > 
> >   Hi all,
> > 
> >   Today I have run the test suite test.tomcat.41, but it fail on my 
> > computer:
> > 
> >     [junit] junit.framework.AssertionFailedError: 
> > expected:<1,234> but 
> > was:<1� 234>
> >     [junit]     at 
> > org.apache.struts.taglib.bean.TestWriteTag.formatAndTest(TestW
> > riteTag.java:122)
> >     [junit]     at 
> > org.apache.struts.taglib.bean.TestWriteTag.endWriteTagNameForm
> > at(TestWriteTag.java:153)
> >  
> >   Checking the code, it appear that we compare a localized string 
> > returned by the server with a static string not localized ;-). This 
> > should work well when the server is US_en, but doesn't work 
> > with FR_fr, 
> > and other locales.
> > Note that the shown returned string (<1� 234>) is not 
> necessarily the 
> > real returned string, because the text file used to catch 
> the output 
> > doesn't support well localization.
> > 
> >   There is other comparisons of this kind in the TestWriteTag 
> > file, and 
> > maybe in other files. I have try to run ant with other locale 
> > parameters, with no success: Tomcat is always launched with 
> > the locale 
> > of my computer, which I can't change.
> >   As a result, I can't run the test suites. Is there someone 
> > who have a 
> > simple solution, or should we change the TestWriteTag file (how?).
> > 
> >         cedric
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> 

RE: Test suites fail on localized computer

Posted by James Mitchell <jm...@apache.org>.
LOL....now this is interesting, supposing I had picked a different
locale....who knows how long this might have gone undetected.  

I just changed my regional settings to France and my tests failed as
well.  I already see the problem and will commit the fix tonight.  I
forced the locale for the MessageTag tests, but forgot to do the same
for WriteTag.


--
James Mitchell
Software Engineer/Struts Evangelist




> -----Original Message-----
> From: Cedric Dumoulin [mailto:cedric.dumoulin@lifl.fr] 
> Sent: mercredi 26 février 2003 11:09
> To: Struts Developers List
> Subject: Test suites fail on localized computer
> 
> 
> 
>   Hi all,
> 
>   Today I have run the test suite test.tomcat.41, but it fail on my 
> computer:
> 
>     [junit] junit.framework.AssertionFailedError: 
> expected:<1,234> but 
> was:<1Â 234>
>     [junit]     at 
> org.apache.struts.taglib.bean.TestWriteTag.formatAndTest(TestW
> riteTag.java:122)
>     [junit]     at 
> org.apache.struts.taglib.bean.TestWriteTag.endWriteTagNameForm
> at(TestWriteTag.java:153)
>  
>   Checking the code, it appear that we compare a localized string 
> returned by the server with a static string not localized ;-). This 
> should work well when the server is US_en, but doesn't work 
> with FR_fr, 
> and other locales.
> Note that the shown returned string (<1Â 234>) is not necessarily the 
> real returned string, because the text file used to catch the output 
> doesn't support well localization.
> 
>   There is other comparisons of this kind in the TestWriteTag 
> file, and 
> maybe in other files. I have try to run ant with other locale 
> parameters, with no success: Tomcat is always launched with 
> the locale 
> of my computer, which I can't change.
>   As a result, I can't run the test suites. Is there someone 
> who have a 
> simple solution, or should we change the TestWriteTag file (how?).
> 
>         cedric
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org