public void testResolveEntity()
{
// Good Entities.
- assertEquals( "©", LatinEntities.resolveEntity( "©" ) );
- assertEquals( "∞", LatinEntities.resolveEntity( "∞" ) );
- assertEquals( "ø", LatinEntities.resolveEntity( "ø" ) );
+ assertEquals( "\u00a9", LatinEntities.resolveEntity( "©" ) );
+ assertEquals( "\u221e", LatinEntities.resolveEntity( "∞" ) );
+ assertEquals( "\u00f8", LatinEntities.resolveEntity( "ø" ) );
// Bad Entities.
assertEquals( "", LatinEntities.resolveEntity( "" ) );
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() );
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()
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()
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 } );
}
}