Removing the 'will fail on JDK 1.6' as we now have a pre 1.6 implementation
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1062493 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ead7d965e7
commit
2be456f665
|
@ -242,29 +242,20 @@ public class StringUtilsTrimEmptyTest extends TestCase {
|
|||
}
|
||||
|
||||
public void testStripAccents() {
|
||||
if(SystemUtils.isJavaVersionAtLeast(1.6f)) {
|
||||
String cue = "\u00C7\u00FA\u00EA";
|
||||
assertEquals( "Failed to strip accents from " + cue, "Cue", StringUtils.stripAccents(cue));
|
||||
String cue = "\u00C7\u00FA\u00EA";
|
||||
assertEquals( "Failed to strip accents from " + cue, "Cue", StringUtils.stripAccents(cue));
|
||||
|
||||
String lots = "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C7\u00C8\u00C9" +
|
||||
"\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D1\u00D2\u00D3" +
|
||||
"\u00D4\u00D5\u00D6\u00D9\u00DA\u00DB\u00DC\u00DD";
|
||||
assertEquals( "Failed to strip accents from " + lots,
|
||||
"AAAAAACEEEEIIIINOOOOOUUUUY",
|
||||
StringUtils.stripAccents(lots));
|
||||
String lots = "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C7\u00C8\u00C9" +
|
||||
"\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D1\u00D2\u00D3" +
|
||||
"\u00D4\u00D5\u00D6\u00D9\u00DA\u00DB\u00DC\u00DD";
|
||||
assertEquals( "Failed to strip accents from " + lots,
|
||||
"AAAAAACEEEEIIIINOOOOOUUUUY",
|
||||
StringUtils.stripAccents(lots));
|
||||
|
||||
assertNull( "Failed null safety", StringUtils.stripAccents(null) );
|
||||
assertEquals( "Failed empty String", "", StringUtils.stripAccents("") );
|
||||
assertEquals( "Failed to handle non-accented text", "control", StringUtils.stripAccents("control") );
|
||||
assertEquals( "Failed to handle easy example", "eclair", StringUtils.stripAccents("\u00E9clair") );
|
||||
} else {
|
||||
try {
|
||||
StringUtils.stripAccents("string");
|
||||
fail("Before JDK 1.6, stripAccents is not expected to work");
|
||||
} catch(UnsupportedOperationException uoe) {
|
||||
assertEquals("The stripAccents(String) method is not supported until Java 1.6", uoe.getMessage());
|
||||
}
|
||||
}
|
||||
assertNull( "Failed null safety", StringUtils.stripAccents(null) );
|
||||
assertEquals( "Failed empty String", "", StringUtils.stripAccents("") );
|
||||
assertEquals( "Failed to handle non-accented text", "control", StringUtils.stripAccents("control") );
|
||||
assertEquals( "Failed to handle easy example", "eclair", StringUtils.stripAccents("\u00E9clair") );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue