You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Juergen Donnerstag <ju...@gmail.com> on 2011/05/08 11:13:27 UTC

Test failure probably due to locale

Hi,

on my (german) laptop testComponentAttributesNotDoubleEscaped is failing.

junit.framework.AssertionFailedError: One of the pound entity
representations is missing: &pound; or &#163;
	at org.apache.wicket.markup.ComponentTagAttributeEscapingTest.testComponentAttributesNotDoubleEscaped(ComponentTagAttributeEscapingTest.java:48)

The output looks like: <html><body><a wicket:id="link"
onclick="alert(&#039;alerting: &amp; ££ &#039;)"
href="../page?0-1.ILinkListener-link"
some_attribute="&amp;">link</a><input type="submit" wicket:id="button"
value="Watch escaped value: &gt;&gt;" name="button"
id="button1"/></body></html>

The assertion test is like: response.contains("££"));   replacing it
with response.contains("\u00A3\u00A3")); works for me.

Interestingly it's failing in eclipse only. It passes the test with maven

-Juergen

Re: Test failure probably due to locale

Posted by Carl-Eric Menzel <cm...@wicketbuch.de>.
On Sun, 8 May 2011 11:13:27 +0200
Juergen Donnerstag <ju...@gmail.com> wrote:

> The assertion test is like: response.contains("££"));   replacing it
> with response.contains("\u00A3\u00A3")); works for me.

It's loading UTF-8 data but interprets it as probably ISO-8859-1.

> Interestingly it's failing in eclipse only. It passes the test with
> maven

That almost certainly means the encoding in Eclipse isn't set right.
Set it either globally to UTF-8 (my preference) or manually on the
project or the file itself.

Hope this helps
Carl-Eric
www.wicketbuch.de

Re: Test failure probably due to locale

Posted by Martin Grigorov <mg...@apache.org>.
Yep. Maybe you're right.

On Sun, May 8, 2011 at 12:06 PM, Juergen Donnerstag
<ju...@gmail.com> wrote:
> I think we should strive to avoid telling users they have to set up
> their IDE in a specific way. Instead I'd suggest to replace £ with
> \u00A3. That should work everywhere irrespective of any IDE or OS
> setting.
>
>
> On Sun, May 8, 2011 at 11:46 AM, Martin Grigorov <mg...@apache.org> wrote:
>> The code actually looks like:
>> assertTrue("One of the pound entity representations is missing:
>> &pound; or &#163;",
>>                        response.contains("££"));
>> i.e. "££" seems to be broken by your ide.
>>
>> See at http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/markup/ComponentTagAttributeEscapingTest.java?view=markup
>>
>> On Sun, May 8, 2011 at 11:43 AM, Juergen Donnerstag
>> <ju...@gmail.com> wrote:
>>> The *root* cause seems to be obvious. Instead of changing any eclipse
>>> settings, the assert statement must be changed. Replace "££" with a
>>> properly encoded unicode \uXXXX
>>>
>>> Juergen
>>>
>>> On Sun, May 8, 2011 at 11:24 AM, Martin Grigorov <mg...@apache.org> wrote:
>>>> My Eclipse uses en_US locale and all is fine.
>>>> My Maven setup uses bg_BG and again all is fine. Just verified.
>>>> Igor mentioned that this test started to fail at his machine
>>>> yesterday, but I guess his setup completely is en_US.
>>>>
>>>> On Sun, May 8, 2011 at 11:13 AM, Juergen Donnerstag
>>>> <ju...@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> on my (german) laptop testComponentAttributesNotDoubleEscaped is failing.
>>>>>
>>>>> junit.framework.AssertionFailedError: One of the pound entity
>>>>> representations is missing: &pound; or &#163;
>>>>>        at org.apache.wicket.markup.ComponentTagAttributeEscapingTest.testComponentAttributesNotDoubleEscaped(ComponentTagAttributeEscapingTest.java:48)
>>>>>
>>>>> The output looks like: <html><body><a wicket:id="link"
>>>>> onclick="alert(&#039;alerting: &amp; ££ &#039;)"
>>>>> href="../page?0-1.ILinkListener-link"
>>>>> some_attribute="&amp;">link</a><input type="submit" wicket:id="button"
>>>>> value="Watch escaped value: &gt;&gt;" name="button"
>>>>> id="button1"/></body></html>
>>>>>
>>>>> The assertion test is like: response.contains("££"));   replacing it
>>>>> with response.contains("\u00A3\u00A3")); works for me.
>>>>>
>>>>> Interestingly it's failing in eclipse only. It passes the test with maven
>>>>>
>>>>> -Juergen
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Martin Grigorov
>>>> jWeekend
>>>> Training, Consulting, Development
>>>> http://jWeekend.com
>>>>
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: Test failure probably due to locale

