> The only way I can consider of testing this reliably is to keep the test
> code using platform encoding and have two executions of surefire, the first
> leaving things as is and the second with file.encoding set to a different
> value.

For http://jira.codehaus.org/browse/SUREFIRE-740 I had to use MAVEN_OPTS
to set the relevant locale settings in an integration test with
maven-verifier. This is basically just a variation of the forkMode
settings on surefire but it took me a couple of hours to get there ;)

I would also suppose you might be able to get somewhere by making the
locale an injectable attribute of the production code so you could
somehow make assumptions fail, much like one does when testing
time-based logic (make an injectable TimeSource or similar).

I still somehow sense that this lead to some very subtle tests that can
be hard for everyone but the original author to understand, and after a
few months even she has problems. Some kind of fork with different
settings probably has much clearer focus on what is being tested.

Kristian



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to