The problem is in tester.assertErrorMessages at:
msgs.add(iterator.next().toString());

The .toString() returns string with iso-8859-1 encoding.


The workaround is to create your own assertErrorMessages like this:

                List<Serializable> actualMessages =
tester.getMessages(FeedbackMessage.ERROR);
                List<Serializable> msgs = new ArrayList<Serializable>();
                for (Iterator<Serializable> iterator = 
actualMessages.iterator();
iterator.hasNext();) {
                        msgs.add( new 
String(iterator.next().toString().getBytes("ISO-8859-1"),
"UTF-8") );
                }
                
WicketTesterHelper.assertEquals(Arrays.asList(expectedErrorMessages),
msgs);

What do you think about fixing the tester code as above? Maybe this is a
good idea because AFAIK Wicket works in UTF-8 but default.

Thanks,
Artur


-- 
View this message in context: 
http://www.nabble.com/WicketTester.assertErrorMessages---encoding-problem-tp20280074p20280466.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to