Posted by Juergen Donnerstag <ju...@gmail.com>.
I think we should strive to avoid telling users they have to set up
their IDE in a specific way. Instead I'd suggest to replace £ with
\u00A3. That should work everywhere irrespective of any IDE or OS
setting.


On Sun, May 8, 2011 at 11:46 AM, Martin Grigorov <mg...@apache.org> wrote:
> The code actually looks like:
> assertTrue("One of the pound entity representations is missing:
> &pound; or &#163;",
>                        response.contains("££"));
> i.e. "££" seems to be broken by your ide.
>
> See at http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/markup/ComponentTagAttributeEscapingTest.java?view=markup
>
> On Sun, May 8, 2011 at 11:43 AM, Juergen Donnerstag
> <ju...@gmail.com> wrote:
>> The *root* cause seems to be obvious. Instead of changing any eclipse
>> settings, the assert statement must be changed. Replace "££" with a
>> properly encoded unicode \uXXXX
>>
>> Juergen
>>
>> On Sun, May 8, 2011 at 11:24 AM, Martin Grigorov <mg...@apache.org> wrote:
>>> My Eclipse uses en_US locale and all is fine.
>>> My Maven setup uses bg_BG and again all is fine. Just verified.
>>> Igor mentioned that this test started to fail at his machine
>>> yesterday, but I guess his setup completely is en_US.
>>>
>>> On Sun, May 8, 2011 at 11:13 AM, Juergen Donnerstag
>>> <ju...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> on my (german) laptop testComponentAttributesNotDoubleEscaped is failing.
>>>>
>>>> junit.framework.AssertionFailedError: One of the pound entity
>>>> representations is missing: &pound; or &#163;
>>>>        at org.apache.wicket.markup.ComponentTagAttributeEscapingTest.testComponentAttributesNotDoubleEscaped(ComponentTagAttributeEscapingTest.java:48)
>>>>
>>>> The output looks like: <html><body><a wicket:id="link"
>>>> onclick="alert(&#039;alerting: &amp; ££ &#039;)"
>>>> href="../page?0-1.ILinkListener-link"
>>>> some_attribute="&amp;">link</a><input type="submit" wicket:id="button"
>>>> value="Watch escaped value: &gt;&gt;" name="button"
>>>> id="button1"/></body></html>
>>>>
>>>> The assertion test is like: response.contains("££"));   replacing it
>>>> with response.contains("\u00A3\u00A3")); works for me.
>>>>
>>>> Interestingly it's failing in eclipse only. It passes the test with maven
>>>>
>>>> -Juergen
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>

Re: Test failure probably due to locale

Posted by Martin Grigorov <mg...@apache.org>.
The code actually looks like:
assertTrue("One of the pound entity representations is missing:
&pound; or &#163;",
			response.contains("££"));
i.e. "££" seems to be broken by your ide.

See at http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/markup/ComponentTagAttributeEscapingTest.java?view=markup

