{
public void
test(TestHarness harness)
{
Collator col = Collator.getInstance(Locale.US);
harness.check(col.getStrength(), Collator.TERTIARY, "default strength");
harness.check(col.getDecomposition(), Collator.NO_DECOMPOSITION,
"default decomposition");
col.setStrength(Collator.PRIMARY);
harness.check(col.getStrength(), Collator.PRIMARY, "set/get strength");
col.setDecomposition(Collator.NO_DECOMPOSITION);
harness.check(col.getDecomposition(), Collator.NO_DECOMPOSITION,
"set/get decomposition");
try
{
col.setStrength(999);
harness.check(false, "invalid strength value");
}
catch (Exception e)
{
harness.check(true, "invalid strength value");
}
try
{
col.setDecomposition(999);
harness.check(false, "invalid decomposition value");
}
catch (Exception e)
{
harness.check(true, "invalid decomposition value");
}
Collator col2 = (Collator)col.clone();
col2.setStrength(Collator.SECONDARY);
harness.check(!col.equals(col2), "equals false");
harness.check(col.equals(col), "equals true");
}