[MNG-2254] the encoding parameter in xml declaration of POM is ignored

o Added UT

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@749076 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-01 19:14:05 +00:00
parent 54da0f4c95
commit 797e071685
3 changed files with 81 additions and 0 deletions

View File

@ -881,6 +881,15 @@ public void testPluginConfigurationUsingAttributesWithPluginManagementAndProfile
}
//*/
public void testPomEncoding()
throws Exception
{
PomTestWrapper pom = buildPom( "pom-encoding/utf-8" );
assertEquals( "TEST-CHARS: \u00DF\u0131\u03A3\u042F\u05D0\u20AC", pom.getValue( "description" ) );
pom = buildPom( "pom-encoding/latin-1" );
assertEquals( "TEST-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF", pom.getValue( "description" ) );
}
private void assertPathWithNormalizedFileSeparators( Object value )
{
assertEquals( new File( value.toString() ).getPath(), value.toString() );

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
NOTE: This POM's XML declaration intentionally declares Latin-1 encoding.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng2254</groupId>
<artifactId>latin-1</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-2254 :: Latin-1</name>
<description>TEST-CHARS: ÄÖÜäöüß</description>
</project>

View File

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
NOTE: This POM's XML declaration specified no encoding which should therefore default to UTF-8.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng2254</groupId>
<artifactId>utf-8</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-2254 :: UTF-8</name>
<description>TEST-CHARS: ßıΣЯא€</description>
</project>