Hi all,

I got a quite strange problem with my tests. I have 3 tests that shall control some messages for the user. These messages contain some German umlauts (ä, ö, ü and ß). On my Ubuntu developer machine the tests run fine. On my SuSE integration server the tests fail. The assertions fail with the following message:

   expected:<...ü...> but was:<...??...>

Obviously, the test files and the tested file are compiled with different encodings.

I have tried several settings with UTF-8,

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>src-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
<fork>true</fork>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-Dfile.encoding=utf8</argLine>
</configuration>
</execution>
<execution>
<id>default-compile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
<fork>true</fork>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-Dfile.encoding=utf8</argLine>
</configuration>
</execution>
</executions>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
<fork>true</fork>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-Dfile.encoding=utf8</argLine>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compile.encoding>UTF-8</maven.compile.encoding>
</properties>

Some settings are redundant, but two are better than one. Any way, these settings don't apply to the compiling of the test files. I have searched some hours for similar problems, but I found no other solution. To be complete, my configuration:

  SuSE 11.1
  IBM JDK 1.5.0
  Maven 2.2.1


Thanks for any idea,
Andreas

Reply via email to