On Sun, May 8, 2011 at 11:43 AM, Juergen Donnerstag
<ju...@gmail.com> wrote:
> The *root* cause seems to be obvious. Instead of changing any eclipse
> settings, the assert statement must be changed. Replace "££" with a
> properly encoded unicode \uXXXX
>
> Juergen
>
> On Sun, May 8, 2011 at 11:24 AM, Martin Grigorov <mg...@apache.org> wrote:
>> My Eclipse uses en_US locale and all is fine.
>> My Maven setup uses bg_BG and again all is fine. Just verified.
>> Igor mentioned that this test started to fail at his machine
>> yesterday, but I guess his setup completely is en_US.
>>
>> On Sun, May 8, 2011 at 11:13 AM, Juergen Donnerstag
>> <ju...@gmail.com> wrote:
>>> Hi,
>>>
>>> on my (german) laptop testComponentAttributesNotDoubleEscaped is failing.
>>>
>>> junit.framework.AssertionFailedError: One of the pound entity
>>> representations is missing: &pound; or &#163;
>>>        at org.apache.wicket.markup.ComponentTagAttributeEscapingTest.testComponentAttributesNotDoubleEscaped(ComponentTagAttributeEscapingTest.java:48)
>>>
>>> The output looks like: <html><body><a wicket:id="link"
>>> onclick="alert(&#039;alerting: &amp; ££ &#039;)"
>>> href="../page?0-1.ILinkListener-link"
>>> some_attribute="&amp;">link</a><input type="submit" wicket:id="button"
>>> value="Watch escaped value: &gt;&gt;" name="button"
>>> id="button1"/></body></html>
>>>
>>> The assertion test is like: response.contains("££"));   replacing it
>>> with response.contains("\u00A3\u00A3")); works for me.
>>>
>>> Interestingly it's failing in eclipse only. It passes the test with maven
>>>
>>> -Juergen
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: Test failure probably due to locale

Posted by Juergen Donnerstag <ju...@gmail.com>.
The *root* cause seems to be obvious. Instead of changing any eclipse
settings, the assert statement must be changed. Replace "££" with a
properly encoded unicode \uXXXX

Juergen

On Sun, May 8, 2011 at 11:24 AM, Martin Grigorov <mg...@apache.org> wrote:
> My Eclipse uses en_US locale and all is fine.
> My Maven setup uses bg_BG and again all is fine. Just verified.
> Igor mentioned that this test started to fail at his machine
> yesterday, but I guess his setup completely is en_US.
>
> On Sun, May 8, 2011 at 11:13 AM, Juergen Donnerstag
> <ju...@gmail.com> wrote:
>> Hi,
>>
>> on my (german) laptop testComponentAttributesNotDoubleEscaped is failing.
>>
>> junit.framework.AssertionFailedError: One of the pound entity
>> representations is missing: &pound; or &#163;
>>        at org.apache.wicket.markup.ComponentTagAttributeEscapingTest.testComponentAttributesNotDoubleEscaped(ComponentTagAttributeEscapingTest.java:48)
>>
>> The output looks like: <html><body><a wicket:id="link"
>> onclick="alert(&#039;alerting: &amp; ££ &#039;)"
>> href="../page?0-1.ILinkListener-link"
>> some_attribute="&amp;">link</a><input type="submit" wicket:id="button"
>> value="Watch escaped value: &gt;&gt;" name="button"
>> id="button1"/></body></html>
>>
>> The assertion test is like: response.contains("££"));   replacing it
>> with response.contains("\u00A3\u00A3")); works for me.
>>
>> Interestingly it's failing in eclipse only. It passes the test with maven
>>
>> -Juergen
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>

Re: Test failure probably due to locale

Posted by Martin Grigorov <mg...@apache.org>.
My Eclipse uses en_US locale and all is fine.
My Maven setup uses bg_BG and again all is fine. Just verified.
Igor mentioned that this test started to fail at his machine
yesterday, but I guess his setup completely is en_US.

On Sun, May 8, 2011 at 11:13 AM, Juergen Donnerstag
<ju...@gmail.com> wrote:
> Hi,
>
> on my (german) laptop testComponentAttributesNotDoubleEscaped is failing.
>
> junit.framework.AssertionFailedError: One of the pound entity
> representations is missing: &pound; or &#163;
>        at org.apache.wicket.markup.ComponentTagAttributeEscapingTest.testComponentAttributesNotDoubleEscaped(ComponentTagAttributeEscapingTest.java:48)
>
> The output looks like: <html><body><a wicket:id="link"
> onclick="alert(&#039;alerting: &amp; ££ &#039;)"
> href="../page?0-1.ILinkListener-link"
> some_attribute="&amp;">link</a><input type="submit" wicket:id="button"
> value="Watch escaped value: &gt;&gt;" name="button"
> id="button1"/></body></html>
>
> The assertion test is like: response.contains("££"));   replacing it
> with response.contains("\u00A3\u00A3")); works for me.
>
> Interestingly it's failing in eclipse only. It passes the test with maven
>
> -Juergen
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com