aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-base
diff options
context:
space:
mode:
authorJoakim Erdfelt <joakime@apache.org>2007-04-26 14:57:16 +0000
committerJoakim Erdfelt <joakime@apache.org>2007-04-26 14:57:16 +0000
commit14e5ac5eb3e357dbfa2436765c78ce377238799c (patch)
tree9704f4e28cb8bc817ad147a3b33128953b8507dd /archiva-base
parentb0003019c09dc411daafe611fb22d9650748c001 (diff)
downloadarchiva-14e5ac5eb3e357dbfa2436765c78ce377238799c.tar.gz
archiva-14e5ac5eb3e357dbfa2436765c78ce377238799c.zip
Fixes for tests under windows.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@532767 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base')
-rw-r--r--archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java2
-rw-r--r--archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java6
-rw-r--r--archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java11
3 files changed, 12 insertions, 7 deletions
diff --git a/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java b/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java
index 6985ef06a..900b7e7c9 100644
--- a/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java
+++ b/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java
@@ -102,7 +102,7 @@ public class XMLReader
try
{
InputStream in = url.openStream();
- InputStreamReader inReader = new InputStreamReader( in );
+ InputStreamReader inReader = new InputStreamReader( in, "UTF-8" );
LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader );
this.document = reader.read( latinReader );
}
diff --git a/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java b/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java
index c2424f368..396d4b952 100644
--- a/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java
+++ b/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java
@@ -33,9 +33,9 @@ public class LatinEntitiesTest
public void testResolveEntity()
{
// Good Entities.
- assertEquals( "©", LatinEntities.resolveEntity( "&copy;" ) );
- assertEquals( "∞", LatinEntities.resolveEntity( "&infin;" ) );
- assertEquals( "ø", LatinEntities.resolveEntity( "&oslash;" ) );
+ assertEquals( "\u00a9", LatinEntities.resolveEntity( "&copy;" ) );
+ assertEquals( "\u221e", LatinEntities.resolveEntity( "&infin;" ) );
+ assertEquals( "\u00f8", LatinEntities.resolveEntity( "&oslash;" ) );
// Bad Entities.
assertEquals( "", LatinEntities.resolveEntity( "" ) );
diff --git a/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java b/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java
index b02daeca3..7cf8853f7 100644
--- a/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java
+++ b/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java
@@ -35,6 +35,11 @@ import java.util.List;
public class XMLReaderTest
extends AbstractArchivaXmlTestCase
{
+ private static final String OSLASH = "\u00f8";
+ private static final String TRYGVIS = "Trygve Laugst" + OSLASH + "l";
+ private static final String INFIN = "\u221e";
+ private static final String INFINITE_ARCHIVA = "The " + INFIN + " Archiva";
+
private void assertElementTexts( List elementList, String[] expectedTexts )
{
assertEquals( "Element List Size", expectedTexts.length, elementList.size() );
@@ -70,7 +75,7 @@ public class XMLReaderTest
XMLReader reader = new XMLReader( "basic", xmlFile );
List names = reader.getElementList( "//basic/names/name" );
- assertElementTexts( names, new String[] { "Trygve Laugstøl", "The ∞ Archiva" } );
+ assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } );
}
public void testNoPrologUtf8Read()
@@ -80,7 +85,7 @@ public class XMLReaderTest
XMLReader reader = new XMLReader( "basic", xmlFile );
List names = reader.getElementList( "//basic/names/name" );
- assertElementTexts( names, new String[] { "Trygve Laugstøl", "The ∞ Archiva" } );
+ assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } );
}
public void testPrologUtf8Read()
@@ -90,7 +95,7 @@ public class XMLReaderTest
XMLReader reader = new XMLReader( "basic", xmlFile );
List names = reader.getElementList( "//basic/names/name" );
- assertElementTexts( names, new String[] { "Trygve Laugstøl", "The ∞ Archiva" } );
+ assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } );
}
}