ICU-6824 Remove dependency on collator in test

X-SVN-Rev: 26515
This commit is contained in:
Mark Davis 2009-08-19 17:25:31 +00:00
parent bf1cd6d88e
commit 2a21b4cfb7

View File

@ -6,11 +6,12 @@
*/
package com.ibm.icu.dev.test.translit;
import java.text.Collator;
import java.util.Locale;
import com.ibm.icu.dev.test.TestFmwk;
import com.ibm.icu.dev.test.util.PrettyPrinter;
import com.ibm.icu.text.Collator;
import com.ibm.icu.text.UnicodeSet;
import com.ibm.icu.util.ULocale;
public class PrettyPrinterTest extends TestFmwk {
public static void main(String[] args) throws Exception {
@ -20,11 +21,13 @@ public class PrettyPrinterTest extends TestFmwk {
public void TestBasicUnicodeSet() {
Collator spaceComp = Collator.getInstance(Locale.ENGLISH);
spaceComp.setStrength(Collator.PRIMARY);
final PrettyPrinter PRETTY_PRINTER = new PrettyPrinter()
.setOrdering(Collator.getInstance(ULocale.ROOT))
.setSpaceComparator(Collator.getInstance(ULocale.ROOT).setStrength2(Collator.PRIMARY))
.setToQuote(TO_QUOTE)
.setSpaceComparator(Collator.getInstance(ULocale.ROOT).setStrength2(Collator.PRIMARY));
.setOrdering(Collator.getInstance(Locale.ENGLISH))
.setSpaceComparator(spaceComp)
.setToQuote(TO_QUOTE);
UnicodeSet expected = new UnicodeSet("[:L:]");
String formatted = PRETTY_PRINTER.format(expected);