ICU-5615 Added a test case for 5615 to make sure BreakIterator factory method work for all available locales

X-SVN-Rev: 21123
This commit is contained in:
Yoshito Umaoka 2007-02-26 15:48:11 +00:00
parent 7d227b0bd2
commit c77ccbbe0f

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2006, International Business Machines Corporation and *
* Copyright (C) 1996-2007, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -820,5 +820,27 @@ public class BreakIteratorTest extends TestFmwk
expected.add("them?");
generalIteratorTest(lineBreak, expected);
}
/**
* Ticket#5615
*/
public void TestT5615() {
com.ibm.icu.util.ULocale[] ulocales = BreakIterator.getAvailableULocales();
int type = 0;
com.ibm.icu.util.ULocale loc = null;
try {
for (int i = 0; i < ulocales.length; i++) {
loc = ulocales[i];
for (type = 0; type <= 4; ++type) {
BreakIterator brk = BreakIterator.getBreakInstance(loc, type);
if (brk == null) {
errln("ERR: Failed to create an instance type: " + type + " / locale: " + loc);
}
}
}
} catch (Exception e) {
errln("ERR: Failed to create an instance type: " + type + " / locale: " + loc + " / exception: " + e.getMessage());
}
}
}