Hi Diogo,

According to me, the encoding problem can be located in 2 places:
1) During the compilation of your Java source
2) During web processing

Because web processing is done by httpclient which is a very robust solution, I 
suggest you start by looking at your Java source encoding. If you are using 
Maven, you should specify source encoding in the compiler plugin configuration. 
If not, it is the default system encoding that is used (CP1252 with a Spanish 
Windows I guess).

Another solution is to replace every non ascii character by the UTF-8 
equivalent:

assertTextInTable("country", "Espa\u00F1a");

Hope it helps,

Regards,

Julien




________________________________
De : Diogo Henriques <[email protected]>
À : Usage problems for JWebUnit <[email protected]>
Envoyé le : Vendredi, 16 Janvier 2009, 12h28mn 33s
Objet : Re: [JWebUnit-users] Re : How to create an testing environment with 
Jwebunit

Hi Julien,

You are right. I manage to do it. Using an specific web.xml for running jetty 
with a test spring application context, in order to connect to a distinct 
database and specific setups for that purpose.

But now I have a complete different question. 
When I am doing something like assertTextInTable("country", "España"); the test 
fails because of the special character ñ .  I would say that this is somehow 
related to the enconding or not ? If is that case how can I set the enconding 
to support UTF-8 ? Because all the other cases withouth special characters 
don't fail the test.

Thanks in advance,

Diogo


2009/1/14 Julien HENRY <[email protected]>

Hi Diogo,

If you manage to run your JUnit tests on a testing DB you should be able to do 
the same to run your JWebUnit tests on the same DB. JWebUnit is a layer on top 
of JUnit, so I don't understand why you can't use the same mecanism? Is there 
something I didn't understand in your question?

Regards,

Julien





________________________________
De : Diogo Henriques <[email protected]>
À : [email protected]
Envoyé le : Mercredi, 14 Janvier 2009, 11h37mn 54s
Objet : [JWebUnit-users] How to create an testing environment with Jwebunit


Hi,

I've been exploring and creating some test cases in order to see the 
possibilities and benefits of this framework to integration tests. I've it 
already integrated with maven and jetty to run the tests before generate the 
war in a continuos integration environment, and so far everything is going fine 
and it must be said that jwebunit team is doing a good work :))  

Although I coudn't , so far, create a database testing environment to run the 
tests.  For example, in my project we have a development, production, testing 
database. When running the data unit tests, data layer, JUnit uses a testing 
environment (spring application context defined for testing, and xml file with 
the data testing to be inserted before running the tests). So I would like to 
use the same logic with jwebunit ... Run the tests under a test environment ... 
is there any solution or a best practices to do it ? I am using jwebunit 2.1, 
Stripes, Spring and Jetty 

thanks in advance,

Diogo Henriques



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users


      
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to