Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
2.5
-
None
-
None
-
W2K3-server / JDK 1.5 (from SAP)
Description
Failing test case :
@Ignore public void convert_English_Thorn(){ beforeConversion = "AAÞþaa"; expectedAfterConversion = "aattaa"; Assert.assertEquals("Test NOT correctly configured length not correct", beforeConversion.length(), expectedAfterConversion.length()); afterConversion = converter.replaceAccents(beforeConversion); Assert.assertEquals("Cannot convert (Icelandic/old english thorn) '" + beforeConversion + "'.", expectedAfterConversion, afterConversion); }
String replaceAccents(final String aField) { String result = StringUtils.lowerCase(aField), target = null, charsToRemove = null; char charToPut = Constants.UNDERSCORE_CHARACTER, charToRemove = Constants.UNDERSCORE_CHARACTER; for (Object element : conversionMappings.keySet()) { target = element.toString(); if (target.equals(Constants.SPECIAL_CHARACTER_KEY)) { continue; } result = StringUtils.stripToNull(result); charsToRemove = conversionMappings.getProperty(target, Constants.EMPTY_STRING).toString(); charToPut = target.charAt(Constants.ZERO); for (int i=0; i<charsToRemove.length(); i++) { charToRemove = charsToRemove.charAt(i); result = StringUtils.replaceChars(result, charToRemove, charToPut); } } return result; }