ICU-5340 Moved position of TransliteratorTest.TestAny() in the file after porting the test to C++, to keep the file organizations consistent.

X-SVN-Rev: 25822
This commit is contained in:
Andy Heninger 2009-04-17 21:08:41 +00:00
parent b547d95cb0
commit 3503d74f28

View file

@ -2856,6 +2856,27 @@ public class TransliteratorTest extends TestFmwk {
"greek:abkABK hiragana:abuku cyrillic:abc");
}
/**
* Test Any-X transliterators with sample letters from all scripts.
*/
public void TestAny() {
UnicodeSet alphabetic = (UnicodeSet) new UnicodeSet("[:alphabetic:]").freeze();
StringBuffer testString = new StringBuffer();
for (int i = 0; i < UScript.CODE_LIMIT; ++i) {
UnicodeSet sample = new UnicodeSet().applyPropertyAlias("script", UScript.getShortName(i)).retainAll(alphabetic);
int count = 5;
for (UnicodeSetIterator it = new UnicodeSetIterator(sample); it.next();) {
testString.append(it.getString());
if (--count < 0) break;
}
}
logln("Sample set for Any-Latin: " + testString);
Transliterator anyLatin = Transliterator.getInstance("any-Latn");
String result = anyLatin.transliterate(testString.toString());
logln("Sample result for Any-Latin: " + result);
}
/**
* Test the source and target set API. These are only implemented
* for RBT and CompoundTransliterator at this time.
@ -3374,23 +3395,6 @@ the ::BEGIN/::END stuff)
logln("source = " + t.getSourceSet());
logln("target = " + t.getTargetSet());
}
public void TestAny() {
UnicodeSet alphabetic = (UnicodeSet) new UnicodeSet("[:alphabetic:]").freeze();
StringBuffer testString = new StringBuffer();
for (int i = 0; i < UScript.CODE_LIMIT; ++i) {
UnicodeSet sample = new UnicodeSet().applyPropertyAlias("script", UScript.getShortName(i)).retainAll(alphabetic);
int count = 5;
for (UnicodeSetIterator it = new UnicodeSetIterator(sample); it.next();) {
testString.append(it.getString());
if (--count < 0) break;
}
}
logln("Sample set for Any-Latin: " + testString);
Transliterator anyLatin = Transliterator.getInstance("any-Latn");
String result = anyLatin.transliterate(testString.toString());
logln("Sample result for Any-Latin: " + result);
}
/*
* Test case for threading problem in NormalizationTransliterator
* reported by ticket#5160